Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key_by erroring in oci_database_database #280

Open
rwagnergit opened this issue May 7, 2024 · 0 comments
Open

key_by erroring in oci_database_database #280

rwagnergit opened this issue May 7, 2024 · 0 comments

Comments

@rwagnergit
Copy link

Issue Report

Describe the issue

Trying to use key_by when calling oci_database_database to key on db_name and db_home_id (i.e., we only want one database with a given name in a given home). Playbook snippet:

- hosts: localhost
  collections:
    - oracle.oci
  connection: local
  tasks:
  - name: create
    oracle.oci.oci_database_database:
      compartment_id: '{{ compartment_ocid }}'
      db_home_id: '{{ oracle_home_ocid }}'
      key_by: [db_name, db_home_id]
      database:
        db_name: '{{ db_name }}'
        admin_password: '{{ admin_password }}'
        db_backup_config:
          auto_backup_enabled: false
    register: cdb_data

Expected behavior

Playbook should run without error.

Environment

  • OS version:
    [opc@odsa-management01 ~]$ cat /etc/oracle-release
    Oracle Linux Server release 8.8
    [opc@odsa-management01 ~]$ uname -a
    Linux odsa-management01 5.15.0-106.131.4.el8uek.x86_64 remove readme_1.md #2 SMP Fri Sep 22 16:00:58 PDT 2023 x86_64 x86_64 x86_64 GNU/Linux

  • Ansible version:

[opc@odsa-management01 ~]$ ansible --version
ansible [core 2.15.3]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/opc/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.11/site-packages/ansible
ansible collection location = /home/opc/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.11.5 (main, Nov 15 2023, 18:13:17) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20.0.1)] (/usr/bin/python3.11)
jinja version = 3.1.2
libyaml = True

  • OCI Python SDK version:

[opc@odsa-management01 ~]$ python -c "import oci;print(oci.version)"
2.93.1

  • OCI Ansible Modules version:

[opc@odsa-management01 ~]$ ansible-galaxy collection list

/home/opc/.ansible/collections/ansible_collections

Collection Version


oracle.oci 4.42.0

Ansible playbook to reproduce the issue

See above. When running as above:

TASK [create] ***************************************************************************************************
[WARNING]: ['db_name'] attributes are not supported by module for key_by keyword
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Getting resource failed with exception: pop expected at most 1 argument, got 2", "troubleshooting_tips": "Refer to troubleshooting guide https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/latest/guides/troubleshooting-guide.html"}

If I change key_by to:

key_by: [db_home_id]

Then I get:

TASK [create] ***************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Getting resource failed with exception: pop expected at most 1 argument, got 2", "troubleshooting_tips": "Refer to troubleshooting guide https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/latest/guides/troubleshooting-guide.html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant