Re: [ansible-project] Re: Target machines are unreachable

2020-05-05 Thread Dick Visser
I see two totally unrelated messages containing just an error?
To answer your question more information is needed. Could you please
describe clearly all of the below:


- What goal you are trying to achieve.

- How you are doing this.

- What problems you encounter.

- Which commands did you run, and what actual output did you get (copied as
plain text - not as screenshots, images, or other binary attachments).

- What do the relevant inventory/tasks/playbooks/code/variables look like.

- The output of ‘ansible --version’



And keep each problem to a single message

On Wed, 6 May 2020 at 03:22, Work-Hard  wrote:

>  FAILED! => {"changed": false, "cmd": ["dpkg", "--configure", "a"],
> "delta": "0:00:00.064010", "end": "2020-05-06 01:18:35.173136", "msg":
> "non-zero return code", "rc": 1, "start": "2020-05-06 01:18:35.109126",
> "stderr": "dpkg: error processing package a (--configure):\n no package
> named 'a' is installed, cannot configure\nErrors were encountered while
> processing:\n a", "stderr_lines": ["dpkg: error processing package a
> (--configure):", " no package named 'a' is installed, cannot configure",
> "Errors were encountered while processing:", " a"], "stdout": "",
> "stdout_lines": []}
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e3c4b33b-88f0-4c24-bc51-71b81583ff1b%40googlegroups.com
> 
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPSW6CKeXEd2Ui954d2HHZJ7RpML5nuHW6LMeDFWgxrcA%40mail.gmail.com.


[ansible-project] Ansible stops if unreachable, can it be ignored to continue the playbook?

2020-05-05 Thread Jimmy Malhan
Ansible stops if unreachable, can it be ignored to continue the playbook?

Thanks--

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/97f0ead3-af1f-46be-b5e3-45abffa856a0%40googlegroups.com.


Re: [ansible-project] Running Ansible playbook with Jenkins plugin ... now need to add git

2020-05-05 Thread Kiran Kumar
Thanks Vivek

On Sat, May 2, 2020 at 11:56 PM Vivek Kothawale 
wrote:

> Hi
>
> To achieve the above mentioned objective you can wirte Jenkins file and
> package all the files using fpm and deploy that package in jenkins server
> and then you can run playbooks using ansible jenkins by providing path to
> playbook.
>
> Thanks and Regards,
> Vivek
>
> On Sun, May 3, 2020, 12:18 PM Dick Visser  wrote:
>
>> This looks like a question about how to use git, in combination with
>> Jenkins, neither of which this list is supporting. You might get more
>> response from a support forum on Jenkins.
>>
>> On Sun, 3 May 2020 at 04:59, Kiran Kumar  wrote:
>>
>>> Hi,
>>>
>>> I have a ansible server, which i use mainly to manage ntp client/dns
>>> client/time zone/create users/install software etc on various linux
>>> servers..  so no development to say, just as "infrastructure as code"
>>>
>>> On same server i installed Jenkins & on Jenkins i installed ansible
>>> plugin. Now i have a UI ( Front end ) for my playbooks. So Jenkins runs the
>>> playbooks.
>>>
>>> So far so good.
>>>
>>> Now i am scratching  my head & doing google ( and various online
>>> training ) how do i ensure all those playbook & roles etc to  add to GIT &
>>> then manage with GIT.
>>>
>>> This is what i did so far
>>>
>>>
>>>- Install git plugin of Jenkins on same server
>>>- Install git server on same server, now this server acts as
>>>Jenkins+Ansible + Git
>>>- Test my git server  by creating a project on  it & testing with a
>>>work-station
>>>
>>>
>>>
>>> All stuff on my ansible is under  /etc/ansible  ie playbook in
>>> /etc/ansible/playbooks , roles in /etc/ansible/roles ,  inventory at
>>> /etc/ansible/hosts
>>>
>>> Please suggest  ( any good blog/web page/book ) or otherwise any
>>> suggestions will help
>>>
>>> Thanks
>>> Kiran
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to ansible-project+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/826bc85c-41b5-4d86-86f3-88dfb82bf93f%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> Sent from a mobile device - please excuse the brevity, spelling and
>> punctuation.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwOpwfghzGkpLuMgHBDC3ZU%2BR86vXELA2FKAyNRa6Zoxfg%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/_pGJftUckVk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAA420E9FDhOJLro1nDR2%3Djtv3VnZbKTgPv-y7Y6_px-U8sgRCg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGhW9Jt%2BoB138ZGiTeQ24nup8Mu%3DoJK%3DWSi9KCjCWPE_bV34RQ%40mail.gmail.com.


[ansible-project] Re: Target machines are unreachable

2020-05-05 Thread Work-Hard
 FAILED! => {"changed": false, "cmd": ["dpkg", "--configure", "a"], 
"delta": "0:00:00.064010", "end": "2020-05-06 01:18:35.173136", "msg": 
"non-zero return code", "rc": 1, "start": "2020-05-06 01:18:35.109126", 
"stderr": "dpkg: error processing package a (--configure):\n no package 
named 'a' is installed, cannot configure\nErrors were encountered while 
processing:\n a", "stderr_lines": ["dpkg: error processing package a 
(--configure):", " no package named 'a' is installed, cannot configure", 
"Errors were encountered while processing:", " a"], "stdout": "", 
"stdout_lines": []}

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e3c4b33b-88f0-4c24-bc51-71b81583ff1b%40googlegroups.com.


[ansible-project] Target machines are unreachable

2020-05-05 Thread Work-Hard
my target machines are up. I don't understand why I am running this error


Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/windows/setup.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: None on PORT 5986 TO 
fatal: []: UNREACHABLE! => {
"changed": false,
"msg": "ssl: auth method ssl requires a username",
"unreachable": true
}

