How to automate content view publish and promote in Red Hat Satellite 6?
Environment
- Red Hat Satellite 6
Issue
- How to automatically publish and promote a content view?
Resolution
-
This is not a feature available in Red Hat Satellite 6 with no plans of implementing anything like it as seen in the feature request This content is not included.Bugzilla 1469248 that has been closed as wontfix.
-
Please note that Red Hat Support does not create or debug scripts for customers as mentioned in this article. The example below has been provided for information purposes only and may not achieve the end result required by all users.
-
As a workaround, hammer commands can be used in a script which can then be scheduled by cron.
-
For example, a new version of content view named
RHEL-Testshould be published on 1st of every month.* Find the ID of content view that needs a new version to be published ``` # hammer content-view list --organization "ExampleOrg" ``` * Assume the ID is 3, use this ID in the below syntax for the script ``` # hammer content-view publish --async --id <content_view_id> --organization <organization_name> ``` * The content of the script is as below ``` #!/bin/bash /usr/bin/hammer content-view publish --async --id 3 --organization "ExampleOrg" ```-
Save this file as hammer_cv_publish.sh
-
Next, schedule this script with cron to run on 1st of every month at 1 PM. What is cron and how is it used?
# crontab -e 00 13 1 * * /root/hammer_cv_publish.sh
-
-
For more KB articles/solutions related to Red Hat Satellite 6.x Content View Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Content View Issues
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.