[deyu1@kvm19 ansible]$ vim webtest.yml [deyu1@kvm19 ansible]$ cat webtest.yml --- - name: Web test hosts: dev tasks: - ansible.builtin.file: path: /webtest state: directory group: webtest mode: '2775'
[deyu1@kvm19 ansible]$ ansible-playbook webtest.yml PLAY [Web test] **************************************************************** TASK [Gathering Facts] ********************************************************* ok: [kvm11] TASK [file] ******************************************************************** changed: [kvm11] PLAY RECAP ********************************************************************* kvm11u: ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[deyu1@kvm19 ansible]$ ansible dev -m shell -a "ls -ld /webtest" kvm11 | CHANGED | rc=0 >> drwxrwsr-x. 2 root webtest 4096 Mar 16 10:17 /webtest