ansible-inventory

accessing inventory host variable in ansible playbook

社会主义新天地 提交于 2019-11-26 16:31:17
问题 I am using ansible 2.1. I have the following inventory host file and a role being called by a play that needs access to the host file variable. Any thoughts on how to access it (currently getting an error): host file [test1] test-1 ansible_ssh_host=abc.def.ghi.jkl ansible_ssh_port=1212 [test2] test2-1 ansible_ssh_host=abc.def.ghi.mno ansible_ssh_port=1212 [test3] test3-1 ansible_ssh_host=abc.def.ghi.pqr ansible_ssh_port=1212 test3-2 ansible_ssh_host=abc.def.ghi.stu ansible_ssh_port=1212 [all