1、网络服务配置

yum -y install epel-release
yum -y install ansible
mkdir network
cd network/
[root@localhost network]# cat ansible.cfg
[defaults]
inventory=./hosts
[root@localhost network]# cat hosts
[all]
node1 ansible_host=10.163.1.100 ansible_user=root ansible_sudo_pass='1'
ansible_ssh_pass='1'
node2 ansible_host=10.163.1.101 ansible_user=root ansible_sudo_pass='1'
ansible_ssh_pass='1'
sed -i 's/^#.*StrictHostKeyChecking.*/StrictHostKeyChecking no/' /etc/ssh/ssh_config
[root@localhost network]# cat gather_service_facts.yml
---
- name: gather service facts
hosts