蔬菜小程序的开发全流程详解
714
2022-10-10
ansible模块--unarchive模块
copy:copy=no为源tar包从被控端解压。 copy=tes 为源tar包从主控端解压src:源tar包路径dest:解压到的目标位置mode:解压后的文件权限
[root@ansible tmp]# ansible mysql -m unarchive -a 'src=/root/logs.tar.gz dest=/tmp copy=no'192.168.56.88 | CHANGED => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": true, "dest": "/tmp", "extract_results": { "cmd": [ "/usr/bin/gtar", "--extract", "-C", "/tmp", "-z", "-f", "/root/logs.tar.gz" ], "err": "", "out": "", "rc": 0 }, "gid": 0, "group": "root", "handler": "TgzArchive", "mode": "01777", "owner": "root", "size": 4096, "src": "/root/logs.tar.gz", "state": "directory", "uid": 0}
解压的时候加权限
[root@ansible tmp]# ansible mysql -m unarchive -a 'src=/root/logs.tar.gz dest=/tmp mode=777 copy=no'192.168.56.88 | CHANGED => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": true, "dest": "/tmp", "extract_results": { "cmd": [ "/usr/bin/gtar", "--extract", "-C", "/tmp", "-z", "-f", "/root/logs.tar.gz" ], "err": "", "out": "", "rc": 0 }, "gid": 0, "group": "root", "handler": "TgzArchive", "mode": "01777", "owner": "root", "size": 4096, "src": "/root/logs.tar.gz", "state": "directory", "uid": 0}
ansible
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~