Re: [ansible-project] Getting ansible_python_interpreter error in mac local machine

2021-03-08 Thread Dick Visser
I don't see any question, so I will go ahead and assume you are
surprised about the python/python3 difference.
Please read: 
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html


On Mon, 8 Mar 2021 at 20:47, Jaydip Jadeja  wrote:
>
> zsh shell : ansible-playbook -D -l 'local' -e "cluster=xxx1" cluster.yml
> error : "msg": "Failed to import the required Python library (openshift) on 
> MacBook-Pro.local's Python 
> /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python.
>  Please read module documentation and install in the appropriate location. If 
> the required library is installed, but Ansible is using the wrong Python 
> interpreter, please consult the documentation on ansible_python_interpreter"
>
> when I pass extra argument command : ansible-playbook -D -l 'local' -e 
> "cluster=xxx1" xxx.yml -e ansible_python_interpreter=/usr/bin/python3
>
> above playbook working without error
>
> --
> 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/f0a35ad6-d67c-4456-8b49-d6003fcd3e84n%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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/CAL8fbwNStV4xwJyuuR9es%3DaVhKsc9a-9AUmV_Z5A6SPYvU7n-A%40mail.gmail.com.


Re: [ansible-project] Slowness problèmes after upgrade from 2.8 to 2.9

2021-03-08 Thread aori...@gmail.com
We found the problems after many times and it's caused by 
https://github.com/ansible/ansible/issues/68763 
(we rollback to ansible 2.8 for some times and now we will work on our 
lookup and variables to fix the issue)
Thanks for the help anyway.
Have a nice day.

Le mercredi 21 octobre 2020 à 17:26:07 UTC+2, Quentin Aveno a écrit :

> Thanks for advice, I will take a look. 
>
> Le mer. 21 oct. 2020 à 14:04, Jorge Rúa  a écrit :
>
>> I *suspect* that issue might be caused by the newer ansible version 
>> which is potentially exhausting resources on the ansible controller node. 
>> Pay close attention to memory usage on the controller node when you're 
>> running ansible.
>>
>> El mié., 21 oct. 2020 a las 13:31, Quentin Aveno () 
>> escribió:
>>
>>> Hi everyone, 
>>> I have a slowness problem after upgrading ansible from ansible 2.8 to 
>>> ansible 2.9 (and from python 2.7 to python 3 only on controller). A lot of 
>>> differents taskes (and différents modules) became very slow (from seconds 
>>> to more than 5 minutes). After activating debug, I can see à kind of loop 
>>> over loading module:
>>> Loading Lookup Module '>> urlsplit/env/cordes/files/k8s/mathstuff/... each in turns> from 
>>> 
>>> More than 4000 times in à raw for each module. 
>>>
>>> Have you ever experimence this kind of slowness ? 
>>>
>>> -- 
>>> 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-proje...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/7c953cae-5d42-4637-9ecf-abaeeeb7fb82o%40googlegroups.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-proje...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAFtje5MNKUVdsijWFrgTxgXBRgQKqiz7z7vyxq%3DwbuaiDDeEbQ%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/8d80b457-5029-4c27-9c42-66c6343108b1n%40googlegroups.com.


[ansible-project] Run the same handler only once through many playbooks notify

2021-03-08 Thread aori...@gmail.com

Hi everyone.

Is there a way to run a handler once through multiple playbooks.

Explanation :
I have a "master" playbook which imports several other playbooks.
I can run the "master" playbook or one individual playbook depending ot the 
situation.

Some of those playbooks notify the same handlers during key tasks.

But I have to run this handler only one time for all the playbook after the 
last notify.

Example :
master playbook:

   - playbook 1 :
  - prerequisite
  - install app1[notify handler] (<-do not run now but notify)
  - configure app1 [notify handler] (<-do not run now but notify)
   - playbook 2 :
   - prerequisite
  - install app2 [notify handler]  (<-do not run now but notify)
  - configure app2 [notify handler] (<- run now cause it's the last 
  notify)
  
If you have any idea, I would be grateful :)
Have a nice day.

-- 
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/261f3852-6f73-4f24-a2a4-8be35cefa088n%40googlegroups.com.


[ansible-project] ovirt_vm import OVA

2021-03-08 Thread Arsène Gschwind
Hi,

I'm having trouble getting the ovirt_vm module to import an ova image, i'm 
always getting the following error:
Traceback (most recent call last): 
  File 
"/tmp/ansible_ovirt_vm_payload_upn728mm/ansible_ovirt_vm_payload.zip/ansible/modules/cloud/ovirt/ovirt_vm.py",
 
line 2466, in main 
  File 
"/tmp/ansible_ovirt_vm_payload_upn728mm/ansible_ovirt_vm_payload.zip/ansible/modules/cloud/ovirt/ovirt_vm.py",
 
line 2283, in import_vm 
  File 
"/home/xx/.local/lib/python3.6/site-packages/ovirtsdk4/services.py", 
line 10453, in add 
return self._internal_add(import_, headers, query, wait) 
  File 
"/home/xx/.local/lib/python3.6/site-packages/ovirtsdk4/service.py", 
line 232, in _internal_add 
return future.wait() if wait else future 
  File 