Can someone please explain? Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/afe6aa15-5023-4b89-8a99-eabbf9d1cb57%40googlegroups.com.


Re: [ansible-project] Ansible lininfile behavior

2020-05-05 Thread Kai Stian Olstad
On Tue, May 05, 2020 at 09:19:50AM +0200, Vladimir Botka wrote:
> On Tue, 5 May 2020 00:47:10 +0200
> Vladimir Botka  wrote:
> 
> > On Tue, 5 May 2020 00:02:40 +0200
> > Kai Stian Olstad  wrote:
> > 
> > > On Mon, May 04, 2020 at 11:19:53PM +0200, Vladimir Botka wrote:  
> > > > There is no such problem with Ansible running on controller with Python 
> > > > 3
> > > 
> > > That's just not true, your test method is flawed, you need to test it 
> > > more than one time.
> > > 
> > > $ for i in {1..100}; do >/tmp/txt; ansible-playbook test.yml &>/dev/null; 
> > > md5sum /tmp/txt; done | sort | uniq -c | sort -n
> > >   4 763950971c8c6d8df8a87a1e752799a9  /tmp/txt
> > >  11 1597a5a9948014489de663c8fb4438db  /tmp/txt
> > >  36 ac34af7b876f793d09a2225e23f43088  /tmp/txt
> > >  49 317f53fd9236220d0ab65e4aac4b3c5a  /tmp/txt
> > 
> > Well, it is true. There are no problems reported with your method either. I
> > get correct results only.
> > 
> > shell> for i in {1..100}; do >test-file; ansible-playbook pb.yml 
> > 2>/dev/null; md5sum test-file; done | sort | uniq -c | sort -n  
> >  18 82de37d1deac8c90573c35e5637839d7  test-file
> >  82 6f4e9c06436257db5ba34d527bd3b211  test-file
> 
> To be sure, I let it run overnight
> 
> shell> for i in {1..1}; do >test-file; ansible-playbook -i hosts77 
> test77.yml 2>/dev/null; md5sum test-file; done | sort | uniq -c | sort -n
>2689 82de37d1deac8c90573c35e5637839d7  test-file
>7311 6f4e9c06436257db5ba34d527bd3b211  test-file

I have explained in my previous mail why this is by change/luck, and it will
fail if you controller had some more load that just 2 hosts.

-- 
Kai Stian Olstad

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20200505201001.jwmttyo37exiytov%40olstad.com.


Re: [ansible-project] Ansible lininfile behavior

2020-05-05 Thread Kai Stian Olstad
On Mon, May 04, 2020 at 11:55:14PM +0200, Vladimir Botka wrote:
> On Mon, 4 May 2020 23:06:50 +0200
> Kai Stian Olstad  wrote:
> 
> > > > Add "throttle: 1" to you lineinfile task and it will work.  
> > > 
> > > I don't need "throttle" with 2.9.6. The playbook 
> > 
> > That is just pure luck, try running it 100 times and count how many times it
> > fails.
> 
> Well, I tried and it's working properly with Python3. There is no problem with
> Ansible 2.9.6 and Python 3.8 on the controller ( the redirection in the script
> '2>/dev/null' is there because of annoying 3.8 RuntimeWarning).

That is not true and has nothing to do with Python version, and everything with
a little luck and a fast computer.

The test case is flawed for your Ansible controller, if it had more load and/or
more hosts you would get a completely different result.

The reason why this i not reliable is that Ansible is default running forks of
5, that mean that if you had 5 or more hosts it will run/fork out 5 commands.
This 5 commands will try to edit the same file at the same time.

Reason it works for you is that the first fork is finished before the second
has time to start.

This is how Ansible work, and now Python version is going to alter that.

And I'm going to prove it.
Since my machine doesn't have Python 3.8 I created a VM, with 2 cores.

$ ansible-playbook --version  | awk 'NR==1; END{print}'
ansible-playbook 2.9.7
  python version = 3.8.2 (default, Mar 24 2020, 03:08:36) [GCC 9.3.0]

So when I run my playbook with two host I get this

$ for i in {1..100}; do >/tmp/txt; ansible-playbook test.yml &>/dev/null; 
md5sum /tmp/txt; done | sort | uniq -c | sort -n
  1 1597a5a9948014489de663c8fb4438db  /tmp/txt
 39 317f53fd9236220d0ab65e4aac4b3c5a  /tmp/txt
 60 ac34af7b876f793d09a2225e23f43088  /tmp/txt

and the next time
$ for i in {1..100}; do >/tmp/txt; ansible-playbook test.yml &>/dev/null; 
md5sum /tmp/txt; done | sort | uniq -c | sort -n
  1 1597a5a9948014489de663c8fb4438db  /tmp/txt
 43 317f53fd9236220d0ab65e4aac4b3c5a  /tmp/txt
 56 ac34af7b876f793d09a2225e23f43088  /tmp/txt

As you can see it fails i 1 % of the cases.

Lets up the stake and go for 6 hosts, the playbook is the same, but since 6 
hosts
make potensial a lot of combination, I sort the file before I run md5sum.
So if everything is working OK I should only get one line with one hash like 
this
   100 aae4eb078da77ff549495a60be1a52c2

$ for i in {1..100}; do >/tmp/txt; ansible-playbook test.yml &>/dev/null; sort 
/tmp/txt | md5sum; done | sort | uniq -c | sort -n
  1 2465fc0f03254f2bf915a04c762c9d49  -
  2 254316531e34aa3ce563c22cf636ea01  -
  2 31f07322fb0283ee5475e5acc74de059  -
  2 ab8ecb5209d15e9852be208b79f309eb  -
  3 7abbd5c371c5e4ccb8bc965105148605  -
 90 aae4eb078da77ff549495a60be1a52c2  -

