File Transfer
Transfer a file directly to many servers
$ ansible europe -m copy -a "src=/etc/hosts dest=/tmp/hosts"
To change the ownership and permissions on files
$ ansible webservers -m file -a "dest=/srv/foo/a.txt mode=600"
$ ansible webservers -m file -a "dest=/srv/foo/b.txt mode=600 owner=example group=example"
To create directories
$ ansible webservers -m file -a "dest=/path/to/c mode=755 owner=example group=example state=directory“
To delete directories (recursively) and delete files
$ ansible webservers -m file -a "dest=/path/to/c state=absent
Last updated