"/home/xx/.local/lib/python3.6/site-packages/ovirtsdk4/service.py", 
line 55, in wait 
return self._code(response) 
  File 
"/home/xx/.local/lib/python3.6/site-packages/ovirtsdk4/service.py", 
line 229, in callback 
self._check_fault(response) 
  File 
"/home/xxx/.local/lib/python3.6/site-packages/ovirtsdk4/service.py", 
line 130, in _check_fault 
body = self._internal_read_body(response) 
  File 
"/home/xxx/.local/lib/python3.6/site-packages/ovirtsdk4/service.py", 
line 312, in _internal_read_body 
self._raise_error(response) 
  File 
"/home/xxx/.local/lib/python3.6/site-packages/ovirtsdk4/service.py", 
line 118, in _raise_error 
raise error 
ovirtsdk4.NotFoundError: HTTP response code is 404. 

This is my task:

- name: Import {{ vm_name }} as OVA 
  ovirt_vm: 
auth: '{{ unb_revm_auth }}' 
name: '{{ vm_name }}' 
clone: Yes 
cluster: 'XX' 
host: '{{ import_host }}' 
timeout: 3600 
poll_interval: 30 
cluster_mappings: 
  - source_name: '' 
dest_name: '' 
domain_mappings: 
  - source_name: 'xx' 
dest_name: 'xx' 
vnic_profile_mappings: 
- source_network_name: 'vlan4'   
  source_profile_name: 'vlan4' 
  target_profile_id: '63e8a132-4bdf-40a7-b0e9-faf83c859cce' 
reassign_bad_macs: True 
kvm: 
  name: '{{ vm_name }}' 
  url: 'ova://{{ shared_folder}}/{{ vm_name }}.ova' 
  storage_domain: 'xxx' 
  register: _import_result

Do i miss something or any idea what's wrong?
Thanks for any help/hint.

regards,
arsene

-- 
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/35912e0d-0f81-4593-a911-3990daa419d5n%40googlegroups.com.


[ansible-project] Getting ansible_python_interpreter error in mac local machine

2021-03-08 Thread Jaydip Jadeja
zsh shell : ansible-playbook -D -l 'local' -e "cluster=xxx1" cluster.yml
error : "msg": "Failed to import the required Python library (openshift) on 
MacBook-Pro.local's Python 
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python.
 
Please read module documentation and install in the appropriate location. 
If the required library is installed, but Ansible is using the wrong Python 
interpreter, please consult the documentation on ansible_python_interpreter"

when I pass extra argument command : ansible-playbook -D -l 'local' -e 
"cluster=xxx1" xxx.yml -e ansible_python_interpreter=/usr/bin/python3 

above playbook working without error

-- 
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/f0a35ad6-d67c-4456-8b49-d6003fcd3e84n%40googlegroups.com.


Re: [ansible-project] ansible remote host to remote synchronize.py error

2021-03-08 Thread Raja Natte
Issue is hang on awx.. no errors.

Thanks


On Mon, Mar 8, 2021, 2:03 PM Stefan Schmid <
stefan.schmid.switzerl...@gmail.com> wrote:

> Hi
>
> Did you know?
> (..)
> rsync must be installed on both the local and remote host.
> (..)
> Source:
> https://docs.ansible.com/ansible/2.9/modules/synchronize_module.html
>
> In addition there are many notes for that modul (e.g. permissions) on that
> source.
> Thanks.
>
> On Sunday, March 7, 2021 at 5:26:55 PM UTC+1 Raj wrote:
>
>> While doing this verbose it hangs  at 1265/AnsiballZ_synchronize.py &&
>> sleep 0'"'"''
>>
>> Thanks
>>
>>
>>
>> On Sun, Mar 7, 2021, 9:54 AM Antony Stone <
>> antony...@ansible.open.source.it> wrote:
>>
>>> On Sunday 07 March 2021 at 15:52:20, Raj wrote:
>>>
>>> > Hi all,
>>> >
>>> >  Below is my playbook for copy from server A to server B. Could you
>>> please
>>> > help me  on this issue.
>>> >  ---
>>> > - name: copy remote to remote host
>>> >   synchronize:
>>> >   src: "{{ src_path }}"
>>> >   dest: "{{ dest_path }}"
>>> >   delegate_to:  Server B
>>> >
>>> > while running through AWX hang with below error
>>> > /usr/bin/python
>>> >
>>> /home/ansible-dav/.ansible/tmp/ansible-tmp-1615128261.3756096-28-1747884227
>>> > 1265/AnsiballZ_synchronize.py && sleep 0'"'"''
>>>
>>> I see no error message in what you have posted.
>>>
>>>
>>> Antony.
>>>
>>> --
>>> Late in 1972 President Richard Nixon announced that the rate of increase
>>> of
>>> inflation was decreasing.   This was the first time a sitting president
>>> used a
>>> third derivative to advance his case for re-election.
>>>
>>>  - Hugo Rossi, Notices of the American Mathematical Society
>>>
>>>Please reply to the
>>> list;
>>>  please *don't*
>>> CC me.
>>>
>> --
> 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/a5109543-0029-400f-8270-d391a3e2900bn%40googlegroups.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/CA%2BuTAOhsjzwhQ00f97nH_%2BZ5j_o-Ai9uNKPj%2B%3DkY9UFRmcgD%2Bg%40mail.gmail.com.


