>/root/install.log[root@node1ansible]#ansibletestservers-mcopy-a'src=/root/install.logdes" />
ansible基本使用教程 |
您所在的位置:网站首页 › ansible-doc › ansible基本使用教程 |
[root@node1 ansible]# echo "test " >> /root/install.log[root@node1 ansible]# ansible testservers -m copy -a 'src=/root/install.log dest=/tmp/install.log owner=testuser group=testgroup backup=yes'192.168.100.132 | success >> { "backup_file": "/tmp/install.log.2016-02-25@16:01:26~", "changed": true, "checksum": "b5da7af32ad02eb98f77395b28f281a965b4c1f5", "dest": "/tmp/install.log", "gid": 1100, "group": "testgroup", "md5sum": "d39956add30a18019cb5ad2381a0cd43", "mode": "0644", "owner": "testuser", "size": 9464, "src": "/root/.ansible/tmp/ansible-tmp-1456387285.87-128685659798967/source", "state": "file", "uid": 1000} 192.168.100.131 | success >> { "backup_file": "/tmp/install.log.2016-02-25@16:01:26~", "changed": true, "checksum": "b5da7af32ad02eb98f77395b28f281a965b4c1f5", "dest": "/tmp/install.log", "gid": 1100, "group": "testgroup", "md5sum": "d39956add30a18019cb5ad2381a0cd43", "mode": "0644", "owner": "testuser", "size": 9464, "src": "/root/.ansible/tmp/ansible-tmp-1456387285.86-134452201968647/source", "state": "file", "uid": 1000} [root@node1 ansible]# ansible testservers -m raw -a 'ls -lrth /tmp/install*'192.168.100.131 | success | rc=0 >>-rw-r--r-- 1 root root 9.3K 2 25 16:00 /tmp/install.log.2016-02-25@16:01:26~-rw-r--r-- 1 testuser testgroup 9.3K 2 25 16:01 /tmp/install.log 192.168.100.132 | success | rc=0 >>-rw-r--r-- 1 root root 9.3K 2 25 16:00 /tmp/install.log.2016-02-25@16:01:26~-rw-r--r-- 1 testuser testgroup 9.3K 2 25 16:01 /tmp/install.log |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |