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

[management_certificate] dict is not subset because attribute 'certificate_config' is not in target dict #283

Open
xkoomy opened this issue May 15, 2024 · 0 comments

Comments

@xkoomy
Copy link

xkoomy commented May 15, 2024

Issue Report

Describe the issue

The module oracle.oci.oci_certificates_management_certificate having issue with idempotence. It always applies update even there are no changes in module config (and no changes in OCI resource). In result it creates a new certificate version after each playbook run.

Expected behavior

Update should not happen when there is no changes in oracle.oci.oci_certificates_management_certificate module config and no changes in the OCI resource.

Environment

  • OS version:

Red Hat Enterprise Linux release 8.8 (Ootpa)

  • Ansible version:
ansible [core 2.15.11]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/opc/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/opc/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/opc/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/opc/.local/bin/ansible
  python version = 3.9.16 (main, Jul  4 2023, 06:14:41) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18.0.2)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
  • OCI Python SDK version:

    2.126.3

  • OCI Ansible Modules version:

# /home/opc/.ansible/collections/ansible_collections
Collection                    Version
----------------------------- -------
oracle.oci                    5.0.0

Ansible playbook to reproduce the issue

---
- name: Create certificate Playbook
  hosts: localhost
  become: false
  gather_facts: false

  environment:
    OCI_USE_NAME_AS_IDENTIFIER: "1"

  tasks:
    - name: Create certificate from import
      oracle.oci.oci_certificates_management_certificate:
        # required
        name: tw_test_import
        compartment_id: "ocid1.compartment.oc1..**********************************"
        certificate_config:
          # required
          config_type: IMPORTED
          cert_chain_pem: "{{ lookup('ansible.builtin.file', 'cert/cert-chain.pem') }}"
          certificate_pem: "{{ lookup('ansible.builtin.file', 'cert/certificate.pem') }}"
          private_key_pem: "{{ lookup('ansible.builtin.file', 'cert/private.pem') }}"

        # optional
        description: description_example

Relevant Debug Logs:

"2024-05-15,08:57:15 DEBUG oci_common_utils.py:303 dict is not subset because attribute 'certificate_config' is not in target dict",
"2024-05-15,08:57:15 DEBUG oci_resource_utils.py:936 is update necessary for certificate: True"

Full debug log:
debug.log

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