Not even close, it fails in 10% of the runs.

So lets make the machine even more busy.
To do that I shutdown the VM and reduced the cores count from 2 to 1.
Now we have 5 forks at the same time "fighting" for this 1 core and trying to
write to the same file at the same time.

This is the result.

  1 254316531e34aa3ce563c22cf636ea01  -
  1 6c5ffba74557139441576f9f6536c536  -
  1 8da4fee8643e840ae60169eac2d60afd  -
  1 9a7861beaa38064dd7179cf66b90173f  -
  1 aae4eb078da77ff549495a60be1a52c2  -
  1 d5fad8b2b8f31c4d201309e2261ee362  -
  2 2465fc0f03254f2bf915a04c762c9d49  -
  2 2ea77912754b2a786046ece007bfd0a7  -
  2 6503321b7879267a6a5eb06411e09b5e  -
  2 9ce72c8f1a3f059db908868df22c2618  -
  2 ab8ecb5209d15e9852be208b79f309eb  -
  2 adc72709b7b7cdc8aaad85c01b66e38d  -
  2 c4b05365f19a397fc9b2dda817219d49  -
  2 cf2b918385c6d1f75d7a0630d8881422  -
  2 d678deb816d9433ff1c61d60ec1073f1  -
  3 83758fc71d9927b3141c325692534add  -
  3 989fe3db59b18149e58657daab4721dc  -
  3 a421781f0d1512c9c66e9f7714bed570  -
  4 7bc2be35864ae017608466e62dd680aa  -
  5 83ba567764a618ec0a0b405d49de8fa9  -
  5 c98ae97d4888d870d9a05fe7f9b339a3  -
  5 d336136909e4067c35858990dd4f9211  -
  6 31f07322fb0283ee5475e5acc74de059  -
  6 76aabdf63a1f041f6572fb51fb496283  -
  6 cce45b22f8bc7806e3dc1128980f33f6  -
  6 cce83e09262e3efced931d81c85ac809  -
  6 decd8e81f11339ba387cb7cf61a28f34  -
  7 aed3d7850c9c5478d84bf78fdc922328  -
 11 d8ee7367ba9763647a58ab23a6f01c5f  -

Yeah, it fails miserably, in 99% of the cases.
The correct md5sum is this one

$ cat sorted.txt
a1
a2
a3
a4
a5
a6

$ md5sum sorted.txt
aae4eb078da77ff549495a60be1a52c2  sorted.txt


So no combination of Ptyhon and Ansible released will alter this,
it's just how it work.
That is why we have serial, fork and throttle to tune the behavior to avoid race
conditions.

-- 
Kai Stian Olstad

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: [ansible-project] Conditional Delegation to a host for synchronize module

2020-05-05 Thread Raj V
Hi Kai,
I have resolved my issue with group_by. Grouping by primary and non-primary 
and run commands on non-primary hosts. 
Thank you for your suggestions.




On Sunday, April 26, 2020 at 6:02:11 PM UTC-4, Kai Stian Olstad wrote:
>
> On Mon, Apr 20, 2020 at 11:14:23AM -0700, Raj V wrote: 
> > I am a newbie to Ansible and trying to figure out how to synchronize 
> > between 3 hosts based on condition. Below are details: 
> > There are 3 nodes and based on which node is primary (I was able to get 
> a 
> > custom fact set for it) need to delegate to that host (which runs 
> > synchronize from that host to other two hosts). 
> > Custom fact basically is  value 1 or 0 (1 means Primary/Master and 0 
> means 
> > not). 
> > I am unable to get the hostname (primary hostname) value to include into 
> > the synchronize steps. Below is the playbook I have. How do I make 
> > synchronize read the "primary" hostname value to run the next steps. 
> > 
> > --- 
> > 
> > - name: Playbook for rsync 
> >   become: yes 
> >   hosts: clients 
> >   gather_facts: True 
> > 
> >   tasks: 
> >   - name: Task to rsync from Primary server 
> > synchronize: 
> >   src: "{{ item.source }}" 
> >   dest: "{{ item.dest }}" 
> > with_items: 
> >   - { source: '/rsynctest/', dest: '/rsynctest/' } 
> >   - { source: '/rsynctest1/', dest: '/rsynctest1/' } 
> > delegate_to: "{{ ansible_hostname }}" 
> > when: 
> >   - ansible_local.determine.isprimary  == "1" 
>
> The best thing you can do is create a fact or run a command that can find 
> the 
> name of the host and use that in the when. 
>
> As you have done it here you need to loop over all host, check if they 
> have 
> the variable, check if it 1 and if so get the name. 
>
> -- 
> Kai Stian Olstad 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ef167ac9-11a2-42c0-b79e-c5d9b86f8738%40googlegroups.com.


Re: [ansible-project] Need help on formating stdout_lines output

2020-05-05 Thread Suresh Karpurapu
would anyone please help me on this request?

Regards,
Suresh

On Tue, May 5, 2020 at 2:45 AM Suresh Karpurapu 
wrote:

