1. Prepare for the CentOS environment
Yum Yum Upgrade
2. Control server and managed server requirements
Master:python 2.6+
Slave:python 2.4+, preferably also 2.6+ (CentOS 6.7 comes with)
3, configure SSH automatic login
Configure Master to login to each slave ssh without password (use Ssh-keygen on master to generate key pair and add id_rsa.pub to Authorized_keys of each slave)
4. Install ansible with Yum
Yum Install ansible
5. Configure Host
By default in/etc/ansible/hosts, add the slave IP address, for example
[Web] 192.168. 1.101 192.168. 1.102 192.168. 1.103
6. Testing
Ping
Successful ping with back display
192.168.1.101 | Success >> { "changed": false, "ping": "Pong"}192.168.1.102 | success >> { "changed": false,< c12/> "ping": "Pong"}192.168.1.103 | Success >> { "changed": false, "ping": "Pong"}
Basic View command:
' Uptime ' 'free-m'
CentOS 6.7 Installation Configuration Ansible