Re: [ansible-project] ansible remote host to remote synchronize.py error

2021-03-08 Thread Stefan Schmid
Hi 

Did you know?
(..)
rsync must be installed on both the local and remote host.
(..)
Source: https://docs.ansible.com/ansible/2.9/modules/synchronize_module.html

In addition there are many notes for that modul (e.g. permissions) on that 
source.
Thanks.

On Sunday, March 7, 2021 at 5:26:55 PM UTC+1 Raj wrote:

> While doing this verbose it hangs  at 1265/AnsiballZ_synchronize.py && 
> sleep 0'"'"''
>
> Thanks 
>
>
>
> On Sun, Mar 7, 2021, 9:54 AM Antony Stone <
> antony...@ansible.open.source.it> wrote:
>
>> On Sunday 07 March 2021 at 15:52:20, Raj wrote:
>>
>> > Hi all,
>> > 
>> >  Below is my playbook for copy from server A to server B. Could you 
>> please
>> > help me  on this issue.
>> >  ---
>> > - name: copy remote to remote host
>> >   synchronize:
>> >   src: "{{ src_path }}"
>> >   dest: "{{ dest_path }}"
>> >   delegate_to:  Server B
>> > 
>> > while running through AWX hang with below error
>> > /usr/bin/python
>> > 
>> /home/ansible-dav/.ansible/tmp/ansible-tmp-1615128261.3756096-28-1747884227
>> > 1265/AnsiballZ_synchronize.py && sleep 0'"'"''
>>
>> I see no error message in what you have posted.
>>
>>
>> Antony.
>>
>> -- 
>> Late in 1972 President Richard Nixon announced that the rate of increase 
>> of 
>> inflation was decreasing.   This was the first time a sitting president 
>> used a 
>> third derivative to advance his case for re-election.
>>
>>  - Hugo Rossi, Notices of the American Mathematical Society
>>
>>Please reply to the 
>> list;
>>  please *don't* 
>> CC me.
>>
>

-- 
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/a5109543-0029-400f-8270-d391a3e2900bn%40googlegroups.com.


Re: [ansible-project] ansible group not working

2021-03-08 Thread Tony Wong
yes that was it! Thank you

On Mon, Mar 8, 2021 at 8:40 AM Brian Coca  wrote:

> You probably want to put it in BOTH groups
>
>
> --
> --
> Brian Coca
>
> --
> 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/UEBAlv00b9s/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/CACVha7cp0XfuERBo%3Dup9LCYV0ALcaoB26tDqmXqjLJRO%2BdrbxQ%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/CALmkhkrF4fLfVjrX_gNX0D%3DhQn7DfdmkPCwMx5mk9QMwOAhNWw%40mail.gmail.com.


Re: [ansible-project] How can I use with_items twice in a single tasks?

2021-03-08 Thread 'Chris Bidwell - NOAA Federal' via Ansible Project
I think this would be your syntax:

- name: setup directory permissions
  file:
path: "{{ item.path }}"
state: "{{ item.state }}"
mode: "{{ item.mode }}"
owner: "{{ item.owner }}"
group: "{{ item.group }}"
  with_items:
- { path: "/data/gong", state: "directory", mode: '2775', owner:
"conductor", group: "pipe" }
- { path: "/data/gong/pipe", state: "directory", mode: '0775',
owner: "conductor", group: "pipe" }
- { path: "/data/gong/pipe/conductor", state: "directory", mode:
'0755', owner: "conductor", group: "pipe" }
- { path: "/opt/db", state: "directory", mode: '0775', owner:
"conductor", group: "pipe" }
- { path: "/iraf", state: "directory", mode: '0775', owner: "gong",
group: "pipe" }
- { path: "/local", state: "directory", mode: '0775', owner:
"gong", group: "pipe" }
- { path: "/data/ftps_in", state: "directory", mode: '0775', owner:
"conductor", group: "pipe" }
- { path: "/localpipe", state: "directory", mode: '0775', owner:
"conductor", group: "pipe" }
- { path: "/var/log/local0.log", state: "touch", mode: '0664',
owner: 'root', group: "pipe" }
- { path: "/chroot/files/idl", state: "directory", mode: '0775',
owner: 'root', group: "root" }

On Mon, Mar 8, 2021 at 7:58 AM Vladimir Botka  wrote:

> On Mon, 8 Mar 2021 06:33:03 -0800 (PST)
> "dudu.c...@gmail.com"  wrote:
>
> > - name: update file
> >   lineinfile:
> > path: {{ item }} *<-- This should describe the files*
> > regexp: "{{ item.from }}"
> > line: "{{ item.replace_with }}"
> >   with_items:
> >  - { from: parameter1= , replace_with: parameter1=test1 }
> >  - { from: parameter1= , replace_with: parameter1=test2 }
> >   with_items:  *-- > This should be for the path*
> >  - “/opt/file1”
> >  - “/opt/file2”
>
> Try this
>
>  - name: update file
>lineinfile:
>  path: "{{ item.0 }}"
>  regexp: "{{ item.1.from }}"
>  line: "{{ item.1.replace_with }}"
>with_nested:
>   - - “/opt/file1”
> - “/opt/file2”
>   - - {from: parameter1=, replace_with: parameter1=test1}
> - {from: parameter1=, replace_with: parameter1=test2}
>
> (not tested)
>
> --
> Vladimir Botka
>
> --
> 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/20210308155804.17e2826e%40gmail.com
> .
>


