ansible命令小记
ansible-i vm.host 192.168.34.57-m copy-a "src=/usr/scripts/scan_port.py dest=/tmp/"远程连接vm.host下的192.168.34.57主机,复制192.168.34.57:/usr/scripts/scan_port.py 到192.168.34.57:/tmp下
ansible-i bnxy.host bnxy -m command-a "yum -y install lrzsz"
bnxy.host的bnxy模块的主机用命令command全部执行yum -y install lrzsz
ansible-i bnxy.host bnxy -m shell-a "cd /usr/jyinit/optinits;svn up ./"
bnxy.host的bnxy模块的主机用shell执行脚本连接操作
ansible -i vm.host 192.168.34.64 -m service-a "name=mysqld state=restarted"
重启mysqld
页:
[1]