> Here is my playbook, i would like to display all lines in stdout_lines in
> below format without miss. I am able to display only first 3 lines but
> host03 has more than 3 lines even it may be more lines for other hosts.
> Would anyone please help me?
>
> Required output fle:
> ==
> host1,nfsflr01:/app01,/app,na,/etc/fstab
> host2,nfsflr02:/app02,/app02,na,/etc/fstab
> host3,nfsflr03:/app03,/app03,na,/etc/fstab
> host3,nfsflr03:/app03,/app03,na,/etc/rc.willows
> host4,nfsflr04:/app04,na,na,na
>
>
> ---
>   - name: nullify the ansible log file
> local_action: copy content="" dest="{{ playbook_dir
> }}/logs/volmigration.log"
> ignore_errors: true
> run_once: True
>   - name: nullify the file content
> local_action: copy content="" dest="{{ playbook_dir
> }}/logs/volcheck.txt"
> ignore_errors: true
> run_once: True
>   - name: Making the txt header information to volcheck.txt file
> local_action:
>   module: lineinfile
>   path: "{{ playbook_dir }}/logs/volcheck.txt"
>   line: "host,python,old_path,mnt_path,new_path,map_path,csv_path"
>   state: present
>   create: yes
> run_once: True
>   - name: Fetch the volume mounted status
> shell: |-
>   {% if ansible_os_family == "Solaris" %}
>   grep -ws "{{ item.0 }}" /etc/vfstab|awk '{print $1}'
>   grep -ws "{{ item.0 }}" /etc/vfstab|awk '{print $3}'
>   grep -wls "{{ item.0 }}" /etc/vfstab
>   grep -wls "{{ item.0 }}" /etc/auto*|head -1|xargs grep -w "{{ item.0
> }}"|awk '{print $2}'
>   grep -wls "{{ item.0 }}" /etc/auto*|head -1|xargs grep -w "{{ item.0
> }}"|awk '{print $1}'
>   grep -wls "{{ item.0 }}" /etc/auto*|head -1
>   {%- else %}
>   grep -rws "{{ item.0 }}" /etc/fstab|awk '{print $1}'
>   grep -rws "{{ item.0 }}" /etc/fstab|awk '{print $2}'
>   grep -wls "{{ item.0 }}" /etc/fstab
>   grep -rls "{{ item.0 }}" /etc/auto*|head -1|xargs grep -w "{{ item.0
> }}"|awk '{print $3}'
>   grep -rls "{{ item.0 }}" /etc/auto*|head -1|xargs grep -w "{{ item.0
> }}"|awk '{print $1}'
>   grep -rwls "{{ item.0 }}" /etc/auto*|head -1
>   grep -rwls "{{ item.0 }}" /etc/rc*|head -1|xargs grep -w "{{ item.0
> }}"|awk '{print $6}'
>   grep -rwls "{{ item.0 }}" /etc/rc*|head -1|xargs grep -w "{{ item.0
> }}"|awk '{print $7}'
>   grep -rwls "{{ item.0 }}" /etc/rc*|head -1
>   {%- endif %}
> with_together:
>   - "{{ var1 }}"
> register: volchk
> args:
>   warn: false
> ignore_errors: true
>   - name: Making the final volcheck.txt file
> local_action:
>   module: lineinfile
>   path: "{{ playbook_dir }}/logs/volcheck.txt"
>   line: |-
> {% if item.stdout|length>0 %}
> {{ inventory_hostname }},{{ ansible_python_interpreter }},{{
> item.stdout_lines[0] }},{{ item.stdout_lines[1] }},NA,{{
> item.stdout_lines[2] }},{{ item.item.0 }},
> {%- else %}
> {{ inventory_hostname }},{{ ansible_python_interpreter
> }},NA,NA,NA,NA,{{ item.item.0 }},
> {%- endif %}
>   insertafter: EOF
>   state: present
>   create: yes
> with_items: "{{ volchk.results }}"
>   - name: mark the entry of /etc/fstab and /etc/vfstab as fstab
> replace:
>   path: "{{ playbook_dir }}/logs/volcheck.txt"
>   regexp: "{{ item.stdout_lines[2] }}"
>   replace: "fstab"
> when: item.stdout|length>0 and (item.stdout_lines[2] |
> regex_search("/etc/fstab") or item.stdout_lines[2] |
> regex_search("/etc/vfstab"))
> with_items: "{{ volchk.results }}"
> delegate_to: localhost
>   - debug:
>   msg: "Final volume check file is located at {{ playbook_dir
> }}/logs/volcheck.txt"
> delegate_to: localhost
> run_once: true
>   - name: Send the final report email
> local_action:
>   module: mail
>   host: host10.google.com
>   port: 25
>   to: sur...@gmail.com
>   subject: Ansible volume pre-check report
>   attach: "{{ playbook_dir }}/logs/volcheck.txt"
> run_once: true
> ...
>
> Debug:
> Debug "volchk.result" output:
> ===
> host1:
>  "stdout": "nfsflr01:/app01\n/app\n/etc/fstab",
>  "stdout_lines": [
> "nfsflr01:/app01",
> "/app",
> "/etc/fstab"
>
> host2:
> "stdout": "nfsflr02:/app02\n/app02\n/etc/fstab",
> "stdout_lines": [
> "nfsflr02:/app02",
> "/app02",
> "/etc/fstab"
> host3:
>  "stdout":
> "nfsflr03:/app03\n/app03\n/etc/fstab\nnfsflr03:/app03\n/app03\n/etc/rc.willows",
>  "stdout_lines": [
>  "nfsflr03:/app03",
>  "/app03",
>  "/etc/fstab",
>  "nfsflr03:/app03",
>  "/app03",
>  "/etc/rc.willows"
>
> On Mon, May 4, 2020 at 2:57 PM Suresh Karpurapu <
> karpurapu.sur...@gmail.com> wrote:
>
>> Hi Sai Stian,
>>
>> This syntax would be helpful but i 

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 ecc]
> register: ec2_result
> 
> - name: Add new instance to launched group
>   hosts: localhost
>   tasks:
>   - add_host:
>   hostname: "{{ item.network_interfaces[0].private_ip_address }}"
>   groupname: launched
> with_items: "{{ ec2_result.instances }}"
> 
> - name: "config service inside EC2"
>   hosts: launched
>   tasks:
> [perform config of inside the EC2 ...]
> 
> THIS DOES NOT WORK (from inside a role)

The code is one playbook with three plays. It's not possible to put a
playbook "inside a role".

In particular, it's not possible to apply "hosts" in a "Role"
https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#role

HTH,

-vlado

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20200505202833.116a4701%40gmail.com.


pgp20KYuFKLDt.pgp
Description: OpenPGP digital signature


[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
gather_facts: false
tasks:
- ec2_instance:
name: "{{ ec2_name }}"
security_groups:
[ecc ecc]
register: ec2_result

- name: Add new instance to launched group
hosts: localhost
tasks:
- add_host:
hostname: "{{ item.network_interfaces[0].private_ip_address }}"
groupname: launched
with_items: "{{ ec2_result.instances }}"

- name: "config service inside EC2"
hosts: launched
tasks:
[perform config of inside the EC2 ...]

THIS DOES NOT WORK (from inside a role)
Here I'm just encapsulating the EC2 provisioning logic in a role called 
'ec2'.
The second play ("config service inside EC2") is skipped because the host 
is not present in the in memory inventory.

---

- name: "create ec2 common linux"
hosts: localhost
connection: local
gather_facts: false
roles:
- ec2
tasks:
- meta: refresh_inventory

- name: "config service inside EC2"
hosts: launched
tasks:
[perform config of inside the EC2 ...]


./roles/ec2/tasks/main.yml
---

- name: "provision Ec2"
hosts: localhost
connection: local
gather_facts: false
tasks:
- ec2_instance:
name: "{{ ec2_name }}"
security_groups:
[ecc ecc]
register: ec2_result

- name: Add new instance to launched group
hosts: localhost
tasks:
- add_host:
hostname: "{{ item.network_interfaces[0].private_ip_address }}"
groupname: launched
with_items: "{{ ec2_result.instances }}"





-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7866f762-0d10-4438-9ba1-0d1c12181b1f%40googlegroups.com.


Re: [ansible-project] Help with Conditions

2020-05-05 Thread Brian Coca
I would use vars to simplify the tasks themselves, alternatively you
could use a block to establish the common condition

- name:  run when not powered off
   vmware_guest_powerstate:
   hostname: '{{ mdb_console.json.0[resolved_name]}}'
   ...
  vars:
   powerstate: '{{ (json_file.stdout | from_json).power_state}}'
   console_defined : '{{ mdb_console.json.0['console'] is defined}}'
   resolved_name: '{{ console_defined|ternary("console", "vconsole")}}'
  when: 'powerstate != "poweredOff"'



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7d0sg9RH7Wgm-50uc-VYW5u2eTgYoq3UkDbXt-Deb-_1Q%40mail.gmail.com.


Re: [ansible-project] Getting a message on folders created in a loop

2020-05-05 Thread Brian Coca
You want to loop over the results, each item is stored in the results list.

 - debug:
   msg: folder created {{item.item}}
 loop: '{{result.results}}'
 when: item is not failed

‪

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7dRV%2BkJ10ZW8YXzCEuZN0kMp3khgTNtS6CKPtrqJUxxBQ%40mail.gmail.com.


Re: [ansible-project] Loop range format quick question

2020-05-05 Thread Stefan Hornburg (Racke)
On 5/5/20 2:36 PM, Dave Zarei wrote:
> HI,
> 
> quick question about how to use a variable in loop range:
> 
> I got this:
> 
> loop: "{{range (0, 2+1) | list}}"
> 
> 
> and this is what i want to use:
> 
> loop: "{{range (0, myvariable +1) | list}}"
> 
> 
> where "myvaribale" contains  number 2
> 
> 
> but it comes back with an error when i run it, i also tried to put myvariable 
> in double quote, single quote, but no
> help, is there any specific format to put myvariable in here?

You might need to use myvariable | int as Jinja results are strings - but it is 
always helpful to post the error with
your question.

Regards
  Racke

> 
> Thanks,
> Dave.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to
> ansible-project+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/878dd0d2-d4f3-4196-b7ab-bb2a8ed5dd9f%40googlegroups.com
> .


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dbc53db1-450d-2815-abc8-92774f7fc282%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


[ansible-project] Loop range format quick question

2020-05-05 Thread Dave Zarei
HI,

quick question about how to use a variable in loop range:

I got this:

loop: "{{range (0, 2+1) | list}}"


and this is what i want to use:

loop: "{{range (0, myvariable +1) | list}}"


where "myvaribale" contains  number 2


but it comes back with an error when i run it, i also tried to put 
myvariable in double quote, single quote, but no help, is there any 
specific format to put myvariable in here?

Thanks,
Dave.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/878dd0d2-d4f3-4196-b7ab-bb2a8ed5dd9f%40googlegroups.com.


[ansible-project] Help with Conditions

2020-05-05 Thread David Foley
Hi All,

Just wondering is their a better way of doing the Following?


---
- hosts: localhost
  gather_facts: false
  tasks:
  - name: Getting vCenter Details 
uri:
  url: http:///mdb/{{ fqdn }}
  return_content: yes
  body_format: json
register: mdb_console
  - copy:
  content: "{{ mdb_console }}"
  dest: 
"/usr2/dfoley/jenkins/workspace/vSphere/Virtual_Machine_Decommissioning/mdb_console.json"


  - name: Getting VM Info
block:
  - name: Get virtual machine info 
vmware_vm_info:
  validate_certs: no
  hostname: "{{ mdb_console.json.0['console'] }}"
  username: "{{ user }}"
  password: "{{ pass }}"
delegate_to: localhost
register: vm_info
when: mdb_console.json.0['console'] is defined
  - copy:
  content: "{{ item }}"
  dest: 
"/usr2/dfoley/jenkins/workspace/vSphere/Virtual_Machine_Decommissioning/MachineInfo.json"
with_items:
  - "{{ vm_info.virtual_machines | json_query(query) }}"
vars:
  query: "[?guest_name=='{{ VM_Name }}']"


  - name: Getting VM Info
block:
  - name: Get virtual machine info
vmware_vm_info:
  validate_certs: no
  hostname: "{{ mdb_console.json.0['vconsole'] }}"
  username: "{{ user }}"
  password: "{{ pass }}"
delegate_to: localhost
register: vm_info
when: mdb_console.json.0['console'] is not defined
  - copy:
  content: "{{ item }}"
  dest: 
"/usr2/dfoley/jenkins/workspace/vSphere/Virtual_Machine_Decommissioning/MachineInfo.json"
with_items:
  - "{{ vm_info.virtual_machines | json_query(query) }}"
vars:
  query: "[?guest_name=='{{ VM_Name }}']"


  
  - name: Read Json File
shell: cat /usr2/dfoley/jenkins/workspace/vSphere/
Virtual_Machine_Decommissioning/MachineInfo.json
register: json_file


  - name: Power Down Virutal Machine
vmware_guest_powerstate:
  validate_certs: no
  hostname: "{{ mdb_console.json.0['console'] }}"
  username: "{{ user }}"
  password: "{{ pass }}"
  name: "{{ VM_Name }}"
  state: powered-off
delegate_to: localhost
when: (json_file.stdout | from_json).power_state != "poweredOff" and 
mdb_console.json.0['console'] is defined


  - name: Power Down Virutal Machine
vmware_guest_powerstate:
  validate_certs: no
  hostname: "{{ mdb_console.json.0['vconsole'] }}"
  username: "{{ user }}"
  password: "{{ pass }}"
  name: "{{ VM_Name }}"
  state: powered-off
delegate_to: localhost
when: (json_file.stdout | from_json).power_state != "poweredOff" and 
mdb_console.json.0['console'] is not defined



Looking at maybe something I'm used to with Salt.

- name: Power Down Virutal Machine
vmware_guest_powerstate:
  validate_certs: no
 {% if mdb_console.json.0['console is defind %}
  hostname: "{{ mdb_console.json.0['console'] }}"
 {% else %}
  hostname: "{{ mdb_console.json.0['vconsole'] }}"
 {% endif %} 
  username: "{{ user }}"
  password: "{{ pass }}"
  name: "{{ VM_Name }}"
  state: powered-off
delegate_to: localhost
when: (json_file.stdout | from_json).power_state != "poweredOff"


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/610b85f9-36ba-44c1-8fb6-4853ce5dfe54%40googlegroups.com.


Re: [ansible-project] Getting : error while evaluating conditional (my_result.stat.exists): 'bool object' has no attribute 'stat' while expcting to be dictionary

2020-05-05 Thread Stefan Hornburg (Racke)
On 5/5/20 12:26 PM, Meir Yanovich wrote:
> i have this ansible simple playbook :
> where "/home/ec2-user/test1.txt" exists on disk 
> 
>    
> |
>  ---
>     -name:check ifexsist
>       hosts:localhost
>       gather_facts:false
>       tasks:
>    
>         -name:Getproject name
>           shell:"echo ''"
>           register:name_var
>    
>    
>         -name:Checkifthetest.log exists inpath
>           stat:
>             path:"/home/ec2-user/test1.txt1"
>           register:log_result_1
>    
>         -name:CheckifTheTest.log exists inp_home
>           stat:
>             path:"/home/ec2-user/test1.txt"
>           register:log_result_2
>           when:name_var.stdout ismatch("")
>    
>         -set_fact:
>             my_result:"{{ log_result_1.stat.exists or (log_result_2 is not 
> skipped and log_result_2.stat.exists) }}"
>    
>         -debug:
>             msg:" result_value 
> ##"
>         -debug:
>             var:my_result
>    
>    
>         -name:Createtemporary log folder
>           file:
>             path:"/home/ec2-user/log_tmp"
>             state:directory
>           when:my_result.stat.exists
> 
> |
> 
> 
> 
> 
> 
> 
> I expect that the my_result will have the value of the right register in this 
> case log_result_2

No the output is a boolean, variables are evaluated in your expression.

Regards
  Racke

> 
> but I'm getting this error:
> 
>  
> |
>   ansible-playbook 2.9.7
>       config file =/etc/ansible/ansible.cfg
>       configured modulesearch path 
> =['/home/ec2-user/.ansible/plugins/modules','/usr/share/ansible/plugins/modules']
>       ansible python modulelocation 
> =/home/ec2-user/venv_ansible_new/lib64/python3.7/site-packages/ansible
>       executable location 
> =/home/ec2-user/venv_ansible_new/bin/ansible-playbook
>       python version =3.7.6(default,Feb262020,20:54:15)[GCC 
> 7.3.120180712(RedHat7.3.1-6)]
>     Using/etc/ansible/ansible.cfg asconfig file
>     [WARNING]:Noinventory was parsed,only implicitlocalhost isavailable
>     [WARNING]:provided hosts list isempty,only localhost isavailable.Notethat 
> the implicitlocalhost does notmatch 'all'
>    
>     PLAYBOOK:test3.yml
> *
>     1plays intest3.yml
>    
>     PLAY [check
> ifexsist]**
>     META:ran handlers
>    
>     TASK [Getproject
> name]*
>     task path:/home/ec2-user/test3.yml:7
>     Tuesday05May2020 09:56:22+(0:00:00.070)      0:00:00.070***
>     changed:[localhost]=>changed=true
>       cmd:echo ''
>       delta:'0:00:00.002594'
>       end:'2020-05-05 09:56:22.684370'
>       rc:0
>       start:'2020-05-05 09:56:22.681776'
>       stderr:''
>       stderr_lines:
>       stdout:
>       stdout_lines:
>    
>     TASK [Checkifthetest.log exists
> inpath]**
>     task path:/home/ec2-user/test3.yml:12
>     Tuesday05May2020 09:56:22+(0:00:00.256)      0:00:00.327***
>     ok:[localhost]=>changed=false
>       stat:
>         exists:false
>    
>     TASK [CheckifTheTest.log exists
> inp_home]
>     task path:/home/ec2-user/test3.yml:17
>     Tuesday05May2020 09:56:22+(0:00:00.250)      0:00:00.577***
>     ok:[localhost]=>changed=false
>       stat:
>         atime:1588660417.6106787
>         attr_flags:''
>         attributes:[]
>         block_size:4096
>         blocks:8
>         charset:us-ascii
>         checksum:75bae7e3ee07809acd2477a8427b5b32e605a6b4
>         ctime:1588660417.6106787
>         dev:66305
>         device_type:0
>         executable:false
>         exists:true
>         gid:1000
>         gr_name:ec2-user
>         inode:77678
>         isblk:false
>         ischr:false
>         isdir:false
>         isfifo:false
>         isgid:false
>         islnk:false
>         isreg:true
>         issock:false
>         isuid:false
>         mimetype:text/plain
>         mode:'0664'
>         

[ansible-project] Getting : error while evaluating conditional (my_result.stat.exists): 'bool object' has no attribute 'stat' while expcting to be dictionary

2020-05-05 Thread Meir Yanovich
i have this ansible simple playbook :
where "/home/ec2-user/test1.txt" exists on disk 

   
 ---
- name: check if exsist
  hosts: localhost
  gather_facts: false
  tasks:

- name: Get project name
  shell: "echo ''"
  register: name_var


- name: Check if thetest.log exists in path
  stat:
path: "/home/ec2-user/test1.txt1"
  register: log_result_1

- name: Check if TheTest.log exists in p_home
  stat:
path: "/home/ec2-user/test1.txt"
  register: log_result_2
  when: name_var.stdout is match("")

- set_fact:
my_result: "{{ log_result_1.stat.exists or (log_result_2 is not 
skipped and log_result_2.stat.exists) }}"