-- 

Chris Bidwell, CISSP
Space Weather Prediction Center
National Oceanic Atmospheric Administration
email: c hris.bidw...@noaa.gov
office: 303-497-3204
mobile: 720-496-3126

-- 
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/CAHKi8Cjz7_hP%2B6V34S3cTb3hSDXngbmX_TQVONUN5CkH3e0bBw%40mail.gmail.com.


Re: [ansible-project] ansible group not working

2021-03-08 Thread Brian Coca
You probably want to put it in BOTH groups


-- 
--
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/CACVha7cp0XfuERBo%3Dup9LCYV0ALcaoB26tDqmXqjLJRO%2BdrbxQ%40mail.gmail.com.


Re: [ansible-project] How to extract specific value from register output

2021-03-08 Thread Nuno Jordão
Hello,

It's inside a "results" list. The result of a loop?
In that case you need: {{ file_name.results[0].path }} to get the first
element of the "results" list.
If you have more, you need a loop to iterate it.

Nuno Jordão

On Mon, Mar 8, 2021 at 3:57 PM dudu.c...@gmail.com 
wrote:

> How to extract a specific value from register output:
>
> From the below register output I’m trying to extract the * path *value
> with no luck, I have tried few options but still, I’m falling
>
>
> - debug:
> msg: "{{ file_name }}" - debug:
> msg: "{{ file_name.results.path }}"  - debug:
> msg: "{{ file_name.path }}"
>
>
>
> File_name register output
>
>
>
> "msg": {
>
> "changed": false,
>
> "msg": "All items completed",
>
> "results": [
>
> {
>
> "ansible_loop_var": "item",
>
> "changed": false,
>
> "checksum": "45823e35872e278fe781a182aa50abcd92d2df62",
>
> "dest": "/data/nifi-deployment/file_32.tar.gz",
>
> "diff": {
>
> "after": {
>
> "path": "/data/nifi-deployment/file_32.tar.gz"
>
> },
>
> "before": {
>
> "path": "/data/nifi-deployment/file_32.tar.gz"
>
> }
>
> },
>
> "failed": false,
>
> "gid": 0,
>
> "group": "root",
>
> "invocation": {
>
> "module_args": {
>
> "_diff_peek": null,
>
> "_original_basename": " file_32.tar.gz ",
>
> "access_time": null,
>
> "access_time_format": "%Y%m%d%H%M.%S",
>
> "attributes": null,
>
> "backup": null,
>
> "content": null,
>
> "delimiter": null,
>
> "dest": "/data/nifi-deployment",
>
> "directory_mode": null,
>
> "follow": true,
>
> "force": true,
>
> "group": null,
>
> "mode": null,
>
> "modification_time": null,
>
> "modification_time_format": "%Y%m%d%H%M.%S",
>
> "owner": null,
>
> "path": "/data/nifi-deployment/file_32.tar.gz",
>
> "recurse": false,
>
> "regexp": null,
>
> "remote_src": null,
>
> "selevel": null,
>
> "serole": null,
>
> "setype": null,
>
> "seuser": null,
>
> "src": null,
>
> "state": "file",
>
> "unsafe_writes": null
>
> }
>
> },
>
> "item": "/repo/file_32.tar.gz ",
>
> "mode": "0644",
>
> "owner": "root",
>
>   *  "path": "/data/nifi-deployment/file_32.tar.gz",*
>
> "secontext": "system_u:object_r:default_t:s0",
>
> "size": 4938,
>
> "state": "file",
>
> "uid": 0
>
> }
>
> ]
>
> }
>
> }
>
> --
> 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/bdbb05c9-e58f-410d-8181-868ab76a5b11n%40googlegroups.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/CAEAA%3Dtu6Z4H7zvDG5usE3-OpMQ19dW%2B%3DKRVPJ5M4Fya9wQBP%3Dw%40mail.gmail.com.


[ansible-project] How to extract specific value from register output

2021-03-08 Thread dudu.c...@gmail.com


How to extract a specific value from register output:

>From the below register output I’m trying to extract the * path *value with 
no luck, I have tried few options but still, I’m falling

 
- debug:
msg: "{{ file_name }}" - debug:
msg: "{{ file_name.results.path }}"  - debug:
msg: "{{ file_name.path }}" 

 

File_name register output 

 

