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-XXXXX vm_ip=IPXXXX 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=DATASTTOREXXXX vm_mem_mb_size=16384 vm_cpu_size=1 vm_core_size=1 vcenter_network=VLANXXXX vm_gateway=GWXXXX vcenter_OS=CentOS7 vcenter_Location=DC vcenter_LOB=Infra vcenter_Environment=Test vcenter_Application=test1" -vvvv
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-XXXXX vm_ip=IPXXXX 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=DATASTTOREXXXX vm_mem_mb_size=16384 vm_cpu_size=1 vm_core_size=1 vcenter_network=VLANXXXX vm_gateway=GWXXXX 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
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: jenkins
<localhost> EXEC /bin/sh -c 'echo ~jenkins && sleep 0'
<localhost> 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
<localhost> 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'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 && sleep 0'
Using module file /usr/share/ansible/plugins/modules/vmware_guest.py
<localhost> 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
<localhost> EXEC /bin/sh -c 'chmod u+x /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146/ /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146/AnsiballZ_vmware_guest.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146/AnsiballZ_vmware_guest.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191883.6845832-75923982434146/ > /dev/null 2>&1 && sleep 0'
changed: [127.0.0.1 -> localhost] => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3"
},
"changed": true,
"instance": {
"annotation": "Created On -2021/03/08 00:24",
"current_snapshot": null,
"customvalues": {},
"guest_consolidation_needed": false,
"guest_question": null,
"guest_tools_status": "guestToolsNotRunning",
"guest_tools_version": "11269",
"hw_cluster": "DC-C-Cluster01",
"hw_cores_per_socket": 1,
"hw_datastores": [
"DATASTTOREXXXX"
],
"hw_esxi_host": "DC-c-esx02.DOMAIN",
"hw_eth0": {
"addresstype": "assigned",
"ipaddresses": null,
"label": "Network adapter 1",
"macaddress": "00:50:56:a1:78:d2",
"macaddress_dash": "00-50-56-a1-78-d2",
"portgroup_key": null,
"portgroup_portkey": null,
"summary": "VLANXXXX"
},
"hw_files": [
"[DATASTTOREXXXX] VM-XXXXX/VM-XXXXX.vmx",
"[DATASTTOREXXXX] VM-XXXXX/VM-XXXXX.nvram",
"[DATASTTOREXXXX] VM-XXXXX/VM-XXXXX.vmsd",
"[DATASTTOREXXXX] VM-XXXXX/VM-XXXXX.vmdk"
],
"hw_folder": "/DC/vm/DC-C-Infra",
"hw_guest_full_name": null,
"hw_guest_ha_state": false,
"hw_guest_id": null,
"hw_interfaces": [
"eth0"
],
"hw_is_template": false,
"hw_memtotal_mb": 16384,
"hw_name": "VM-XXXXX",
"hw_power_status": "poweredOn",
"hw_processor_count": 1,
"hw_product_uuid": "42218606-c48c-676d-cecb-09f2a29977b1",
"hw_version": "vmx-15",
"instance_uuid": "50219592-a2cb-c618-4687-ddf3d65f3565",
"ipv4": null,
"ipv6": null,
"module_hw": true,
"moid": "vm-34134",
"snapshots": [],
"vimref": "vim.VirtualMachine:vm-34134",
"vnc": {}
},
"invocation": {
"module_args": {
"annotation": "Created On -2021/03/08 00:24",
"cdrom": [],
"cluster": "DC-C-Cluster01",
"convert": null,
"customization": {
"autologon": null,
"autologoncount": null,
"dns_servers": [
"DNSXXX",
"DNSXXXYY",
"DNSXXXYYZZZ"
],
"dns_suffix": null,
"domain": "DOMAIN",
"domainadmin": null,
"domainadminpassword": null,
"existing_vm": null,
"fullname": null,
"hostname": null,
"hwclockUTC": null,
"joindomain": null,
"joinworkgroup": null,
"orgname": null,
"password": null,
"productid": null,
"runonce": null,
"timezone": null
},
"customization_spec": null,
"customvalues": [],
"datacenter": "DC",
"datastore": null,
"delete_from_inventory": false,
"disk": [
{
"datastore": "DATASTTOREXXXX",
"name": "VM-XXXXX",
"name_match": "first",
"networks": [
{
"dns_servers": [
"DNSXXX",
"DNSXXXYY",
"DNSXXXYYZZZ"
],
"gateway": "GWXXXX",
"ip": "IPXXXX",
"name": "VLANXXXX",
"netmask": "255.255.255.0",
"start_connected": true,
"type": "static"
}
],
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"proxy_host": null,
"proxy_port": null,
"resource_pool": "DC-Prod",
"snapshot_src": null,
"state": "poweredon",
"state_change_timeout": 0,
"template": "DC-centos7-template-infra",
"use_instance_uuid": false,
"username": "ServiceACOyntXXX@DOMAIN",
"uuid": null,
"validate_certs": false,
"vapp_properties": [],
"wait_for_customization": false,
"wait_for_customization_timeout": 3600,
"wait_for_ip_address": false,
"wait_for_ip_address_timeout": 300
}
}
}
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 [Update tags] ******************************************************************************************************************************************************************
task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:62
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: jenkins
<localhost> EXEC /bin/sh -c 'echo ~jenkins && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191986.9253042-89528642566137 `" && echo ansible-tmp-1615191986.9253042-89528642566137="` echo /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191986.9253042-89528642566137 `" ) && sleep 0'
Using module file /usr/share/ansible/collections/ansible_collections/community/vmware/plugins/modules/vmware_guest_custom_attributes.py
<localhost> PUT /var/lib/jenkins/.ansible/tmp/ansible-local-67106q_22c2sm/tmpjormmqc7 TO /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191986.9253042-89528642566137/AnsiballZ_vmware_guest_custom_attributes.py
<localhost> EXEC /bin/sh -c 'chmod u+x /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191986.9253042-89528642566137/ /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191986.9253042-89528642566137/AnsiballZ_vmware_guest_custom_attributes.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191986.9253042-89528642566137/AnsiballZ_vmware_guest_custom_attributes.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191986.9253042-89528642566137/ > /dev/null 2>&1 && sleep 0'
changed: [127.0.0.1 -> localhost] => {
"changed": true,
"custom_attributes": {
"Application": "test1",
"Environment": "Test",
"LOB": "Infra",
"Location": "DC",
"OS": "CentOS7"
},
"invocation": {
"module_args": {
"attributes": [
{
"name": "OS",
"value": "CentOS7"
},
{
"name": "Location",
"value": "DC"
},
{
"name": "LOB",
"value": "Infra"
},
{
"name": "Environment",
"value": "Test"
},
{
"name": "Application",
"value": "test1"
}
],
"datacenter": null,
"folder": null,
"hostname": "DC-vc01.DOMAIN",
"moid": null,
"name": "VM-XXXXX",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"proxy_host": null,
"proxy_port": null,
"state": "present",
"use_instance_uuid": false,
"username": "ServiceACOyntXXX@DOMAIN",
"uuid": null,
"validate_certs": false
}
}
}
Read vars_file '/etc/ansible/playbooks/vm-provision/vars/vcenter-l2-admin.yml'
TASK [Update the Inventory] *********************************************************************************************************************************************************
task path: /etc/ansible/playbooks/vm-provision/vm-create-paramater.yml:83
<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-1615191987.9085515-87938918491772 `" && echo ansible-tmp-1615191987.9085515-87938918491772="` echo /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191987.9085515-87938918491772 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/files/ini_file.py
<127.0.0.1> PUT /var/lib/jenkins/.ansible/tmp/ansible-local-67106q_22c2sm/tmpdj1ftv5f TO /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191987.9085515-87938918491772/AnsiballZ_ini_file.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191987.9085515-87938918491772/ /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191987.9085515-87938918491772/AnsiballZ_ini_file.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191987.9085515-87938918491772/AnsiballZ_ini_file.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/lib/jenkins/.ansible/tmp/ansible-tmp-1615191987.9085515-87938918491772/ > /dev/null 2>&1 && sleep 0'
ok: [127.0.0.1] => {
"changed": false,
"diff": {
"after": "",
"after_header": "/etc/ansible/hosts (content)",
"before": "",
"before_header": "/etc/ansible/hosts (content)"
},
"gid": 133,
"group": "jenkins",
"invocation": {
"module_args": {
"allow_no_value": true,
"attributes": null,
"backup": false,
"content": null,
"create": true,
"delimiter": null,
"dest": "/etc/ansible/hosts",
"directory_mode": null,
"follow": false,
"force": null,
"group": null,
"mode": null,
"no_extra_spaces": false,
"option": "VM-XXXXX",
"owner": null,
"path": "/etc/ansible/hosts",
"regexp": null,
"remote_src": null,
"section": "infra",
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": null,
"state": "present",
"unsafe_writes": null,
"value": null
}
},
"mode": "0777",
"msg": "OK",
"owner": "jenkins",
"path": "/etc/ansible/hosts",
"size": 53,
"state": "file",
"uid": 127
}
META: ran handlers
META: ran handlers
PLAY RECAP **************************************************************************************************************************************************************************
127.0.0.1 : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0