Is it possible to import a manifest using the API?
I am trying to completely automate usage of Foreman + Katello and right now all I am missing is importing the manifest to get the RedHat Subscriptions in before provisioning.
Great thank you, was looking for an API with Manifest in it, didnât think about the Subscription one.
We are looking to automate the deployment of a 6 blade MEC platform with integrated switches. Would like the user to input itâs Manifest and then we would automate deployment of RHEL 8.3.
Thinking of using the API through âpython-foremanâ right now, but will look into the Ansible playbooks. Could use Python Ansible-Runner instead and script calls to hammer.
I feel like direct API calls is more straight forward, but using Ansible would make the actual calls run locally on the Foreman VM so that could provide useful from a namespace perspective accessing host network not available from the outside.
Well, Ansible can run anywhere, but also on the Foreman host, yeah.
If you want to use Python directly, have a look at apypie â thatâs the library we use for the Ansible modules. It simplifies building the requests to the API by parsing the published API docs on the Foreman server, instead of having an own copy of the allowed parameters/requests.
What is the sequence of events to get a Manifest tied to HostGroup?
Since the HostGroup references the ActivationKeys by name, if I already have a HostGroup expecting an ActivationKey âRHEL_8_3â, I suppose it would be:
Upload Manifest
Create ActivationKey with name âRHEL_8_3â and add repos from the Manifest
Would that be enough for the HostGroup to use that new Manifest to provision the hosts and activate/apply erratas.
I have it setup right now and working, but I am wondering if that would be the only 2 steps to change to a different Manifest.
Just asking in case you know, I will be trying it soon and will find out if itâs enough or not.
A manifest is just a certificate stating âyou have access to the following subscriptions and productsâ (and their quantities).
So after uploading a Manifest, you will have to do the following steps
enable one or multiple Red Hat repositories (in the UI, or the repository_set Ansible module/API)
sync those
create an activation key that either has the right subscriptions attached, or you use Simple Content Access (preferred these days)
create a HG and assign that AK there, plus the âDefault Organization Viewâ content view (or one that you have created).
I already have all of that setup and working, I have added RedHat repos and synced then, I have created Product, I have a Content View that is linked to my HostGroup and an ActivationKey referenced from my HostGroup.
What I want to do is delete the ActivationKey and the Manaifest and then get back to a working setup.
I just saw that the AK links to the ContentView, so I will need to know my ContentView ID when I recreate it.
Hopefully I donât need to change my HG if I use the same name for the new AK.