Ansible(2) - Ansible inventory configuration and connectivity testing Ansible配置主机和连接测试教程

1. open the inventory file with your favorite editor and modify it

1
sudo vi /etc/ansible/hosts

add servers likes below:

1
2
3
[servers]
server1 ansible_host=192.168.1.100 ansible_ssh_user=test_user ansible_ssh_pass=password ansible_ssh_extra_args='-o StrictHostKeyChecking=no'
server2 ansible_host=192.168.1.101 ansible_ssh_user=test_user ansible_ssh_pass=password ansible_ssh_extra_args='-o StrictHostKeyChecking=no'

2. verify the inventory

Read more