Re: [ansible-project] Re: Lauching template job via api on custom host (ie. not on an inventory)

2019-10-01 Thread aquilinux
Hi Fabio, thanks for you answer, I'll give it a try. However, I managed to get the desired behaviour just setting hosts value as a var, like hosts: {{ host_to_check }} and passing the desired host in extra_vars like { "extra_vars": { "host_to_check": "my host.local" } } This wasn't working

[ansible-project] Re: Lauching template job via api on custom host (ie. not on an inventory)

2019-10-01 Thread Fabio Maia
Hi, You may be able to pass host.local as parameters within content to enable an API using "limit" { "name": "", "description": "", "job_type": "run", "inventory": null, "project": null, "playbook": "", "scm_branch": "", "forks": 0, *"limit": "",*

[ansible-project] Module filesystem broken on RHEL8?

2019-10-01 Thread William Muriithi
Hello, I have tried to run this task on RHEL 8 system and it doesn't go well. The same task runs fine on RHEL 7. It does looks like this is a bug to me, anyone made a similar observation or can replicate it with ease? - name: Set up xfs filesystem on partation for VDO filesystem:

Re: [ansible-project] Re: Problem with a sh installation

2019-10-01 Thread Kai Stian Olstad
On 30.09.2019 23:50, Javier Esparza wrote: > Sorry my friend here comes de code. > > - name: Ejecutamos el script de instalacion del scanner >expect: > command: /tmp/uld/install-scanner.sh > response: >Questions: > - "Press

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Kai Stian Olstad
On 01.10.2019 11:14, Srinivas Naram wrote: > hostname1 is defined in my inventory file. Here is the yml file snippet > > - hosts: hostname2 >gather_facts: true >tasks: > - >file: > path: "/home/ansible_user/controller3/file_name" > state: touch >when:

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
Sure. Attached output of hostvars. On Tue, Oct 1, 2019 at 7:41 PM Vladimir Botka wrote: > On Tue, 1 Oct 2019 18:39:54 +0530 > Srinivas Naram wrote: > > > - debug: > > var: hostvars > > > > shows all the hosts in my inventory file, so I believe my playbook has > > access to all hosts. > >

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Vladimir Botka
On Tue, 1 Oct 2019 18:39:54 +0530 Srinivas Naram wrote: > - debug: > var: hostvars > > shows all the hosts in my inventory file, so I believe my playbook has > access to all hosts. > [...] > I still get following error > [...] > failed. The error was: error while evaluating conditional >

[ansible-project] Lauching template job via api on custom host (ie. not on an inventory)

2019-10-01 Thread MrAquilinux
Hi all, i don't know if this is really possibile or i can use tower/awx for this. Anyway, i'd like to setup a trigger on my monitoring system that, if the trigger is fired on a particular host, launches a template/job/playbook on that host. For example, a trigger for "low disk space" is fired

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
Hello - debug: var: hostvars shows all the hosts in my inventory file, so I believe my playbook has access to all hosts. To hash out issue with inventory file, I modified my code as below. -- - hosts: *hostname2* tasks: - file: path:

[ansible-project] I have problems with de expect module

2019-10-01 Thread Javier Esparza
Hello guys, i have a installation of a scanner, in this instalation y have to anser 4 questions, if i'm agree with the terms etc. i find the expect module but not a lot of information of it. here comes my code.. - name: installation scanner expect: command:

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Vladimir Botka
> > > > > *Trial1* : > > > > > when: {{hostvars['hostname1]['ansible_facts']['distribution']}} == > > > > > "CentOS" > > > > > > > > Try this one > > > > when: "hostvars['hostname1']['ansible_facts']['distribution'] == > > > > 'CentOS'" > > > > On Tue, 1 Oct 2019 12:41:22 +0530 > > Srinivas

[ansible-project] Become plugin

2019-10-01 Thread Torrpenn356
Hello, I hope, I am posting my question on the right group, if not, please tell me I need to use a dedicated become method and want to know, if it is possible, or, if only the "official" ones are authorized. If it is possible, is there specific guidelines to follow to develop my own become

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
Hi Vladimir, hostname1 is defined in my inventory file. Here is the yml file snippet - hosts: hostname2 gather_facts: true tasks: - file: path: "/home/ansible_user/controller3/file_name" state: touch when: "hostvars['hostname1']['ansible_facts']['distribution']

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Vladimir Botka
> > > *Trial1* : > > > when: {{hostvars['hostname1]['ansible_facts']['distribution']}} == > > > "CentOS" > > > > Try this one > > when: "hostvars['hostname1']['ansible_facts']['distribution'] == > > 'CentOS'" On Tue, 1 Oct 2019 12:41:22 +0530 Srinivas Naram wrote: > I have tried with your

Re: [ansible-project] AIX O/S version detection problems in Ansible 2.8

2019-10-01 Thread Daniel Delin
On Monday, September 30, 2019 at 7:05:57 PM UTC+2, Kai Stian Olstad wrote: > > This look like a bug, but when I check the code distribution_major_version > for AIX is not changed between 2.7.10 and 2.8.4, only distribution_version > and distribution_release has some changes. > > The fact is

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
Hi Vladimir, I have tried with your suggestion and got following error. --- fatal: [172.19.251.173]: FAILED! => {"msg": "The conditional check 'hostvars['hostname1']['ansible_facts']['distribution'] == 'CentOS'' failed. The error was: error while evaluating conditional