Re: [ansible-project] using set_fact with until

2019-09-11 Thread flowerysong
On Wednesday, September 11, 2019 at 3:57:30 PM UTC-4, Vladimir Botka wrote: > > On Wed, 11 Sep 2019 18:02:08 +0530 > Kamesh Sampath > wrote: > > > > >> set_fact: > > > >> che_keycloak: > > > >> "{{ lookup('k8s', > > > >>

[ansible-project] Ansible Help..

2019-09-11 Thread Greg Profitt
Trying to deploy a few .exe files to Windows systems. Both are installl but the task just hangs.. TASK [Install Erlang]

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
On Wed, 11 Sep 2019 18:02:08 +0530 Kamesh Sampath wrote: > > >> set_fact: > > >> che_keycloak: > > >> "{{ lookup('k8s', > > >> api_version='route.openshift.io/v1',kind='Route',resource_name='keycloak',namespace='che') > > >> > > >> }}" > > >> register: che_keycloak_route_result > > >>

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Karl Auer
In this case you could use a ternary filter: vars: f1: "'prd' OR region LIKE 'dr'" f2: "some_default" sqlFragment: "{{(fRegion == 'prd_or_dr' or fRegion == 'dr_or_prd')|ternary(f1, f2)}}" You could also use membership in a list of values as your condition: vars: f1: "'prd' OR

Re: [ansible-project] Subdirectories in host_vars

2019-09-11 Thread Dick Visser
Yes. On Thu, 12 Sep 2019 at 00:11, Peter Kokot wrote: > > Hello, > > does host_vars directory support subdirectories? So multiple variables can be > organized in multiple YAML files inside the host subdirectory. For example: > > ├─ host_vars/ > ├─── hostname_1.tld/ > ├─ secrets.yaml >

[ansible-project] Subdirectories in host_vars

2019-09-11 Thread Peter Kokot
Hello, does host_vars directory support subdirectories? So multiple variables can be organized in multiple YAML files inside the host subdirectory. For example: ├─ host_vars/ ├─── hostname_1.tld/ ├─ secrets.yaml ├─ variables.yaml ├─── hostname_2.tld/ ├─ secrets.yaml ├─

Re: [ansible-project] Using lineinfile to append items to the END of a line

2019-09-11 Thread Philippe Eveque
I would recommend the Template module to do it while technically possible with lineinfile, the regular expression to do it will be overly complex and hard to read/maintain Le mer. 11 sept. 2019 à 16:06, TheSmiths a écrit : > Hi, > > I would like to use lineinfile module to do the next: > > 1.

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
On Wed, 11 Sep 2019 14:50:24 -0700 (PDT) flowerysong wrote: > That seems overly complex. I would instead wait until the required data is > available before running set_fact: > > - vars: > che_keycloak_lookup: "{{ lookup('k8s', ... > [...] > - debug: > msg: Waiting for data

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Mohtashim S
@Karl your set_fact recoomendation has syntax issues Below is how it fails. - name: "Play 1-Find the details here" hosts: localhost any_errors_fatal: True vars: ansible_ssh_extra_args: -o StrictHostKeyChecking=no set_fact: fRegion: "'prd' OR region LIKE 'dr'" when:

Re: [ansible-project] Subdirectories in host_vars

2019-09-11 Thread Peter Kokot
Thank you so much for your answer. Yes, it works correctly as expected. Issue was that I was overriding the variables from the roles incorrectly (roles/something/vars/main.yaml) and should use the roles/something/defaults/main.yaml for that. The host_vars work as expected. On Thursday, 12

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Mohtashim S
@Karl your set_fact recoomendation has syntax issues Below is how it fails. - name: "Play 1-Find the details here" hosts: localhost any_errors_fatal: True vars: ansible_ssh_extra_args: -o StrictHostKeyChecking=no set_fact: fRegion: "'prd' OR region LIKE 'dr'" when:

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Kamesh Sampath
Thank you Vladmir and flowerysong, this solution works just as its needed. On Thursday, September 12, 2019 at 7:55:53 AM UTC+5:30, Vladimir Botka wrote: > > On Wed, 11 Sep 2019 14:50:24 -0700 (PDT) > flowerysong > wrote: > > > That seems overly complex. I would instead wait until the required

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Karl Auer
That error is in code you added. I'm sure you'll figure it out. The fragments I supply here are tested unless I say otherwise. Regards, K. On Thu, Sep 12, 2019 at 2:59 PM Mohtashim S wrote: > @Karl your set_fact recoomendation has syntax issues > > Below is how it fails. > > - name:

