Bug 1956236

Summary: activation key creation does not work with simple content access
Product: Red Hat Satellite Reporter: Johannes Scheiber <jscheibe>
Component: Ansible CollectionAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0   
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-03 10:12:20 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:
Attachments:
Description Flags
extract from Satellite task List none

Description Johannes Scheiber 2021-05-03 09:26:04 UTC
Created attachment 1778873 [details]
extract from Satellite task List

Description of problem:
- If Simple Content Access (SCA) is enabled on the manifest, the creation of Activation Keys Ansible fails.
- If SCA is disabled it works as expected.
- In any of the cases the key is successfully created on Satellite (see screenshot)


Version-Release number of selected component (if applicable):
Red Hat Satellite Collection: 2.0.1
Red Hat Satellite: 6.9.1


How reproducible:
always if SCA is enabled
- enable simple content access
- try to create activation key


Steps to Reproduce:
example snippet:
=====%<-----------------
- name: "create ak-rhel8-lab activation keys"
  redhat.satellite.activation_key:
    organization: "{{ satellite_organization }}"
    server_url: "{{ satellite_url }}"
    username: "{{ satellite_username }}"
    password: "{{ satellite_password }}"
    name: "ak-rhel8-lab-dev"
    lifecycle_environment: "dev"
    content_view: 'ccv-rhel-8'
    host_collections:
        - rhel8
        - lab
    content_overrides:
        - label: "rhel-8-for-x86_64-baseos-rpms"
          override: enabled
        - label: "rhel-8-for-x86_64-appstream-rpms"
          override: enabled
        - label: "rhel-8-for-x86_64-baseos-kickstart"
          override: enabled
        - label: "rhel-8-for-x86_64-appstream-kickstart"
          override: enabled
        - label: "satellite-tools-6.8-for-rhel-8-x86_64-rpms"
          override: enabled
    state: present
-------->%==========

Actual results:

As you can see from the screenshot attached, each activation key creation was successful in Satellite itself, whereas Ansible returned with a fatal error:

- SCA enabled
TASK [sat-activation-keys : create ak-rhel8-lab activation keys] **************************************************************************************************************************************************
fatal: [sat.lab.scheibernet.de]: FAILED! => {"changed": false, "error": {"displayMessage": "The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled", "errors": ["The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled"]}, "msg": "Error while performing add_subscriptions on activation_keys: 400 Client Error: Bad Request"}

- SCA disabled:
TASK [sat-activation-keys : create ak-rhel8-lab activation keys] **************************************************************************************************************************************************
changed: [sat.lab.scheibernet.de]


Expected results:
On both cases the key should be created without the ansible script failing.

Comment 1 Johannes Scheiber 2021-05-03 10:12:20 UTC
Not a bug!
Tests have been done using the wrong set of scripts, thus everything is valid and working as expected