"msg": {

"changed": false,

"msg": "All items completed",

"results": [

{

"ansible_loop_var": "item",

"changed": false,

"checksum": "45823e35872e278fe781a182aa50abcd92d2df62",

"dest": "/data/nifi-deployment/file_32.tar.gz",

"diff": {

"after": {

"path": "/data/nifi-deployment/file_32.tar.gz"

},

"before": {

"path": "/data/nifi-deployment/file_32.tar.gz"

}

},

"failed": false,

"gid": 0,

"group": "root",

"invocation": {

"module_args": {

"_diff_peek": null,

"_original_basename": " file_32.tar.gz ",

"access_time": null,

"access_time_format": "%Y%m%d%H%M.%S",

"attributes": null,

"backup": null,

"content": null,

"delimiter": null,

"dest": "/data/nifi-deployment",

"directory_mode": null,

"follow": true,

"force": true,

"group": null,

"mode": null,

"modification_time": null,

"modification_time_format": "%Y%m%d%H%M.%S",

"owner": null,

"path": "/data/nifi-deployment/file_32.tar.gz",

"recurse": false,

"regexp": null,

"remote_src": null,

"selevel": null,

"serole": null,

"setype": null,

"seuser": null,

"src": null,

"state": "file",

"unsafe_writes": null

}

},

"item": "/repo/file_32.tar.gz ",

"mode": "0644",

"owner": "root",

  *  "path": "/data/nifi-deployment/file_32.tar.gz",*

"secontext": "system_u:object_r:default_t:s0",

"size": 4938,

"state": "file",

"uid": 0

}

]

}

}

-- 
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/bdbb05c9-e58f-410d-8181-868ab76a5b11n%40googlegroups.com.


Re: [ansible-project] How can I use with_items twice in a single tasks?

2021-03-08 Thread Vladimir Botka
On Mon, 8 Mar 2021 06:33:03 -0800 (PST)
"dudu.c...@gmail.com"  wrote:

 - name: update file
   lineinfile:
 path: {{ my_path }}
 regexp: "{{ item.from }}"
 line: "{{ item.replace_with }}"
   with_items:
  - {from: parameter1= , replace_with: parameter1=test1}
  - {from: parameter1= , replace_with: parameter1=test2}

This will replace the "last line found". Twice. Quoting from "regexp"
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html#parameter-regexp

  "The regular expression to look for in every line of the file ...
  Only the last line found will be replaced."

You might want to mark the blocks and use *blockinfile* if you can't
use *template*.

-- 
Vladimir Botka

-- 
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/20210308161153.38a0894f%40gmail.com.


pgplMpyKtpPp5.pgp
Description: OpenPGP digital signature


Re: [ansible-project] How can I use with_items twice in a single tasks?

2021-03-08 Thread Vladimir Botka
On Mon, 8 Mar 2021 06:33:03 -0800 (PST)
"dudu.c...@gmail.com"  wrote:

> - name: update file
>   lineinfile:
> path: {{ item }} *<-- This should describe the files*
> regexp: "{{ item.from }}"
> line: "{{ item.replace_with }}"
>   with_items:
>  - { from: parameter1= , replace_with: parameter1=test1 }
>  - { from: parameter1= , replace_with: parameter1=test2 }
>   with_items:  *-- > This should be for the path*
>  - “/opt/file1”   
>  - “/opt/file2” 

Try this

 - name: update file
   lineinfile:
 path: "{{ item.0 }}"
 regexp: "{{ item.1.from }}"
 line: "{{ item.1.replace_with }}"
   with_nested:
  - - “/opt/file1”   
- “/opt/file2” 
  - - {from: parameter1=, replace_with: parameter1=test1}
- {from: parameter1=, replace_with: parameter1=test2}

(not tested)

-- 
Vladimir Botka

-- 
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/20210308155804.17e2826e%40gmail.com.


pgpGjWlRfroJI.pgp
Description: OpenPGP digital signature


[ansible-project] How can I use with_items twice in a single tasks?

2021-03-08 Thread dudu.c...@gmail.com


How can I use with_items twice in a single tasks?

For example , using line-in-file , I wish to update few parameters on a 
file that can be found on 2 locations 


- name: update file
  lineinfile:
path: {{ item }} *<-- This should describe the files*
regexp: "{{ item.from }}"
line: "{{ item.replace_with }}"
  with_items:
 - { from: parameter1= , replace_with: parameter1=test1 }
 - { from: parameter1= , replace_with: parameter1=test2 }
  with_items:  *-- > This should be for the path*
 - “/opt/file1”   
 - “/opt/file2” 

 

 

-- 
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/14ead263-3f7c-4e3a-825d-9882ed3aa777n%40googlegroups.com.


Re: [ansible-project] vmware_guest - VM is created but the name "none"

2021-03-08 Thread Dick Visser
On Mon, 8 Mar 2021 at 09:34, esxi...@gmail.com  wrote:
>
> None o/p from Ubuntu20x box ..

What do you mean no output?
Why is there no output?

>
>
>
> FYI same template... same vcenter .. same everything ..
>
>
> 2.9.6 is ansible which comes with OS
>
> on other node i did pip3 so version is 2.10 ..

Sounds like you have two totally different control nodes, with
different ansible installs, possibly multiple installs, mixed with
Jenkins.
And oh yeah they're also different OS-es.
Since there are so many differences it's will be very hard to tell why
things work on one box and not on the other.

You could start with eliminating the differences between ansible installs.
For instance using a venv on both will help.


