HewlettPackard / oneview-ansible-collection

Ansible Collection and Sample Playbooks for HPE OneView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Certificates - Idempotency issue

ClaireHayard opened this issue · comments

Scenario/Intent

Hello,

I am adding multiple server certificates in OneView:
image
and it works fine. However when running the tasks a second time with the same certificates I still have changes.

main.yml

- name: Create a Server Certificate
  oneview_certificates_server:
    config: "{{ config }}"
    state: present
    name: "{{ item.aliasName }}"
    data:
      certificateDetails:
        - aliasName: "{{ item.aliasName }}"
          base64Data: "{{ item.base64Data }}"
  loop: "{{ certificates }}"

Example of input certificates:

    certificates:
        - aliasName: "test-certificate-2"
          base64Data: "-----BEGIN CERTIFICATE-----\n....\n-----END CERTIFICATE-----"
        - aliasName: "test-certificate"
          base64Data: "-----BEGIN CERTIFICATE-----\n....\n-----END CERTIFICATE-----"

Environment Details

  • OneView Ansible Collection: v6.6.0
  • OneView Appliance Version: 6.10
  • Ansible version: 2.9.6
  • Python version: 3.8.10

Expected Result

We have idempotency when we run the same playbook with the same certificate input data multiple times.

Actual Result

TASK [certificate : Create a Server Certificate] *******************************
changed: [localhost -> localhost] => (item={'aliasName': 'test-certificate', 'base64Data':

[...]

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

Hi Claire,

We are looking into this issue. We will get back on this with our findings.

Thanks,
Alisha

Hi Claire,

This issue is fixed. It will be available in release v7.1. Also, the same is now available in Master branch.