Skip to content

Delete old CV versions#4869

Merged
maximiliankolb merged 5 commits into
theforeman:masterfrom
ATIX-AG:delete_old_cv_versions
Jun 5, 2026
Merged

Delete old CV versions#4869
maximiliankolb merged 5 commits into
theforeman:masterfrom
ATIX-AG:delete_old_cv_versions

Conversation

@maximiliankolb

Copy link
Copy Markdown
Contributor

What changes are you introducing?

Modules to delete old CV versions.

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

Response to https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian which I consider valuable feedback so I tested it (minus the Ansible stuff in a Playbook) and wrote some docs.

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

Contributor checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.19/Katello 4.21
  • Foreman 3.18/Katello 4.20 (Satellite 6.19)
  • Foreman 3.17/Katello 4.19
  • Foreman 3.16/Katello 4.18 (Satellite 6.18; orcharhino 7.6, 7.7, and 7.8)
  • Foreman 3.15/Katello 4.17
  • Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4; orcharhino 7.5)
  • Foreman 3.13/Katello 4.15 (EL9 only)
  • Foreman 3.12/Katello 4.14 (Satellite 6.16; orcharhino 7.2 on EL9 only; orcharhino 7.3)
  • We do not accept PRs for Foreman older than 3.12.

@github-actions github-actions Bot added Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective Needs testing Requires functional testing labels May 21, 2026
@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown

@maximiliankolb maximiliankolb left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremylenz Could you please check if this makes any sense to you? Are my assumptions about Katello orphan cleanup correct?

Comment thread guides/common/modules/con_content-view-version-cleanups.adoc Outdated
Comment thread guides/common/modules/proc_cleaning-up-content-view-versions-by-using-cli.adoc Outdated
Comment thread guides/common/modules/proc_cleaning-up-content-view-versions-by-using-cli.adoc Outdated

@jafiala jafiala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the Additional resources thing, LGTM

@jeremylenz

Copy link
Copy Markdown
Contributor

Are my assumptions about Katello orphan cleanup correct?

Tagging @sjha4 for review here, as he is more of a subject matter expert.

@Lennonka Lennonka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good draft. I have a couple of suggestions.

Comment thread guides/common/assembly_managing-content-views.adoc Outdated
Comment thread guides/common/modules/con_content-view-version-cleanups.adoc Outdated
Comment thread guides/common/modules/proc_cleaning-up-content-view-versions-by-using-cli.adoc Outdated
@pr-processor pr-processor Bot added the Waiting on contributor Requires an action from the author label May 25, 2026
@maximiliankolb maximiliankolb force-pushed the delete_old_cv_versions branch from 50d8cf4 to 0b6836e Compare June 1, 2026 13:33
@pr-processor pr-processor Bot added Needs re-review and removed Waiting on contributor Requires an action from the author labels Jun 1, 2026

@maximiliankolb maximiliankolb left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to HEAD of "master" and applied all suggestions.

Comment thread guides/common/modules/proc_cleaning-up-content-view-versions-by-using-cli.adoc Outdated
Comment thread guides/common/modules/proc_cleaning-up-content-view-versions-by-using-cli.adoc Outdated
Comment thread guides/common/modules/proc_cleaning-up-content-view-versions-by-using-cli.adoc Outdated
Comment thread guides/common/assembly_managing-content-views.adoc Outdated
Comment thread guides/common/modules/proc_purging-content-view-versions-by-using-cli.adoc Outdated
Comment thread guides/common/modules/proc_purging-content-view-versions-by-using-cli.adoc Outdated
@maximiliankolb maximiliankolb force-pushed the delete_old_cv_versions branch from 0b6836e to 7edb9a5 Compare June 2, 2026 06:05

@maximiliankolb maximiliankolb left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to HEAD of "master" and applied both suggestions.