>
>
> ###
>
>
>  ansible-playbook /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml 
> -f 5 --extra-vars "vm_name=VM-X  vm_ip=IP vcenter_name=DC-vc01.DOMAIN 
> vcenter_folder=DC-C-Infra vcenter_rp=DC-Prod vcenter_dc=DC 
> vcenter_cluster=DC-C-Cluster01 vcenter_template=DC-centos7-template-infra 
> vm_disk_size=101 vcenter_datastore=DATASTTORE vm_mem_mb_size=16384 
> vm_cpu_size=1 vm_core_size=1 vcenter_network=VLAN  vm_gateway=GW   
> vcenter_OS=CentOS7  vcenter_Location=DC  vcenter_LOB=Infra  
> vcenter_Environment=Test  vcenter_Application=test1" -
> ansible-playbook 2.9.6
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = ['/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python3/dist-packages/ansible
>   executable location = /usr/bin/ansible-playbook
>   python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
> Using /etc/ansible/ansible.cfg as config file
> setting up inventory plugins
> host_list declined parsing /etc/ansible/hosts as it did not pass its 
> verify_file() method
> auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() 
> method
> Set default localhost to 127.0.0.1
> Parsed /etc/ansible/hosts inventory source with ini plugin
> Loading callback plugin default of type stdout, v2.0 from 
> /usr/lib/python3/dist-packages/ansible/plugins/callback/default.py
>
> PLAYBOOK: vm-create-paramater.yml 
> ***
> Positional arguments: 
> /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml
> verbosity: 4
> remote_user: ansible
> connection: smart
> timeout: 10
> become_method: sudo
> tags: ('all',)
> inventory: ('/etc/ansible/hosts',)
> extra_vars: ('vm_name=VM-X  vm_ip=IP vcenter_name=DC-vc01.DOMAIN 
> vcenter_folder=DC-C-Infra vcenter_rp=DC-Prod vcenter_dc=DC 
> vcenter_cluster=DC-C-Cluster01 vcenter_template=DC-centos7-template-infra 
> vm_disk_size=101 vcenter_datastore=DATASTTORE vm_mem_mb_size=16384 
> vm_cpu_size=1 vm_core_size=1 vcenter_network=VLAN  vm_gateway=GW   
> vcenter_OS=CentOS7  vcenter_Location=DC  vcenter_LOB=Infra  
> vcenter_Environment=Test  vcenter_Application=test1',)
> forks: 5
> 1 plays in /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml
> Read vars_file '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
> Read vars_file '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
> Read vars_file '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>
> PLAY [localhost] 
> 
> META: ran handlers
> Read vars_file '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>
> TASK [set_fact] 
> *
> task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:9
> ok: [127.0.0.1] => {
> "ansible_facts": {
> "creationdate": "2021/03/08 00:24"
> },
> "changed": false
> }
> Read vars_file '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
> Read vars_file '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>
> TASK [create vm using template] 
> *
> task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:10
>  ESTABLISH LOCAL CONNECTION FOR USER: jenkins
>  EXEC /bin/sh -c 'echo ~jenkins && sleep 0'
>  EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146 
> `" && echo ansible-tmp-1615191883.6845832-75923982434146="` echo 
> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146 
> `" ) && sleep 0'
> <127.0.0.1> Attempting python interpreter discovery
>  EXEC /bin/sh -c 

Re: [ansible-project] vmware_guest - VM is created but the name "none"

2021-03-08 Thread esxi...@gmail.com
None o/p from Ubuntu20x box .. 



FYI same template... same vcenter .. same everything .. 


2.9.6 is ansible which comes with OS

on other node i did pip3 so version is 2.10 .. 


###


 ansible-playbook 
/etc/ansible/playbooks/vm-provision/vm-create-paramater.yml -f 5 
--extra-vars "vm_name=VM-X  vm_ip=IP vcenter_name=DC-vc01.DOMAIN 
vcenter_folder=DC-C-Infra vcenter_rp=DC-Prod vcenter_dc=DC 
vcenter_cluster=DC-C-Cluster01 vcenter_template=DC-centos7-template-infra 
vm_disk_size=101 vcenter_datastore=DATASTTORE vm_mem_mb_size=16384 
vm_cpu_size=1 vm_core_size=1 vcenter_network=VLAN  vm_gateway=GW   
vcenter_OS=CentOS7  vcenter_Location=DC  vcenter_LOB=Infra  
vcenter_Environment=Test  vcenter_Application=test1" -
ansible-playbook 2.9.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its 
verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its 
verify_file() method
Set default localhost to 127.0.0.1
Parsed /etc/ansible/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from 
/usr/lib/python3/dist-packages/ansible/plugins/callback/default.py

PLAYBOOK: vm-create-paramater.yml 
***
Positional arguments: 
/etc/ansible/playbooks/vm-provision/vm-create-paramater.yml
verbosity: 4
remote_user: ansible
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
extra_vars: ('vm_name=VM-X  vm_ip=IP vcenter_name=DC-vc01.DOMAIN 
vcenter_folder=DC-C-Infra vcenter_rp=DC-Prod vcenter_dc=DC 
vcenter_cluster=DC-C-Cluster01 vcenter_template=DC-centos7-template-infra 
vm_disk_size=101 vcenter_datastore=DATASTTORE vm_mem_mb_size=16384 
vm_cpu_size=1 vm_core_size=1 vcenter_network=VLAN  vm_gateway=GW   
vcenter_OS=CentOS7  vcenter_Location=DC  vcenter_LOB=Infra  
vcenter_Environment=Test  vcenter_Application=test1',)
forks: 5
1 plays in /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml
Read vars_file 
'/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
Read vars_file 
'/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
Read vars_file 
'/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'

PLAY [localhost] 

META: ran handlers
Read vars_file 
'/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'

TASK [set_fact] 
*
task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:9
ok: [127.0.0.1] => {
"ansible_facts": {
"creationdate": "2021/03/08 00:24"
},
"changed": false
}
Read vars_file 
'/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
Read vars_file 
'/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'

TASK [create vm using template] 
*
task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:10
 ESTABLISH LOCAL CONNECTION FOR USER: jenkins
 EXEC /bin/sh -c 'echo ~jenkins && sleep 0'
 EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
/var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146 
`" && echo ansible-tmp-1615191883.6845832-75923982434146="` echo 
/var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146 
`" ) && sleep 0'
<127.0.0.1> Attempting python interpreter discovery
 EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v 
'"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v 
'"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v 
'"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v 
'"'"'/usr/libexec/platform-python'"'"'; command -v 
'"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && 
sleep 0'
 EXEC /bin/sh -c '/usr/bin/python3 && sleep 0'
Using module file /usr/share/ansible/plugins/modules/vmware_guest.py
 PUT 
/var/lib/jenkins/.ansible/tmp/ansible-local-67106q_22c2sm/tmpodwpab23 TO 
/var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146/AnsiballZ_vmware_guest.py
 EXEC 

[ansible-project] Re: executable location = /usr/local/bin/ansible VS executable location = /bin/ansible

2021-03-08 Thread esxi...@gmail.com
I just added 1 more & it was good for me 

ln -s /usr/local/bin/ansible-playbook  /bin/ansible-playbook


On Monday, March 8, 2021 at 12:05:10 AM UTC-8 esxi...@gmail.com wrote:

>
> Hi Folks
>
> Anyone can suggest anything for below problem 
>
>
> For root user i see below for path :
>
> root: ~ $ # ansible --version
> ansible 2.10.6
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = ['/root/.ansible/plugins/modules', 
> '/usr/share/ansible/plugins/modules']
>   ansible python module location = 
> /usr/local/lib/python3.6/site-packages/ansible
>   executable location = /bin/ansible
>   python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 
> 20150623 (Red Hat 4.8.5-44)]
> root: ~ $ #
>
>
>
>
> On the same box for Jenkins user i see below 
>
>
>  ansible --version
> ansible 2.10.6
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = 
> ['/var/lib/jenkins/.ansible/plugins/modules', 
> '/usr/share/ansible/plugins/modules']
>   ansible python module location = 
> /usr/local/lib/python3.6/site-packages/ansible
>   executable location = /usr/local/bin/ansible
>   python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 
> 20150623 (Red Hat 4.8.5-44)]
>
>
>
>
> I think it is breaking stuff for me ... 
>
>
> So i did 
>
> ln -s /usr/local/bin/ansible /bin/ansible
>
> but still no luck 
>
>
> here is internally the issue is with Ansible jenkins plaugin .. 
>
> java.io.IOException: Cannot run program "ansible-playbook" (in directory 
> "/var/lib/jenkins/workspace/Project Create-VM-Paramater-new-V1"): error=2, 
> No such file or directory 
>
>
>
> 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/692e3078-0ee5-4f2d-9434-ed37eaa70a10n%40googlegroups.com.


