ansible Automation Tools Hosts file configuration instance
[MWeb] cld1.web.ser.com ansible_connection=ssh ansible_host=10.19.51.212 ansible_ssh_private_ Key_file=/home/user1/.ssh/id_rsa
Cld3.web.ser. COM ansible_connection=ssh ansible_host=10.19.17.227 ansible_ssh_private_key_file=/home/user1/ . Ssh/id_rsa
[Sweb]
cld2.web.ser.com ansible_connection=ssh ansible_host=10.19.52.5 Ansible_ssh_private_key_fil E=/home/user1/.ssh/id_rsa
cld4.web.ser.com ansible_connection=ssh ansible_host=10.19.15.16 Ansible_ssh_private_key_file =/home/user1/.ssh/id_rsa
[Mpay]
cld1.pay.ser.com ansible_connection=ssh ansible_host=10.19.49.46 Ansible_ssh_private_key_fil E=/home/user1/.ssh/id_rsa
[Spay]
cld2.pay.ser.com ansible_connection=ssh ansible_host=10.23.40.202 Ansible_ssh_private_key_fil E=/home/user1/.ssh/id_rsa
[Qt1:children]
MWeb
[Qt2:children]
Sweb
[Zf1:children]
Mpay
[Zf2:children]
Spay
Remote Operation command format
Ansible qt1-m shell-a "Ps-ef | grep web19 "
Ansible qt1-m Shell-b-a "nginx-s quit"
Ansible qt1-m shell-b--become-user web19-a "nohup./restart.sh &"