Comment thread guides/common/modules/proc_purging-content-view-versions-by-using-cli.adoc Outdated
Comment thread guides/common/modules/proc_purging-content-view-versions-by-using-cli.adoc Outdated
Comment thread guides/common/modules/proc_purging-content-view-versions-by-using-cli.adoc Outdated
@maximiliankolb maximiliankolb force-pushed the delete_old_cv_versions branch from 7edb9a5 to 78aa8ec Compare June 2, 2026 13:26

@Lennonka Lennonka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two optional nitpicks, LGTM otherwise.

Comment thread guides/common/modules/proc_purging-content-view-versions-by-using-cli.adoc Outdated
@Lennonka Lennonka added style review done No issues from docs style/grammar perspective and removed Needs style review Requires a review from docs style/grammar perspective labels Jun 2, 2026
Suggested by Lena during review.
@maximiliankolb maximiliankolb force-pushed the delete_old_cv_versions branch from 78aa8ec to 7f4dbd3 Compare June 3, 2026 07:10
@maximiliankolb

Copy link
Copy Markdown
Contributor Author

@sjha4 Can you please do a tech review? I already tested the commands locally on Foreman 3.18/Katello 4.20.

@maximiliankolb maximiliankolb added testing done No issues from the functional perspective and removed Needs testing Requires functional testing labels Jun 3, 2026
@sjha4

sjha4 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Ack...Commands are correct.. 👍🏼

@Lennonka Lennonka added tech review done No issues from the technical perspective and removed Needs tech review Requires a review from the technical perspective labels Jun 3, 2026
@Lennonka

Lennonka commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

I'll review the abstracts in the scope of #4897, but we're good to merge.

@maximiliankolb maximiliankolb merged commit 8f70ca4 into theforeman:master Jun 5, 2026
11 checks passed
@maximiliankolb maximiliankolb deleted the delete_old_cv_versions branch June 5, 2026 05:56
maximiliankolb added a commit that referenced this pull request Jun 5, 2026
* Rename module to delete CV versions via WebUI

This patch is a prerequisite to adding a module for Hammer CLI.

$ rg -i "Deleting_Multiple_Content_View_Versions_"

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian

* Add module to delete CV versions via CLI

Tested on Foreman 3.18/Katello 4.20 with Hammer CLI katello 1.20.

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian

* Add module to delete CV versions via Ansible

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian
Refs https://theforeman.github.io/foreman-ansible-modules/latest/plugins/content_view_version_module.html#ansible-collections-theforeman-foreman-content-view-version-module

* Add module to purge content view versions

Tested on Foreman 3.18/Katello 4.20 with Hammer CLI katello 1.20.

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian

* Move deleting CV versions to end of assembly

Suggested by Lena during review.

(cherry picked from commit 8f70ca4)
maximiliankolb added a commit that referenced this pull request Jun 5, 2026
* Rename module to delete CV versions via WebUI

This patch is a prerequisite to adding a module for Hammer CLI.

$ rg -i "Deleting_Multiple_Content_View_Versions_"

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian

* Add module to delete CV versions via CLI

Tested on Foreman 3.18/Katello 4.20 with Hammer CLI katello 1.20.

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian

* Add module to delete CV versions via Ansible

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian
Refs https://theforeman.github.io/foreman-ansible-modules/latest/plugins/content_view_version_module.html#ansible-collections-theforeman-foreman-content-view-version-module

* Add module to purge content view versions

Tested on Foreman 3.18/Katello 4.20 with Hammer CLI katello 1.20.

Refs https://community.theforeman.org/t/quick-question-on-automating-the-removal-of-old-content-versions/46402?u=maximilian

* Move deleting CV versions to end of assembly

Suggested by Lena during review.

(cherry picked from commit 8f70ca4)
@maximiliankolb

Copy link
Copy Markdown
Contributor Author

Merged to "master" and cherry-picked:
bb44685..02c884b 3.19 -> 3.19
ce5b5d4..5c8ec59 3.18 -> 3.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

style review done No issues from docs style/grammar perspective tech review done No issues from the technical perspective testing done No issues from the functional perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants