Hosts must have a unique name in inventory. Both of your hosts have the same name.
You can use ansible_ssh_host to specify a single host/ip and give the hosts unique aliases instead. Similar too [webservers] web1 ansible_ssh_host=web.cloudapp.net ansible_ssh_port=22 web2 ansible_ssh_host=web.cloudapp.net ansible_ssh_port=26 On Tuesday, May 5, 2015, satheesh kumar <[email protected]> wrote: > I am using a single cloud service in azure, which acts as loadbalancer for > two backend hosts. The SSH public port is 22 for VM1 and 26 for VM2. > > My Ansible inventory file is like below: > > [webservers] > web.cloudapp.net ansible_ssh_port=22 > web.cloudapp.net ansible_ssh_port=26 > > > When I ping the VMs > > # ansible webservers -m ping > > I am getting response only once (I expected twice for each VM) > > web.cloudapp.net | success >> { > "changed": false, > "ping": "pong" > } > > I tried commenting one vm1 in inventory and I am getting response from VM2 > (I tried commenting VM2 also and got ping response from vm1) > > Then I ran ansible-playbook on the same inventory (with 2 VMs) files and i > am able to see changes only in second VM with port 26. > > I tried this in different VM set and each time I am able to see changes > only in port 26 VM, not the other one in port 22. > > Can you help me in getting the ansible executing on both VMs when defined > at same time > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <javascript:_e(%7B%7D,'cvml','ansible-project%[email protected]');> > . > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/3ab17df0-4f35-4835-a3a3-0640d943ae8e%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/3ab17df0-4f35-4835-a3a3-0640d943ae8e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz @sivel sivel.net -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v_XhjOzvYz-FUf5%3DpCnq7vgNR1bByDG0rQFgD2v6KiSHQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
