Ansible hosts configuration file instance

Source: Internet
Author: User
Tags ssh

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 &"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.