Hello, I tried to run this command below, I think there is problem in my environment (Centos 7.6)
Best Regards,
$ansible-playbook run.yml -e ansible_python_interpreter="/opt/rh/rh-python36/root/usr/bin/python"
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [vCloudDirectorAnsible] *********************************************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************************************
ok: [localhost]
PLAY [create vapp] *******************************************************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************************************
ok: [localhost]
TASK [vcd_vapp] **********************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.vcd_errors.VCDLoginError: Login failed for user None to org None
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File "/tmp/ansible_vcd_vapp_payload_t71vxoma/ansible_vcd_vapp_payload.zip/ansible/module_utils/vcd.py", line 43, in login\n File "/root/.local/lib/python3.6/site-packages/pyvcloud/vcd/client.py", line 613, in init\n if len(self._uri) > 0:\nTypeError: object of type 'NoneType' has no len()\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1548078426.93-222646917081201/AnsiballZ_vcd_vapp.py", line 113, in \n _ansiballz_main()\n File "/root/.ansible/tmp/ansible-tmp-1548078426.93-222646917081201/AnsiballZ_vcd_vapp.py", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/root/.ansible/tmp/ansible-tmp-1548078426.93-222646917081201/AnsiballZ_vcd_vapp.py", line 48, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File "/opt/rh/rh-python36/root/usr/lib64/python3.6/imp.py", line 235, in load_module\n return load_source(name, filename, file)\n File "/opt/rh/rh-python36/root/usr/lib64/python3.6/imp.py", line 170, in load_source\n module = _exec(spec, sys.modules[name])\n File "", line 618, in _exec\n File "", line 678, in exec_module\n File "", line 219, in _call_with_frames_removed\n File "/tmp/ansible_vcd_vapp_payload_t71vxoma/main.py", line 476, in \n File "/tmp/ansible_vcd_vapp_payload_t71vxoma/main.py", line 458, in main\n File "/tmp/ansible_vcd_vapp_payload_t71vxoma/main.py", line 216, in init\n File "/tmp/ansible_vcd_vapp_payload_t71vxoma/ansible_vcd_vapp_payload.zip/ansible/module_utils/vcd.py", line 31, in init\n File "/tmp/ansible_vcd_vapp_payload_t71vxoma/ansible_vcd_vapp_payload.zip/ansible/module_utils/vcd.py", line 49, in login\nansible.module_utils.vcd_errors.VCDLoginError: Login failed for user None to org None\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
to retry, use: --limit @/opt/ansible-module-vcloud-director/run.retry
PLAY RECAP ***************************************************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=1
$python --version
Python 3.6.3
$ansible --version
ansible 2.7.6
config file = /opt/ansible-module-vcloud-director/ansible.cfg
configured module search path = [u'/opt/ansible-module-vcloud-director/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
And I use this playbook:
more run.yml
-
name: vCloudDirectorAnsible
hosts: localhost
environment:
env_user: jenkins_user
env_password: jenkins-pass
env_host: https://api-3.vcloud.com/api
env_org: vdr_lab
env_api_version: 30.0
env_verify_ssl_certs: false
-
name: create vapp
hosts: localhost
tasks:
- vcd_vapp:
vapp_name: "test_vapp_ansible"
vdc: "OVDC_1"
state: "present"
register: output
- debug:
msg: '{{ output }}'