如何使用Ansible创建一个目录? [英] How to create a directory using Ansible?
本文介绍了如何使用Ansible创建一个目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用可执行的Playbook在基于debian的系统上在 / srv
上创建一个目录 www
p>
How to create a directory www
at /srv
on a debian based system using a Ansible playbook?
推荐答案
你想要文件模块。要创建目录,您需要指定选项 state = directory
:
You want the file module. To create a directory, you need to specify the option state=directory
:
- name: Creates directory
file: path=/src/www state=directory
您可以在 http://docs.ansible.com/file_module.html 上查看其他选项。
You can see other options at http://docs.ansible.com/file_module.html
这篇关于如何使用Ansible创建一个目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文