Hi all,
i´ve got problems running vmware_guest Module in AWX.
I´m also running a test-license for official tower where vmware_guest module is working as expected (same ansible and python version as awx system)
Running the playbook via commandline (without tower or awx) everything work fine! It also work via ansible tower.
Some Details:
System OS
(where here the Docker Engine is running: )
[root@test ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
Kernel:
[root@test ~]# uname -r
3.10.0-693.2.2.el7.x86_64
→ Also tried Kernel
Docker Version:
[root@test ~]# docker --version
Docker version 17.09.0-ce, build afdb6d4
Ansible Version:
[root@test ~]# ansible --version
ansible 2.3.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
Python-Version
[root@lvast-anto2 ~]# python --version
Python 2.7.5
AWX
https://github.com/ansible/awx/blob/devel/INSTALL.md
→ Configured via git clone. Just map playbook directory into docker container.
What i´ve already tested without any success:
Kernel Update to 4.13.5-1.el7.elrepo.x86_64 (still Centos7)
Change OS to Ubuntu 17.04 (kernel 4.10.0-19-generic)
Python Update to 3.6.3
Ansible Update to 2.4.0
TestPlaybook:
- hosts: all
name: TEST
tasks: - name: test_vm
vmware_guest:
hostname: “vCenterName”
name: “VMNAME”
password: “Password”
username: “loginname and domain”
datacenter: “ESXTEST”
state: “poweredon”
validate_certs: false
…
Inventory = Centos where the Docker Container are running
AWX Output (connection debug)
ansible-playbook 2.4.0.0
2
config file = /etc/ansible/ansible.cfg
3
configured module search path = [u’/var/lib/awx/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
4
ansible python module location = /usr/lib/python2.7/site-packages/ansible
5
executable location = /usr/bin/ansible-playbook
6
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
7
Using /etc/ansible/ansible.cfg as config file
8
SSH password:
9
setting up inventory plugins
10
Parsed /usr/lib/python2.7/site-packages/awx/plugins/inventory/awxrest.py inventory source with script plugin
11
Loading callback plugin awx_display of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/init.pyc
12
13
PLAYBOOK: control_vm_commandline_test.yml **************************************
14
1 plays in control_vm_commandline_test.yml
15
16
PLAY [TEST] ********************************************************************10:47:18
17
18
TASK [Gathering Facts] *********************************************************10:47:18
19
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
20
ESTABLISH SSH CONNECTION FOR USER: root
21
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r lvast-anto2 ‘/bin/sh -c ‘"’“‘echo ~ && sleep 0’”’“‘’
22
(0, ‘/root\n’, 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket “/tmp/awx_109__bq_ml/cp/lvast-anto222root” does not exist\r\ndebug2: resolving “lvast-anto2” port 22\r\ndebug2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to lvast-anto2 [10.50.100.92] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: permanently_set_uid: 0/0\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /root/.ssh/id_rsa type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /root/.ssh/id_rsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /root/.ssh/id_dsa type -1\r\ndebug1: key_load_public: No …
23
ESTABLISH SSH CONNECTION FOR USER: root
24
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r lvast-anto2 '/bin/sh -c '”‘"’( umask 77 && mkdir -p “echo /root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208
” && echo ansible-tmp-1507798039.1-212401339719208=“echo /root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208
” ) && sleep 0’“'”‘’
25
(0, ‘ansible-tmp-1507798039.1-212401339719208=/root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208\n’, ‘OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
26
PUT /tmp/tmpbQ8n0d TO /root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208/setup.py
27
SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r ‘[lvast-anto2]’
28
(0, ‘sftp> put /tmp/tmpbQ8n0d /root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208/setup.py\n’, ‘OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension “posix-rename@openssh.com” revision 1\r\ndebug2: Server supports extension “statvfs@openssh.com” revision 2\r\ndebug2: Server supports extension “fstatvfs@openssh.com” revision 2\r\ndebug2: S…
29
ESTABLISH SSH CONNECTION FOR USER: root
30
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r lvast-anto2 ‘/bin/sh -c ‘"’“‘chmod u+x /root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208/ /root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208/setup.py && sleep 0’”’"’’
31
(0, ‘’, ‘OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for \r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
32
ESTABLISH SSH CONNECTION FOR USER: root
33
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r -tt lvast-anto2 ‘/bin/sh -c ‘"’"’/usr/bin/python /root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208/setup.py; rm -rf “/root/.ansible/tmp/ansible-tmp-1507798039.1-212401339719208/” > /dev/null 2>&1 && sleep 0’“'”‘’
34
(0, '\r\n{“invocation”: {“module_args”: {“filter”: "“, “gather_subset”: [“all”], “fact_path”: “/etc/ansible/facts.d”, “gather_timeout”: 10}}, “ansible_facts”: {“module_setup”: true, “ansible_distribution_version”: “7.4.1708”, “ansible_distribution_file_variety”: “RedHat”, “ansible_env”: {“LANG”: “en_US.UTF-8”, “LC_ALL”: “en_US.UTF-8”, “SHELL”: “/bin/bash”, “XDG_RUNTIME_DIR”: “/run/user/0”, “LANGUAGE”: “en_US.UTF-8”, “SHLVL”: “2”, “SSH_TTY”: “/dev/pts/3”, “HOME”: “/root”, “_”: “/usr/bin/python”, “LC_CTYPE”: “en_US.UTF-8”, “LESSOPEN”: “||/usr/bin/lesspipe.sh %s”, “PWD”: “/root”, “LOGNAME”: “root”, “USER”: “root”, “PATH”: “/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin”, “MAIL”: “/var/mail/root”, “LS_COLORS”: “”, “XDG_SESSION_ID”: “1693”, “SSH_CLIENT”: “172.17.0.6 40364 22”, “SSH_CONNECTION”: “172.17.0.6 40364 10.50.100.92 22”}, “ansible_userspace_bits”: “64”, “ansible_architecture”: “x86_64”, “ansible_default_ipv4”: {“macaddress”: “00:50:56:ab:55:b7”, “network”: “10.50.0.0”, “mtu”: 150…
35
ok: [lvast-anto2]
36
META: ran handlers
37
38
TASK [reboot vm] ***************************************************************10:47:21
39
task path: /var/lib/awx/projects/vmware/control_vm_commandline_test.yml:510:47:21
40
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_guest.py
41
ESTABLISH SSH CONNECTION FOR USER: root
42
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r lvast-anto2 '/bin/sh -c '”’“‘echo ~ && sleep 0’”‘"’’
43
(0, ‘/root\n’, ‘OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
44
ESTABLISH SSH CONNECTION FOR USER: root
45
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r lvast-anto2 ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “echo /root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631
” && echo ansible-tmp-1507798041.51-240959622843631=“echo /root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631
” ) && sleep 0’“'”‘’
46
(0, ‘ansible-tmp-1507798041.51-240959622843631=/root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631\n’, ‘OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
47
PUT /tmp/tmpJC_XAo TO /root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631/vmware_guest.py
48
SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r ‘[lvast-anto2]’
49
(0, ‘sftp> put /tmp/tmpJC_XAo /root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631/vmware_guest.py\n’, ‘OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension “posix-rename@openssh.com” revision 1\r\ndebug2: Server supports extension “statvfs@openssh.com” revision 2\r\ndebug2: Server supports extension “fstatvfs@openssh.com” revision 2\r\nd…
50
ESTABLISH SSH CONNECTION FOR USER: root
51
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r lvast-anto2 ‘/bin/sh -c ‘"’“‘chmod u+x /root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631/ /root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631/vmware_guest.py && sleep 0’”’"’’
52
(0, ‘’, ‘OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
53
ESTABLISH SSH CONNECTION FOR USER: root
54
SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=root -o ConnectTimeout=10 -o ControlPath=/tmp/awx_109__bq_ml/cp/%h%p%r -tt lvast-anto2 ‘/bin/sh -c ‘"’"’/usr/bin/python /root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631/vmware_guest.py; rm -rf “/root/.ansible/tmp/ansible-tmp-1507798041.51-240959622843631/” > /dev/null 2>&1 && sleep 0’“'”‘’
55
(0, ‘Traceback (most recent call last):\r\n File “/tmp/ansible_P0OklM/ansible_module_vmware_guest.py”, line 1503, in \r\n main()\r\n File “/tmp/ansible_P0OklM/ansible_module_vmware_guest.py”, line 1494, in main\r\n result = pyv.deploy_vm()\r\n File “/tmp/ansible_P0OklM/ansible_module_vmware_guest.py”, line 1189, in deploy_vm\r\n dcpath = compile_folder_path_for_object(datacenter)\r\n File “/tmp/ansible_P0OklM/ansible_modlib.zip/ansible/module_utils/vmware.py”, line 237, in compile_folder_path_for_object\r\nAttributeError: 'NoneType' object has no attribute 'name'\r\n’, 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_requ…
56
fatal: [lvast-anto2]: FAILED! => {
57
“changed”: false,
58
“failed”: true,
59
“module_stderr”: “OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to lvast-anto2 closed.\r\n”,
60
“module_stdout”: "Traceback (most recent call last):\r\n …
64
65
PLAY RECAP *********************************************************************10:47:23
66
lvast-anto2 : ok=1 changed=0 unreachable=0 failed=1
67
Json Output
{
“_ansible_parsed”: false,
“_ansible_no_log”: false,
“module_stderr”: “OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 4770\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to lvast-anto2 closed.\r\n”,
“changed”: false,
“module_stdout”: “Traceback (most recent call last):\r\n File "/tmp/ansible_P0OklM/ansible_module_vmware_guest.py", line 1503, in \r\n main()\r\n File "/tmp/ansible_P0OklM/ansible_module_vmware_guest.py", line 1494, in main\r\n result = pyv.deploy_vm()\r\n File "/tmp/ansible_P0OklM/ansible_module_vmware_guest.py", line 1189, in deploy_vm\r\n dcpath = compile_folder_path_for_object(datacenter)\r\n File "/tmp/ansible_P0OklM/ansible_modlib.zip/ansible/module_utils/vmware.py", line 237, in compile_folder_path_for_object\r\nAttributeError: ‘NoneType’ object has no attribute ‘name’\r\n”,
“failed”: true,
“rc”: 0,
“msg”: “MODULE FAILURE”
}
Does somebdoy has any idea how to fix?
Kind regards,
Christian