- debug:
msg: " result_value 
##"
- debug:
var: my_result


- name: Create temporary log folder
  file:
path: "/home/ec2-user/log_tmp"
state: directory
  when: my_result.stat.exists







I expect that the my_result will have the value of the right register in 
this case log_result_2

but I'm getting this error:

  
  ansible-playbook 2.9.7
  config file = /etc/ansible/ansible.cfg
  configured module search path = [
'/home/ec2-user/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ec2-user/venv_ansible_new/lib64
/python3.7/site-packages/ansible
  executable location = /home/ec2-user/venv_ansible_new/bin/ansible-
playbook
  python version = 3.7.6 (default, Feb 26 2020, 20:54:15) [GCC 7.3.1 
20180712 (Red Hat 7.3.1-6)]
Using /etc/ansible/ansible.cfg as config file
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. 
Note that the implicit localhost does not match 'all'

PLAYBOOK: test3.yml 
*
1 plays in test3.yml

PLAY [check if exsist] 
**
META: ran handlers

TASK [Get project name] 
*
task path: /home/ec2-user/test3.yml:7
Tuesday 05 May 2020  09:56:22 + (0:00:00.070)   0:00:00.070 
***
changed: [localhost] => changed=true
  cmd: echo ''
  delta: '0:00:00.002594'
  end: '2020-05-05 09:56:22.684370'
  rc: 0
  start: '2020-05-05 09:56:22.681776'
  stderr: ''
  stderr_lines: 
  stdout: 
  stdout_lines: 

TASK [Check if thetest.log exists in path] 
**
task path: /home/ec2-user/test3.yml:12
Tuesday 05 May 2020  09:56:22 + (0:00:00.256)   0:00:00.327 
***
ok: [localhost] => changed=false
  stat:
exists: false

TASK [Check if TheTest.log exists in p_home] 

task path: /home/ec2-user/test3.yml:17
Tuesday 05 May 2020  09:56:22 + (0:00:00.250)   0:00:00.577 
***
ok: [localhost] => changed=false
  stat:
atime: 1588660417.6106787
attr_flags: ''
attributes: []
block_size: 4096
blocks: 8
charset: us-ascii
checksum: 75bae7e3ee07809acd2477a8427b5b32e605a6b4
ctime: 1588660417.6106787
dev: 66305
device_type: 0
executable: false
exists: true
gid: 1000
gr_name: ec2-user
inode: 77678
isblk: false
ischr: false
isdir: false
isfifo: false
isgid: false
islnk: false
isreg: true
issock: false
isuid: false
mimetype: text/plain
mode: '0664'
mtime: 1588660417.6106787
nlink: 1
path: /home/ec2-user/test1.txt
pw_name: ec2-user
readable: true
rgrp: true
roth: true
rusr: true
size: 18
uid: 1000
version: '101509'
   

Re: [ansible-project] Ansible lininfile behavior

2020-05-05 Thread Vladimir Botka
On Tue, 5 May 2020 00:47:10 +0200
Vladimir Botka  wrote:

> On Tue, 5 May 2020 00:02:40 +0200
> Kai Stian Olstad  wrote:
> 
> > On Mon, May 04, 2020 at 11:19:53PM +0200, Vladimir Botka wrote:  
> > > There is no such problem with Ansible running on controller with Python 3 
> > >
> > 
> > That's just not true, your test method is flawed, you need to test it more 
> > than one time.
> > 
> > $ for i in {1..100}; do >/tmp/txt; ansible-playbook test.yml &>/dev/null; 
> > md5sum /tmp/txt; done | sort | uniq -c | sort -n
> >   4 763950971c8c6d8df8a87a1e752799a9  /tmp/txt
> >  11 1597a5a9948014489de663c8fb4438db  /tmp/txt
> >  36 ac34af7b876f793d09a2225e23f43088  /tmp/txt
> >  49 317f53fd9236220d0ab65e4aac4b3c5a  /tmp/txt
> 
> Well, it is true. There are no problems reported with your method either. I
> get correct results only.
> 
> shell> for i in {1..100}; do >test-file; ansible-playbook pb.yml 2>/dev/null; 
> md5sum test-file; done | sort | uniq -c | sort -n  
>  18 82de37d1deac8c90573c35e5637839d7  test-file
>  82 6f4e9c06436257db5ba34d527bd3b211  test-file

To be sure, I let it run overnight

shell> for i in {1..1}; do >test-file; ansible-playbook -i hosts77 
test77.yml 2>/dev/null; md5sum test-file; done | sort | uniq -c | sort -n
   2689 82de37d1deac8c90573c35e5637839d7  test-file
   7311 6f4e9c06436257db5ba34d527bd3b211  test-file

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20200505091950.4e0960a7%40gmail.com.


pgpSiCiYTcS3o.pgp
Description: OpenPGP digital signature


[ansible-project] Getting a message on folders created in a loop

2020-05-05 Thread דודו דודו


I’m running a playbook that should create 2 folders in a loop. If the 
folder is not existing, I wish to get a message that folders was created  


In my scenario, folder 1 already exists and only folder 2 was created. But 
the message was skipped – I’m guessing that the register is being updated 
on every loop and the last task is getting the last update of the register.


My goal Is to show a message on every folder that was created.


Thanks 



*Playbook:*


 

- hosts: gw
  become: true
  become_user: hdfs
  vars:
folders:
- /folder1
- /folder2

  tasks:

   - name: create Main HDFS folders
 shell: hadoop fs -mkdir {{ item }}
 register: result
 ignore_errors: yes
 with_items: "{{ folders }}"

   - debug:
   msg: " {{ result }}"

   - debug:
   msg: folder created
 when: result is not failed





*Output:*


*PLAY [gw] 



*TASK [Gathering Facts] 
***

*ok: [10.201.51.16]*


*TASK [create Main HDFS folders] 
**

*failed: [10.201.51.16] (item=/folder1) => {"ansible_loop_var": "item", 
"changed": true, "cmd": "hadoop fs -mkdir /folder1", "delta": 
"0:00:02.575512", "end": "2020-05-05 06:41:14.912389 ", 
"item": "/folder1", "msg": "non-zero return code", "rc": 1, "start": 
"2020-05-05 06:41:12.336877", "stderr": "mkdir: `/folder1': File exists", 
"stderr_lines": ["mkdir: `/folder1': Fi le exists"], 
"stdout": "", "stdout_lines": []}*

*changed: [10.201.51.16] => (item=/folder2)*

*...ignoring*


*TASK [debug] 
*

*ok: [10.201.51.16] => {*

*"msg": " {'msg': u'All items completed', 'failed': True, 'changed': 
True, 'results': [{'stderr_lines': [u\"mkdir: `/folder1': File exists\"], 
'ansible_loop_var': u'item', u'end': u' 2020-05-05 
06:41:14.912389', u'failed': True, u'stdout': u'', u'changed': True, u'rc': 
1, u'start': u'2020-05-05 06:41:12.336877', u'cmd': u'hadoop fs -mkdir 
/folder1', 'item': u'/folde r1', u'delta': 
u'0:00:02.575512', u'invocation': {u'module_args': {u'creates': None, 
u'executable': None, u'_uses_shell': True, u'strip_empty_ends': True, 
u'_raw_params': u'hadoop fs -m kdir /folder1', u'removes': 
None, u'argv': None, u'warn': True, u'chdir': None, u'stdin_add_newline': 
True, u'stdin': None}}, 'stdout_lines': [], u'stderr': u\"mkdir: 
`/folder1': File e xists\", u'msg': u'non-zero return 
code'}, {'stderr_lines': [], 'ansible_loop_var': u'item', u'end': 
u'2020-05-05 06:41:18.125812', 'failed': False, u'stdout': u'', u'changed': 
True, u' rc': 0, 'item': u'/folder2', u'cmd': u'hadoop fs 
-mkdir /folder2', u'stderr': u'', u'delta': u'0:00:02.609342', 
u'invocation': {u'module_args': {u'creates': None, u'executable': None, u  
   '_uses_shell': True, u'strip_empty_ends': True, 
u'_raw_params': u'hadoop fs -mkdir /folder2', u'removes': None, u'argv': 
None, u'warn': True, u'chdir': None, u'stdin_add_newline': True,
  u'stdin': None}}, 'stdout_lines': [], u'start': u'2020-05-05 
06:41:15.516470'}]}"*

*}*


*TASK [debug] 
*

*skipping: [10.201.51.16]*


*PLAY RECAP 
***

*10.201.51.16   : ok=3changed=1unreachable=0
failed=0skipped=1rescued=0ignored=1*



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c99ebdf2-bba2-44d2-9e18-e582ae8edc27%40googlegroups.com.