streda 16. februára 2022

ansible-playbook for creating files

playbook for creating directory

How to create directory with ansible-playbook?


---


- hosts: all

  tasks:

  - name : create directory /etc/ssh_keys directory

    ansible.builtin.file:

      path: /etc/ssh/keys

      state: directory

      mode: '0755'



Notes: 

ansible.builtin.file – Manage files and file properties

path: - (which directory will be created) 

state: - directory

mode: - permissions:


more: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html


Playbook on github: https://github.com/marsur/ansible_study/blob/main/playbook_mkdir.yaml 

Žiadne komentáre:

Zverejnenie komentára