[ansible-project] using set_fact with until

2019-09-11 Thread Kamesh Sampath
I am trying to use `set_fact` with `until` and `retries`, will the fact be evaluated and set during each iteration ? Sometimes I see the value is not being set and I get the failure after the retries. While I see the corresponding lookup returns value using another cli. - name: "Get Che

Re: [ansible-project] Issue with first playbook

2019-09-11 Thread elogateumsato
I have the solution now you need to set the connection: network_cli ansible_network_os=edgeos On Saturday, September 7, 2019 at 10:24:22 AM UTC+1, elogateumsato wrote: > > I am running on build Version: v1.10.10 > > Here is a full debug of the connection :

[ansible-project] Re: How to use hostvars?

2019-09-11 Thread vu001
Hi, I'm trying to write all IPs from all hosts to fil this is my template: {% for host in groups['all'] %} {{ hostvars[host]['ansible_facts']['ansible_default_ipv4'] }} {% endfor %} and this is playbook --- - name: update /etc/hosts file dynamically hosts: all gather_facts: yes tasks:

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
On Wed, 11 Sep 2019 01:44:50 -0700 (PDT) Kamesh Sampath wrote: > > Yes. The the fact will be evaluated and set on each iteration. The problem > > is > > that "set_fact" declares the variable "che_keycloak". The condition > > > > until: che_keycloak.spec is defined > > > > can't find

Re: [ansible-project] Host Unreachable.

2019-09-11 Thread Dick Visser
Please start a new thread if you have a new question. This pollutes/confuses things. On Wed, 11 Sep 2019 at 11:21, Naeem Khan wrote: > > Error Test is as Follows:- > > ansible-playbook 2.8.4 > config file = /etc/ansible/ansible.cfg > configured module search path =

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Kamesh Sampath
On Wed, 11 Sep 2019 at 14:36, Vladimir Botka wrote: > On Wed, 11 Sep 2019 01:44:50 -0700 (PDT) > Kamesh Sampath wrote: > > > > Yes. The the fact will be evaluated and set on each iteration. The > problem > > > is > > > that "set_fact" declares the variable "che_keycloak". The condition > > > >

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Kamesh Sampath
On Wednesday, September 11, 2019 at 3:20:40 PM UTC+5:30, Vladimir Botka wrote: > > On Wed, 11 Sep 2019 15:04:44 +0530 > Kamesh Sampath > wrote: > > > > > > that "set_fact" declares the variable "che_keycloak". The > condition > > > > > > > > > > until: che_keycloak.spec is defined >

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Kamesh Sampath
On Wednesday, September 11, 2019 at 2:10:04 PM UTC+5:30, Vladimir Botka wrote: > > On Wed, 11 Sep 2019 00:22:50 -0700 (PDT) > Kamesh Sampath > wrote: > > > I am trying to use `set_fact` with `until` and `retries`, will the fact > be > > evaluated and set during each iteration ? Sometimes I

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
On Wed, 11 Sep 2019 00:22:50 -0700 (PDT) Kamesh Sampath wrote: > I am trying to use `set_fact` with `until` and `retries`, will the fact be > evaluated and set during each iteration ? Sometimes I see the value is not > being set and I get the failure after the retries. While I see the >

[ansible-project] Issue in download file from FTP

