How to create a directory using Ansible

后端 未结 22 1592
暗喜
暗喜 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:04

    Directory can be created using file module only, as directory is nothing but a file.

    # create a directory if it doesn't exist
    - file:
        path: /etc/some_directory
        state: directory
        mode: 0755
        owner: foo
        group: foo
    

提交回复
热议问题