Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

oci_database_facts fails #82

Closed
tyskjohan opened this issue Oct 17, 2019 · 2 comments
Closed

oci_database_facts fails #82

tyskjohan opened this issue Oct 17, 2019 · 2 comments

Comments

@tyskjohan
Copy link
Contributor

tyskjohan commented Oct 17, 2019

Issue Report

$ ansible localhost -m oci_database_facts -a 'compartment_id="ocid1.compartment.oc1..aaaaaaaa3qohwg6pofoomybt7zdnsbpwrvhevr57hyps2fjzzzkm67tt5k5a" auth_type=instance_principal' -vvv
ansible 2.8.4
  config file = /home/opc/.ansible.cfg
  configured module search path = [u'/home/opc/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  7 2019, 08:19:52) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39.0.1)]
Using /home/opc/.ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
META: ran handlers
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: opc
<127.0.0.1> EXEC /bin/sh -c 'echo ~opc && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982 `" && echo ansible-tmp-1571343197.74-2731557860982="` echo /home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/oracle/oci_database_facts.py
<127.0.0.1> PUT /home/opc/.ansible/tmp/ansible-local-23824aeS1x_/tmpbxt8Vm TO /home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/ /home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py", line 114, in <module>
    _ansiballz_main()
  File "/home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py", line 106, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py", line 49, in invoke_module
    imp.load_module('__main__', mod, module, MOD_DESC)
  File "/tmp/ansible_oci_database_facts_payload_9LBv6X/__main__.py", line 259, in <module>
  File "/tmp/ansible_oci_database_facts_payload_9LBv6X/__main__.py", line 253, in main
  File "/tmp/ansible_oci_database_facts_payload_9LBv6X/__main__.py", line 217, in list_databases
UnboundLocalError: local variable 'existing_databases' referenced before assignment

localhost | FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py\", line 114, in <module>\n    _ansiballz_main()\n  File \"/home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py\", line 106, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/opc/.ansible/tmp/ansible-tmp-1571343197.74-2731557860982/AnsiballZ_oci_database_facts.py\", line 49, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_oci_database_facts_payload_9LBv6X/__main__.py\", line 259, in <module>\n  File \"/tmp/ansible_oci_database_facts_payload_9LBv6X/__main__.py\", line 253, in main\n  File \"/tmp/ansible_oci_database_facts_payload_9LBv6X/__main__.py\", line 217, in list_databases\nUnboundLocalError: local variable 'existing_databases' referenced before assignment\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

Expected behavior

List of databases returned.

Environment

  • OS version:

Oracle Linux Server release 7.7

  • Ansible version:
$ ansible --version
ansible 2.8.4
  config file = /home/opc/.ansible.cfg
  configured module search path = [u'/home/opc/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  7 2019, 08:19:52) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39.0.1)]
  • OCI Python SDK version:

2.6.1

  • OCI Ansible Modules version:

1.12.0

Ansible playbook to reproduce the issue

ansible localhost -m oci_database_facts -a 'compartment_id="ocid1.compartment.oc1..aaaaaaaa3qohwg6pofoomybt7zdnsbpwrvhevr57hyps2fjzzzkm67tt5k5a" auth_type=instance_principal' -vvv

@tyskjohan
Copy link
Contributor Author

Actually it's ,mostly about the lack of a useful error message when not enough parameters are given...

tyskjohan added a commit to tyskjohan/oci-ansible-modules that referenced this issue Oct 18, 2019
@nalsaber
Copy link
Member

Thanks for letting us know. We will update the error msg to be more clear in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants