How to create a directory using Ansible

后端 未结 22 1629
暗喜
暗喜 2020-12-22 16:44

How do you create a directory www at /srv on a Debian-based system using an Ansible playbook?

22条回答
  •  盖世英雄少女心
    2020-12-22 17:17

    You can create a directory. using

    # create a directory if it doesn't exist
    - file: path=/src/www state=directory mode=0755
    

    You can also consult http://docs.ansible.com/ansible/file_module.html for further details regaridng directory and file system.

提交回复
热议问题