Re: [ansible-project] question on LVM exists or not

2022-03-16 Thread John Petro
Well, Someone else might have a clearer answer, but the way you coded it, the task would be skipped if ln_mysql is not defined. Did you try adding some verbosity to the ansible-playbook command? When something like this happens to me, I go right for the - and that will usually point me in

[ansible-project] question on LVM exists or not

2022-03-16 Thread subbamma natla
why am I getting output when " when: ansible_facts['lvm']['lvs']['lv_mysql'] is not defined" --- - hosts: database gather_facts: yes tasks: - name: check lv_mysql exists debug: msg: "LV_MYSQL not there" when: ansible_facts['lvm']['lvs']['lv_mysql'] is not defined - name:

Re: [ansible-project] Passing json in shell module in ansible

2022-03-16 Thread Brian Coca
easiest way: shell: !unsafe aws autoscaling start-instance-refresh --auto-scaling-group-name Test_Iwo_nodes_Development_zone1 --preferences '{"InstanceWarmup": 400, "MinHealthyPercentage": 50}' but breaking it down into variables is still a good idea, you only need `!unsafe` on the 'dictionary

Re: [ansible-project] Automate shutdown command via Ansible playbook

2022-03-16 Thread Nico Kadel-Garcia
On Wed, Mar 16, 2022 at 4:00 PM Dick Visser wrote: > > On Wed, 16 Mar 2022 at 20:51, xinhua...@gmail.com > wrote: >> >> I'm using ansible 2.9. There is no shutdown module available. > > Don't waste time on working around problems in unsupported software. > Instead use the energy to upgrade to

Re: [ansible-project] Re: create a dict from a list (value of another dict)

2022-03-16 Thread Stefan Hornburg (Racke)
On 16/03/2022 17:46, Hiero-nymo wrote: I've try some subelements but cannot retrieve the right data. ie I don't get why you use the dict2items filter on a list of dicts. You can start producing output from the "linux_file_list" variable directly. Regards Racke On Wednesday, March

Re: [ansible-project] Automate shutdown command via Ansible playbook

2022-03-16 Thread Dick Visser
On Wed, 16 Mar 2022 at 20:51, xinhua...@gmail.com wrote: > I'm using ansible 2.9. There is no *shutdown* module available. Don't waste time on working around problems in unsupported software. Instead use the energy to upgrade to something supported. -- You received this message because you

[ansible-project] Automate shutdown command via Ansible playbook

2022-03-16 Thread xinhua...@gmail.com
I'm using ansible 2.9. There is no *shutdown* module available. I need to automate shutdown command via Ansible playbook. The target hosts are different distributions of CentOS servers - 7 or 6. When I ran the playbook to shutdown them, the execution will hang forever for one of CentOS 7

Re: [ansible-project] Python compatibility between controller and managed nodes

2022-03-16 Thread Gaétan QUENTIN
thank you for this response. in my comprehension, ansible controller push some python code onto the target and this code is executed on the target. does that mean that a 3.8 target recognize 2.7 code (we all know there is a compatibility rupture between 2.7 and 3.X) and can execute 2.7

Re: [ansible-project] Python compatibility between controller and managed nodes

2022-03-16 Thread 'Felix Fontein' via Ansible Project
Hi, >  A question about python compatibility between controller and > managed node. > > >  Do an ansible controller 2.9.XX with python 2.7.X can manage nodes > where python 3.8 is installed? yes. There is no relation between the Python versions on controller and target (except that both

[ansible-project] Re: create a dict from a list (value of another dict)

2022-03-16 Thread Hiero-nymo
I've try some subelements but cannot retrieve the right data. On Wednesday, March 16, 2022 at 10:41:58 AM UTC+1 h...@startx.fr wrote: > try the *subelement *filter > Le mardi 15 mars 2022 à 16:51:19 UTC+1, Hiero-nymo a écrit : > >> Hi Team, >> >> My playbook role receive a dict coming from a

[ansible-project] Python compatibility between controller and managed nodes

2022-03-16 Thread Gaétan QUENTIN
Hi,  A question about python compatibility between controller and managed node.  Do an ansible controller 2.9.XX with python 2.7.X can manage nodes where python 3.8 is installed?  The answer is not clear here:

[ansible-project] Re: create a dict from a list (value of another dict)

2022-03-16 Thread Hamza Bouabdallah
try the *subelement *filter Le mardi 15 mars 2022 à 16:51:19 UTC+1, Hiero-nymo a écrit : > Hi Team, > > My playbook role receive a dict coming from a lookup file, > *linux_file_list* is the variable name of this lookup. This dict has only > one key and some lists as value. Elements of these

[ansible-project] Re: Inventory variables not being read

2022-03-16 Thread Sagar Paul
Hey EE1, As you rightly pointed out --limit works and -i don't, as you reported you are getting desired output for `ansible-inventory --host csr1` which indicates the inventory is already being picked up correctly. To *limit the hosts you target on a particular run *we use *--limit *flag, -i