Re: [ansible-project] Creating subgroup of ec2 dynamic inventory

2014-12-23 Thread Igor Cicimov
Just in case someone else had similar problem, the solution was to add "serial: 1" to the playbook otherwise the execution is parallel thus only the last host preprocessed ends up in the group. Simple example /etc/ansible/hosts-group inventory: [group-tomcat] 10.22.0.43server_name=app11 ec2_

Re: [ansible-project] Creating subgroup of ec2 dynamic inventory

2014-05-11 Thread Igor Cicimov
Thanks Michael your suggestions noted. I did some more testing and looks like only one single instance, assuming the last instance, from the inventory is being added to the group, and this is without any conditions. Very simple playbook example: --- - hosts: ec2 gather_facts: False connect

Re: [ansible-project] Creating subgroup of ec2 dynamic inventory

2014-05-09 Thread Michael DeHaan
A few things to cleanup first: " - add_host: hostname={{ hostvars[inventory_hostname]['ec2_publicIp'] }} groupname=ec2hosts server_name={{ hostvars[inventory_hostname]['ec2_public_dns_name'] }}" When you get ginormous variables like this, slow down, and define useful shortcuts in your "vars"

[ansible-project] Creating subgroup of ec2 dynamic inventory

2014-05-08 Thread Igor Cicimov
Hi all, I have the following playbook trying to create a subgroup out of my ec2 dynamic inventory with instances matching given tags: --- - hosts: ec2 gather_facts: False connection: local tasks: - add_host: hostname={{ hostvars[inventory_hostname]['ec2_publicIp'] }} groupname=ec2h