[ansible-project] line-in-file . line update from a list of values

2021-03-08 Thread dudu.c...@gmail.com


Hi 

I’m using lineinfile to include new value inside a file

 

*Original line *

Kafka-list= kafka1:9092;kafka2:9092;kafka3:9092

I need to replace the value with parameters that are managed inside a 
configuration – I need to include all server hostname that are under 
kafka_server_details section 

 

The line format should be 
:;:; 
……

The list can include 1 or more servers

 

*Configuration File : *

kafka_server_details:
 - {ip: 1.1.1.1 , hostname: kafka1.cluster1.com }
 - {ip: 1.1.1.2 , hostname: kafka2.cluster1.com }
 - {ip: 1.1.1.3 , hostname: kafka3.cluster1.com }
kafka_port: 9092

 

 

*Playbook *
- name: Update flow.properties file
  lineinfile:
path: /opt/flow.properties
regexp: "{{ item.from }}"
line: "{{ item.replace_with }}"
  with_items:
 - { from: lab=, replace_with: lab=1 }
 - { from: Kafka-list=, replace_with: "Kafka-list= {{ 
kafka_server_details.hostname }}:{{ kafka_port }} ; {{ 
kafka_server_details.hostname }}:{{ kafka_port }} ; {{ 
kafka_server_details.hostname }}:{{ kafka_port }} ; " } 

 

-- 
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/5160269d-f999-4aef-86e3-45fe73995f39n%40googlegroups.com.


[ansible-project] executable location = /usr/local/bin/ansible VS executable location = /bin/ansible

2021-03-08 Thread esxi...@gmail.com

Hi Folks

Anyone can suggest anything for below problem 


For root user i see below for path :

root: ~ $ # ansible --version
ansible 2.10.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/usr/local/lib/python3.6/site-packages/ansible
  executable location = /bin/ansible
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-44)]
root: ~ $ #