2019-09-11 Thread Naeem Khan
Hi Everyone, I am facing issue in executing roles using some shell script. the task is 1. create one directory on remote host /installer/NAM 2. copy the installable from ftp (ip:172.19.54.10 username:-admin password abc123 ). 3. copy the installable at /installer/NAM 4. untar the installable 5.

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
Fixed syntax. --- - set_fact: che_keycloak: "{{ lookup('k8s', api_version='route.openshift.io/v1', kind='Route', resource_name='keycloak',

[ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Mohtashim S
I pass a variable fRegion to my ansible playbook. I wish to set fRegion to this string -> 'prd' OR region LIKE 'dr' if the passed value is either "prd_and_dr" or "dr_and_prd". I call the playbook like this : ansible-playbook site.yml -e "fRegion=dr_and_prd" Here is my attempted playbook

[ansible-project] Re: How to use hostvars?

2019-09-11 Thread vu001
Hi, I have the similar issue. I have template file and I'm trying to write down IPs of all hosts to file on some node So my template is: {% for host in groups['all'] %} {{ hostvars[host]['ansible_facts']['ansible_default_ipv4'] }} {% endfor %} and playabook: --- - name: update /etc/hosts

Re: [ansible-project] Host Unreachable.

2019-09-11 Thread Naeem Khan
Hi Everyone, I am facing issue in executing roles using some shell script. the task is 1. create one directory on remote host /installer/NAM 2. copy the installable from ftp (ip:172.19.54.10 username:-admin password abc123 ). 3. copy the installable at /installer/NAM 4. untar the installable 5.

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
On Wed, 11 Sep 2019 10:39:49 +0200 Vladimir Botka wrote: > On Wed, 11 Sep 2019 00:22:50 -0700 (PDT) > Kamesh Sampath wrote: > > > I am trying to use `set_fact` with `until` and `retries`, will the fact be > > evaluated and set during each iteration ? Sometimes I see the value is not > >

Re: [ansible-project] Host Unreachable.

2019-09-11 Thread Naeem Khan
Thanks! for reply. On Mon, 9 Sep 2019 at 19:09, Stefan Hornburg (Racke) wrote: > On 9/9/19 3:32 PM, Naeem Khan wrote: > > Hi Everyone, > > I am getting the Connection issue with the given host using ansible, but > direct ssh is working fine with the host > > 172.19.54.163. > > can some one

Re: [ansible-project] Host Unreachable.

2019-09-11 Thread Naeem Khan
Error Test is as Follows:- ansible-playbook 2.8.4 config file = /etc/ansible/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
On Wed, 11 Sep 2019 15:04:44 +0530 Kamesh Sampath wrote: > > > > that "set_fact" declares the variable "che_keycloak". The condition > > > > > > > > until: che_keycloak.spec is defined > > > > > > > > can't find the parameter "spec" because there isn't any. > > > > > > > do you mean to

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Vladimir Botka
On Wed, 11 Sep 2019 02:57:51 -0700 (PDT) Kamesh Sampath wrote: > > > > > > > > > > > > until: che_keycloak.spec is defined > > > > > > > > > > > > can't find the parameter "spec" because there isn't any. > > > > > > the spec becomes available only after few seconds; so I need to keep

[ansible-project] AWX

2019-09-11 Thread Manish Kumar
Dear All, I am unable to login AWX webpage with admin and password . What could be other default credentials which can be tried ? Any initial method which needs to be performed like user-Admin and secret keyword like jenkins ? Thanks, Manish -- You received this message because you are

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Kai Stian Olstad
On 11.09.2019 09:22, Kamesh Sampath wrote: I am trying to use `set_fact` with `until` and `retries`, will the fact be evaluated and set during each iteration ? Sometimes I see the value is not being set and I get the failure after the retries. While I see the corresponding lookup returns value

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Kai Stian Olstad
On 11.09.2019 14:32, Kamesh Sampath wrote: On Wed, 11 Sep 2019 at 17:59, Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: On 11.09.2019 09:22, Kamesh Sampath wrote: > I am trying to use `set_fact` with `until` and `retries`, will the fact With set_fact and until it will not set the

Re: [ansible-project] using set_fact with until

2019-09-11 Thread Kamesh Sampath
On Wed, 11 Sep 2019 at 17:59, Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 11.09.2019 09:22, Kamesh Sampath wrote: > > I am trying to use `set_fact` with `until` and `retries`, will the fact > > be > > evaluated and set during each iteration ? Sometimes I see the value is > >

Re: [ansible-project] AWX

2019-09-11 Thread Kai Stian Olstad
On 11.09.2019 13:31, Manish Kumar wrote: Dear All, I am unable to login AWX webpage with admin and password . What could be other default credentials which can be tried ? Any initial method which needs to be performed like user-Admin and secret keyword like jenkins ? This in not the

[ansible-project] Is there a better way to restructure playbook without “include_tasks” and run task simultaneously?

2019-09-11 Thread Larry Bakun
I need a way to speed up my playbook, maybe better logical structuring. It’s running sequentially now. The task is simple – run playbook from AWX that will backup list of VMs. I’m supplying list of VMs in AWX extra variables: backupList: - vmName: VM1 backupAge: 2d - vmName: VM2

[ansible-project] Access clients through a proxy

2019-09-11 Thread David McPherson
I have a number of machines that can only be reached by logging in through a proxy, but I would like to use ansible to manage them. Is there a way to send playbooks through a proxy to remote machines? Thanks, Dave -- You received this message because you are subscribed to the Google Groups

[ansible-project] Using lineinfile to append items to the END of a line

2019-09-11 Thread TheSmiths
Hi, I would like to use lineinfile module to do the next: 1. go over list of items (with_items) 2. look for specific line that always starts with the word "ALL:" (hosts.allow) 3. append each item at the END of the line with comma before the item for example ALL ,1.1.1.1/255.255.255.255 ,

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Karl Auer
If I understand correctly you have a variable called fRegion that contains a value. You want to change that variable to contain the string "'prd' OR region LIKE 'dr'" if the variable initially contains either the value "prd_or_dr" or the value "dr_or_prd". - set_fact: fRegion: "'prd' OR

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Mohtashim S
@Karl you have correctly understood my requirement. However, can you propose a solution with vars instead of using set_fact ? On Wednesday, September 11, 2019 at 9:58:58 PM UTC+5:30, Karl Auer wrote: > > If I understand correctly you have a variable called fRegion that contains > a value. > >

[ansible-project] Ansible Contributor Summit 7 (Part of AnsibleFest 2019 Atlanta)

2019-09-11 Thread John Barker
Hi everybody. As usual, the day before AnsibleFest we are hosting Contributor Summit. this will take place in Atlanta, though we welcome people to join virtually for some/all of the day. Ansible Contributor Summit is made up of a one-day session with the

Re: [ansible-project] Access clients through a proxy

2019-09-11 Thread Kai Stian Olstad
On 11.09.2019 17:01, David McPherson wrote: > I have a number of machines that can only be reached by logging in through > a proxy, but I would like to use ansible to manage them. Is there a way to > send playbooks through a proxy to remote machines?

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Dick Visser
I am truly confused about the logic. You’re trying to set a variable based on itself, OR itself? Could you maybe explain what you are trying to achieve? Even within this information I would definitely restructure things... Dick On Wed, 11 Sep 2019 at 13:02, Mohtashim S wrote: > I pass a

Re: [ansible-project] Update string variable if the value matches in Ansible Play

2019-09-11 Thread Mohtashim S
@Dick hi, We can definitely use a different variable here fRegion: "'prd' OR region LIKE 'dr'" I wanted to have less variables hence kept it the same. The variable is used in a complex SQL query that is run by my playbook and as we know SQL queries need single quotes (') Thus, the fRegion

[ansible-project] Ansible Contributor Summit 7 (Part of AnsibleFest 2019 Atlanta)

2019-09-11 Thread John Barker
Hi everybody. As usual, the day before AnsibleFest we are hosting Contributor Summit. this will take place in Austin, though we welcome people to join virtually for some/all of the day. Ansible Contributor Summit is made up of a one-day session with the