- hosts: 127.0.0.1
tasks:
- name: mkdir
file:
path: /tmp/testdir/1
state: directory
recurse: yes
owner: test
- name: touch
file:
path: /tmp/testdir/1/1.txt
state: touch
owner: test
mode: 0600
notify: link
handlers:
- name: link
file:
path: /tmp/testdir/2
state: link
src: /tmp/testdir/1/1.txt
owner: test
mode: 0600
执行palybook ansible-playbook play.yml