copy src dest
content
backup
follow 如果有Link文件,拷贝过去的也会是link
force
group owner mode
把/srv/myfiles/foo.conf文件拷贝到远程节点/etc/foo.conf,并且它的拥有者是foo,拥有它的群组是foo,权限是0644
- copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644
跟上面的案例一样,不一样的只是权限的写法
- copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode="u=rw,g=r,o=r"
另外一个权限的写法
- copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode="u+rw,g-wx,o-rwx"
拷贝/mine/ntp.conf到远程节点/etc/ntp.conf,并且备份远程节点的/etc/ntp.conf。
- copy: src=/mine/ntp.conf dest=/etc/ntp.conf owner=root group=root mode=644 backup=yes
作者:OceanBreaker
来源:CSDN
原文:https://blog.csdn.net/modoo_junko/article/details/45080415
版权声明:本文为博主原创文章,转载请附上博文链接!