On the same box for Jenkins user i see below 


 ansible --version
ansible 2.10.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = 
['/var/lib/jenkins/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-44)]




I think it is breaking stuff for me ... 


So i did 

ln -s /usr/local/bin/ansible /bin/ansible

but still no luck 


here is internally the issue is with Ansible jenkins plaugin .. 

java.io.IOException: Cannot run program "ansible-playbook" (in directory 
"/var/lib/jenkins/workspace/Project Create-VM-Paramater-new-V1"): error=2, 
No such file or directory 



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/74c8f99d-f65b-4fbe-935b-c353823e9821n%40googlegroups.com.


Re: [ansible-project] vmware_guest - VM is created but the name "none"

2021-03-08 Thread esxi...@gmail.com
Thanks will share momentarily 

On Sunday, March 7, 2021 at 11:04:09 PM UTC-8 dick@geant.org wrote:

> And a similar output of a successful attempt on your other control node?
>
> On Mon, 8 Mar 2021 at 07:29, esxi...@gmail.com  wrote:
>
>> Here is the output 
>>
>>
>> ansible-playbook 
>> /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml -f 5 
>> --extra-vars "vm_name=vm-name-XXX  vm_ip=IP vcenter_name=DC-vc01.DOMAIN 
>> vcenter_folder=DC-C-Infra vcenter_rp=DC-Prod vcenter_dc=DC 
>> vcenter_cluster=DC-C-Cluster01 vcenter_template=DC--TEMPLATE 
>> vm_disk_size=101 vcenter_datastore=DATSTORE vm_mem_mb_size=16384 
>> vm_cpu_size=1 vm_core_size=1 vcenter_network=VLAN  vm_gateway=GW   
>> vcenter_OS=CentOS7  vcenter_Location=DC  vcenter_LOB=Infra  
>> vcenter_Environment=Test  vcenter_Application=test1" -
>> ansible-playbook 2.9.6
>>   config file = /etc/ansible/ansible.cfg
>>   configured module search path = ['/usr/share/ansible/plugins/modules']
>>   ansible python module location = /usr/lib/python3/dist-packages/ansible
>>   executable location = /usr/bin/ansible-playbook
>>   python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
>> Using /etc/ansible/ansible.cfg as config file
>> setting up inventory plugins
>> host_list declined parsing /etc/ansible/hosts as it did not pass its 
>> verify_file() method
>> auto declined parsing /etc/ansible/hosts as it did not pass its 
>> verify_file() method
>> Parsed /etc/ansible/hosts inventory source with ini plugin
>> [WARNING]: provided hosts list is empty, only localhost is available. 
>> Note that the implicit localhost does not match 'all'
>> Loading callback plugin default of type stdout, v2.0 from 
>> /usr/lib/python3/dist-packages/ansible/plugins/callback/default.py
>>
>> PLAYBOOK: vm-create-paramater.yml 
>> ***
>> Positional arguments: 
>> /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml
>> verbosity: 4
>> remote_user: ansible
>> connection: smart
>> timeout: 10
>> become_method: sudo
>> tags: ('all',)
>> inventory: ('/etc/ansible/hosts',)
>> extra_vars: ('vm_name=vm-name-XXX  vm_ip=IP 
>> vcenter_name=DC-vc01.DOMAIN vcenter_folder=DC-C-Infra vcenter_rp=DC-Prod 
>> vcenter_dc=DC vcenter_cluster=DC-C-Cluster01 
>> vcenter_template=DC--TEMPLATE vm_disk_size=101 
>> vcenter_datastore=DATSTORE vm_mem_mb_size=16384 vm_cpu_size=1 
>> vm_core_size=1 vcenter_network=VLAN  vm_gateway=GW   
>> vcenter_OS=CentOS7  vcenter_Location=DC  vcenter_LOB=Infra  
>> vcenter_Environment=Test  vcenter_Application=test1',)
>> forks: 5
>> 1 plays in /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml
>> Read vars_file 
>> '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>> Read vars_file 
>> '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>> Read vars_file 
>> '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>>
>> PLAY [localhost] 
>> 
>> META: ran handlers
>> Read vars_file 
>> '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>>
>> TASK [set_fact] 
>> *
>> task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:9
>> ok: [localhost] => {
>> "ansible_facts": {
>> "creationdate": "2021/03/07 22:16"
>> },
>> "changed": false
>> }
>> Read vars_file 
>> '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
>>
>> TASK [create vm using template] 
>> *
>> task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:10
>> <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: jenkins
>> <127.0.0.1> EXEC /bin/sh -c 'echo ~jenkins && sleep 0'
>> <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
>> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755 
>> `" && echo ansible-tmp-1615184214.498803-105323394432755="` echo 
>> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755 
>> `" ) && sleep 0'
>> Using module file /usr/share/ansible/plugins/modules/vmware_guest.py
>> <127.0.0.1> PUT 
>> /var/lib/jenkins/.ansible/tmp/ansible-local-66186ul4257xf/tmp8ptpb1st TO 
>> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ_vmware_guest.py
>> <127.0.0.1> EXEC /bin/sh -c 'chmod u+x 
>> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/ 
>>