subscription_manager module

Posted on

Hi all,

Im trying to create one playbook to install X custom product from Red Hat Satellite.

To do this, i need to conver the following commands into a tasks:

subscription-manager attach --pool={{PRODUCT_POOL_ID}}
subscription-manager repos --enable={{PRODUCT_REPO_LABEL}}
yum install -y {{PRODUCT_PKG}}

But the product_pkg have dependencys from Red Hat extra rpms repository and when i use the collection 'community.general.redhat_subscription' to attach the pool id of the product, its remove all the previous pool attached on the system and only put the product's pool that i list on the task.

I search but i can not find any collection that give me the current pool id attached from the system.

The only thing that occurs to me so far is to use the 'shell' collection to execute the following command and be able to create a list with the current pool ids in order to be able to add the product pool to that list and when executing the task from subscription_manager, don't lose any pool id.

subscription-manager list --consumed |awk  '/Pool ID/{print $3}'

Maybe I'm doing things wrong trying to convert commands to tasks.

If anyone can enlighten me, I'd be very grateful!

From already thank you very much!

Greetings,
Lucas Jones

Responses