# This is the default ansible 'hosts' file.
## It should live in /etc/ansible/hosts## - Comments begin with the '#' character# - Blank lines are ignored# - Groups of hosts are delimited by [header] elements# - You can enter hostnames or ip addresses# - A hostname/ip can be a member of multiple groups# Ex 1: Ungrouped hosts, specify before any group headers.152.55.249.99 ansible_ssh_pass=test!2013152.55.249.98 ansible_ssh_pass=test!2013152.55.249.97 ansible_ssh_pass=test!2013152.55.249.96 ansible_ssh_pass=test!2013152.55.249.100 ansible_ssh_pass=test!2013## green.example.com## blue.example.com## 192.168.100.1## 192.168.100.10# Ex 2: A collection of hosts belonging to the 'webservers' group [test]152.55.249.[96:100] ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=test!2013 #152.55.249.97 ansible_ssh_pass=test!2013#152.55.249.98 ansible_ssh_pass=test!2013#152.55.249.99 ansible_ssh_pass=test!2013#ansible_ssh_host #用于指定被管理的主机的真实IP#ansible_ssh_port #用于指定连接到被管理主机的ssh端口号,默认是22 #ansible_ssh_user #ssh连接时默认使用的用户名 #ansible_ssh_pass #ssh连接时的密码 #ansible_sudo_pass #使用sudo连接用户时的密码 #ansible_sudo_exec #如果sudo命令不在默认路径,需要指定sudo命令路径 ansible_ssh_private_key_file #秘钥文件路径,秘钥文件如果不想使用ssh-agent管理时可以使用此选项 ansible_shell_type #目标系统的shell的类型,默认sh #ansible_connection #SSH 连接的类型: local , ssh , paramiko,在 ansible 1.2 之前默认是 paramiko ,后来智能选择,优先使用基于 ControlPersist 的 ssh (支持的前提) #ansible_python_interpreter #用来指定Python解释器的路径,默认为/usr/bin/python 同样可以指定ruby 、perl 的路径 #ansible_*_interpreter #其他解释器路径,用法和ansible_python_interpreter类似,这里"*"可以是ruby或才perl等其他语言# If you have multiple hosts following a pattern you can specify# them like this:## www[001:006].example.com# Ex 3: A collection of database servers in the 'dbservers' group## [dbservers]## ## db01.intranet.mydomain.net## db02.intranet.mydomain.net## 10.25.1.56## 10.25.1.57# Here's another example of host ranges, this time there are no# leading 0s:## db-[99:101]-node.example.com