[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

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

2020-05-06 Thread Nicola Limongi
=0 failed=0skipped=0rescued=0ignored=0 Nicola On Tuesday, May 5, 2020 at 8:28:51 PM UTC+2, Vladimir Botka wrote: > > On Tue, 5 May 2020 09:48:44 -0700 (PDT) > Nicola Limongi > wrote: > > > THIS WORKS (from the playbook) > > --- > >

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] Running Ansible playbook with Jenkins plugin ... now need to add git

2020-05-06 Thread Nicola Limongi
Hi, first thing you should version all your playbooks and roles in a git repository. Then you tell Jenkins to pull such git repository and run the playbook you want to. Be sure that on the Jenkins host you have installed all the required software: ansible, git. You can create a Jenkinsfile at

[ansible-project] template error while templating string: no filter named 'failed'

2021-04-27 Thread Nicola Limongi
Hi all! I'm having an issue while running the task at line 14 of this role: https://github.com/nicolimo86/ansible-go/blob/master/tasks/main.yml The error is the following: TASK [ansible-go : Remove old installation of Go] ** fatal: [ubuntu1804]: FAILED! => {"msg":

Re: [ansible-project] template error while templating string: no filter named 'failed'

2021-04-27 Thread Nicola Limongi
Hi Sam, thanks a lot for pointing that out. thanks for your time, Nicola On Tue, Apr 27, 2021 at 3:48 PM Sam Doran wrote: > Nicola, > > Using tests as filters was deprecated in Ansible 2.5 and removed in 2.9. > > >