Re: [ansible-project] add_host scope from inside roles

2020-05-06 Thread Nicola Limongi
Hi Brian, thanks a lot, that was indeed one part of the problem. I also had to remove the meta: refresh_inventory at the end of the first play. WORKING VERSION --- - name: "provision EC2" hosts: localhost connection: local vars_files: - vars/vars_infrastracture.yml - vars/vars-ec2-ami-linux.yml

Re: [ansible-project] add_host scope from inside roles

2020-05-06 Thread Brian Coca
this is just a variable named 'groupname' groupname: launched Per the docs https://docs.ansible.com/ansible/latest/modules/add_host_module.html, if you actually want to add it to the 'launched' group: groups: launched -- -- Brian Coca -- You received this message because you

Re: [ansible-project] add_host scope from inside roles

2020-05-06 Thread Nicola Limongi
Hi Vladimir, thanks for pointing out that mistake. I fixed the role, but I still have the same behaviour. You can find below the full example with the output. PLAYBOOK --- - name: "provision EC2" hosts: localhost connection: local vars_files: - vars/vars_infrastracture.yml -

Re: [ansible-project] add_host scope from inside roles

2020-05-05 Thread Vladimir Botka
On Tue, 5 May 2020 09:48:44 -0700 (PDT) Nicola Limongi wrote: > THIS WORKS (from the playbook) > --- > - name: "provision Ec2" > hosts: localhost > connection: local > gather_facts: false > tasks: > - ec2_instance: > name: "{{ ec2_name }}" > security_groups: > [ecc

[ansible-project] add_host scope from inside roles

2020-05-05 Thread Nicola Limongi
Hi all, I'm a bit confused about the behavior of add_host when used from inside a role or directly in the playbook. Am I doing something wrong or am I just hitting some role's scope boundary? THIS WORKS (from the playbook) --- - name: "provision Ec2" hosts: localhost connection: local