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

2021-03-09 Thread esxi...@gmail.com
Thanks, for now i will keep on hold on this very interesting problem as i 
have work-around with centos 7 

On Monday, March 8, 2021 at 1:05:38 AM UTC-8 dick@geant.org wrote:

> 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 
> 

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 

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/ 
>> 

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

2021-03-07 Thread Dick Visser
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/
> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ_vmware_guest.py
> && sleep 0'
> <127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3
> /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ_vmware_guest.py
> && sleep 0'
> 

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

2021-03-07 Thread esxi...@gmail.com
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/ 
/var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ_vmware_guest.py
 
&& sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 
/var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/AnsiballZ_vmware_guest.py
 
&& sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r 
/var/lib/jenkins/.ansible/tmp/ansible-tmp-1615184214.498803-105323394432755/ 
> /dev/null 2>&1 && sleep 0'
changed: [localhost] => {
"changed": true,
"instance": {
"annotation": "Created On -2021/03/07 22:16",

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

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

Well- /etc/ansible/playbooks/vm-provision/vars/var.yml in my case only 
has credentials 


All variables are passed with -e 

So i do not think the issue is with vars in this case 

ansible-playbook  
/etc/ansible/playbooks/vm-provision/vm-create-paramater.yml --extra-vars 
"vm_name=xxx xxx xxx " 


i will try run with - 


On Sunday, March 7, 2021 at 9:57:52 PM UTC-8 dick@geant.org wrote:

> The Linux distro on the control node is largely irrelevant. It's the way 
> you define the variables that is the problem.
> Add a debug task and check what does variables really are. 
> What is in that vars file? Typo? Etc etc 
>
> On Mon, 8 Mar 2021 at 04:57, esxi...@gmail.com  wrote:
>
>> Hi folks
>>
>> When i use below on a Ubuntu 20.04 ansible control node , vm is created 
>> but the OS name shows "none"
>>
>> Same playbook i am running on a CentOS7 ansible control node the then the 
>> vm name is not none but correct one
>>
>> Any suggestions on this Please ? 
>>
>> cat vm-create-paramater.yml
>> ---
>> - hosts: localhost
>>   gather_facts: false
>>   connection: local
>>   vars_files:
>> - /etc/ansible/playbooks/vm-provision/vars/var.yml
>>
>>   tasks:
>>
>> - name: create vm using template
>>   vmware_guest:
>> hostname: "{{ vcenter_name }}"
>> username: "{{ vcenter_username }}"
>> password: "{{ vcenter_password }}"
>> validate_certs: no
>> name: "{{ vm_name }}"
>> folder: "{{ vcenter_folder }}"
>> resource_pool: "{{ vcenter_rp }}"
>> datacenter: "{{ vcenter_dc }}"
>> cluster: "{{ vcenter_cluster }}"
>> state: poweredon
>> template: "{{ vcenter_template }}"
>> disk:
>> - size_gb: "{{ vm_disk_size }}"
>>   type: thin
>>   datastore: "{{ vcenter_datastore }}"
>> hardware:
>>   memory_mb: "{{ vm_mem_mb_size }}"
>>   num_cpus: "{{ vm_cpu_size }}"
>>   num_cpu_cores_per_socket: "{{ vm_core_size }}"
>>   scsi: paravirtual
>> networks:
>> - name: "{{ vcenter_network }}"
>>   ip: "{{ vm_ip }}"
>>   netmask: 255.255.255.0
>>   gateway: "{{ vm_gateway }}"
>>   start_connected: true
>>
>> customization:
>>   domain: xx
>>
>> 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-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/7d1f1dd3-accc-4dda-9548-21fe97d529d5n%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/79b24e6e-39bb-491b-b9cb-407fa29c0a95n%40googlegroups.com.


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

2021-03-07 Thread Dick Visser
The Linux distro on the control node is largely irrelevant. It's the way
you define the variables that is the problem.
Add a debug task and check what does variables really are.
What is in that vars file? Typo? Etc etc

On Mon, 8 Mar 2021 at 04:57, esxi...@gmail.com  wrote:

> Hi folks
>
> When i use below on a Ubuntu 20.04 ansible control node , vm is created
> but the OS name shows "none"
>
> Same playbook i am running on a CentOS7 ansible control node the then the
> vm name is not none but correct one
>
> Any suggestions on this Please ?
>
> cat vm-create-paramater.yml
> ---
> - hosts: localhost
>   gather_facts: false
>   connection: local
>   vars_files:
> - /etc/ansible/playbooks/vm-provision/vars/var.yml
>
>   tasks:
>
> - name: create vm using template
>   vmware_guest:
> hostname: "{{ vcenter_name }}"
> username: "{{ vcenter_username }}"
> password: "{{ vcenter_password }}"
> validate_certs: no
> name: "{{ vm_name }}"
> folder: "{{ vcenter_folder }}"
> resource_pool: "{{ vcenter_rp }}"
> datacenter: "{{ vcenter_dc }}"
> cluster: "{{ vcenter_cluster }}"
> state: poweredon
> template: "{{ vcenter_template }}"
> disk:
> - size_gb: "{{ vm_disk_size }}"
>   type: thin
>   datastore: "{{ vcenter_datastore }}"
> hardware:
>   memory_mb: "{{ vm_mem_mb_size }}"
>   num_cpus: "{{ vm_cpu_size }}"
>   num_cpu_cores_per_socket: "{{ vm_core_size }}"
>   scsi: paravirtual
> networks:
> - name: "{{ vcenter_network }}"
>   ip: "{{ vm_ip }}"
>   netmask: 255.255.255.0
>   gateway: "{{ vm_gateway }}"
>   start_connected: true
>
> customization:
>   domain: xx
>
> 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/7d1f1dd3-accc-4dda-9548-21fe97d529d5n%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/CAL8fbwM_vLhK2%3DunAFjHKUwuwxtViaoE_9t2gOakaOzSuQX3Nw%40mail.gmail.com.


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

2021-03-07 Thread esxi...@gmail.com
Hi folks

When i use below on a Ubuntu 20.04 ansible control node , vm is created but 
the OS name shows "none"

Same playbook i am running on a CentOS7 ansible control node the then the 
vm name is not none but correct one

Any suggestions on this Please ? 

cat vm-create-paramater.yml
---
- hosts: localhost
  gather_facts: false
  connection: local
  vars_files:
- /etc/ansible/playbooks/vm-provision/vars/var.yml

  tasks:

- name: create vm using template
  vmware_guest:
hostname: "{{ vcenter_name }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
name: "{{ vm_name }}"
folder: "{{ vcenter_folder }}"
resource_pool: "{{ vcenter_rp }}"
datacenter: "{{ vcenter_dc }}"
cluster: "{{ vcenter_cluster }}"
state: poweredon
template: "{{ vcenter_template }}"
disk:
- size_gb: "{{ vm_disk_size }}"
  type: thin
  datastore: "{{ vcenter_datastore }}"
hardware:
  memory_mb: "{{ vm_mem_mb_size }}"
  num_cpus: "{{ vm_cpu_size }}"
  num_cpu_cores_per_socket: "{{ vm_core_size }}"
  scsi: paravirtual
networks:
- name: "{{ vcenter_network }}"
  ip: "{{ vm_ip }}"
  netmask: 255.255.255.0
  gateway: "{{ vm_gateway }}"
  start_connected: true

customization:
  domain: xx

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/7d1f1dd3-accc-4dda-9548-21fe97d529d5n%40googlegroups.com.