Bug 2234444

Summary: redhat.satellite.content_view_publish role does not include option for adding additional comment and option for automatic promote to environments
Product: Red Hat Satellite Reporter: soham <smajumda>
Component: Ansible CollectionAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Griffin Sullivan <gsulliva>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.13.4CC: egolov, ehelms, gsulliva, pcreech, rlavi
Target Milestone: 6.14.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-collection-redhat-satellite-3.14.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:20: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:

Description soham 2023-08-24 12:50:01 UTC
Description of problem:
[RFE] redhat.satellite.content_view_publish role does not include option for adding additional comment and option for automatic promote to environments

These request has 2 parts:

1. Add option to add comments while publishing a cv

2. Add automatic promote options while publishing


Both of these options are available on web ui.


Business justification:

Its good to add the description feature available as supported feature of the module it is calling: https://console.redhat.com/ansible/automation-hub/repo/published/redhat/satellite/content/module/content_view_version/

Is this something you can add please? We like to link our publishes with a ticket ID.


Account Name	Synectics Solutions Ltd
Account Number	6171065

Comment 1 soham 2023-08-24 13:00:30 UTC
This seems to be already incorporated in https://github.com/RedHatSatellite/satellite-ansible-collection/blob/develop/roles/content_view_publish/tasks/main.yml#L10-L13


Noticed after opening the RFE.


-Soham

Comment 5 Griffin Sullivan 2023-09-05 16:07:16 UTC
FailedQA on 6.14 snap 14

I hit the following error during my test

TASK [redhat.satellite.content_view_publish : Publish content views] **************************************************************************************************************************
failed: [localhost] (item={'content_view': 'test', 'description': 'daily publish of test view', 'lifecycle_environments': ['testenv'], 'force_promote': True}) => {"ansible_loop_var": "content_view", "changed": false, "content_view": {"content_view": "test", "description": "daily publish of test view", "force_promote": true, "lifecycle_environments": ["testenv"]}, "msg": "The 'version' needs to be in the format 'X.Y', not 'daily publish of test view'"}

Comment 6 Evgeni Golov 2023-09-05 18:16:00 UTC
Griffin's fix was merged.

Comment 7 Patrick Creech 2023-09-06 19:52:05 UTC
https://github.com/RedHatSatellite/satellite-ansible-collection/releases/

Looks like we need a 3.14.0 in github

Comment 8 Evgeni Golov 2023-09-07 06:34:18 UTC
Yepp, that's why I only set "POST", there is no 3.14 release yet :)

(But I'll create one soon)

Comment 9 Evgeni Golov 2023-09-08 14:20:38 UTC
https://gitlab.cee.redhat.com/satellite/satellite-packaging/-/merge_requests/7465 has the changes you wanted!

Comment 10 Griffin Sullivan 2023-09-18 13:46:15 UTC
Verified in 6.14 snap 16

content_view_publish role allows description and promoting to lifecycle environments.

Steps to reproduce:

1) Create an empty lifecycle environment named testenv and empty CV named testview

2) Copy and run this playbook:

---
- hosts: localhost
  roles:
    - role: redhat.satellite.content_view_publish
      vars:
        satellite_server_url: https://satellite-server.url
        satellite_username: "admin"
        satellite_password: "changeme"
        satellite_organization: "Default Organization"
        satellite_content_views:
          - content_view: "testview"
            description: "A test content view"
            force_promote: True
            lifecycle_environments:
              - "testenv"

Result:

PLAY [localhost] ****************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************
ok: [localhost]

TASK [redhat.satellite.content_view_publish : Publish content views] ************************************************************************************************
changed: [localhost] => (item={'content_view': 'testview', 'description': 'A test content view', 'force_promote': True, 'lifecycle_environments': ['testenv']})

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

Comment 13 errata-xmlrpc 2023-11-08 14:20:20 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 (Important: Satellite 6.14 security and bug fix update), 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-2023:6818