Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1875314

Summary: [RFE] Cannot delete content view due to associated environments
Product: Red Hat Satellite Reporter: Sam Wachira <swachira>
Component: Ansible CollectionAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: high    
Version: 6.7.0CC: bkearney, egolov, pdwyer, sokeeffe
Target Milestone: 6.9.0Keywords: FutureFeature, Reopened
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-collection-redhat-satellite-1.3.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:17:42 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:

Comment 1 Sean O'Keeffe 2020-09-08 15:38:46 UTC
You should be able to use the lifecycle_environment modules to first remove the Lifecycle Environment

https://cloud.redhat.com/ansible/automation-hub/redhat/satellite/content/module/lifecycle_environment

Comment 2 Evgeni Golov 2020-09-09 06:14:52 UTC
(In reply to Sean O'Keeffe from comment #1)
> You should be able to use the lifecycle_environment modules to first remove
> the Lifecycle Environment
> 
> https://cloud.redhat.com/ansible/automation-hub/redhat/satellite/content/
> module/lifecycle_environment

No, you can't

Comment 3 Evgeni Golov 2020-09-14 09:33:21 UTC
Just to make it more explicit:

Today, you *CAN* delete a CV version using the content_view_version module, *IF* that version is not part of any Lifecycle Environment at that moment.
So if you have the LCEs Library, Test and Prod, something like this would work:

- name: "Ensure CV version 2.0 is in all LCEs"
  content_view_version:
    content_view: "CV 1"
    version: "2.0"
    lifecycle_environments:
      - Library
      - Test
      - Pre Prod

- name: "Delete CV version 1"
  content_view_version:
    content_view: "CV 1"
    version: "1.0"
    state: absent

However, you can't completely delete a CV right now.

Comment 5 Peter Ondrejka 2020-12-10 16:52:15 UTC
Verified on Satellite 6.9 snap 5, CV is removed as expected even if published in a LCE

Comment 8 errata-xmlrpc 2021-04-21 13:17:42 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.9 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:1313