Bug 1997724

Summary: Updating a hostgroup with AK via parameters fails if AK alredy exists
Product: Red Hat Satellite Reporter: Vladimír Sedmík <vsedmik>
Component: Ansible CollectionAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.10.0CC: egolov, zhunting
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-collection-redhat-satellite-2.2.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:13:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladimír Sedmík 2021-08-25 17:14:45 UTC
Description of problem:
When updating a hostgroup using this syntax

    - name: update hostgroup
      redhat.satellite.hostgroup:
        name: "HG1"
	...        
        parameters:
          - name: "kt_activation_keys"
            value: "AK_kt"

fails if an Actiantion Key is already present in the host group, breaking the idempotency.


Version-Release number of selected component (if applicable):
6.10.0 snap 14
ansible-collection-redhat-satellite-2.1.2-1


How reproducible:
always


Steps to Reproduce:
1. Run the playbook from the description twice


Actual results:
Second run will fail with error 
TASK [update hostgroup] *********************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "There are duplicate keys in 'parameters': set(['kt_activation_keys'])."}


Expected results:
Successful rerun


Additional info:
Already fixed in ansible-collection-redhat-satellite-2.2.0

Comment 4 errata-xmlrpc 2021-11-16 14:13:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702