Skip to content

Instantly share code, notes, and snippets.

@dudash
Last active October 25, 2018 17:03
Show Gist options
  • Save dudash/026ad9acc86e429b7b72273af878b028 to your computer and use it in GitHub Desktop.
Save dudash/026ad9acc86e429b7b72273af878b028 to your computer and use it in GitHub Desktop.
adhoc Ansible commands for switching Red Hat subscription pool for OpenShift

To switch your OCP subscription to a new one

Create an inventory (aka hosts) file

If you need help, see here

Run the following 4 adhoc Ansible commands

ansible -i hosts -m command -a "subscription-manager repos --disable '*'"
ansible -i hosts -m command -a "subscription-manager remove --all"
ansible -i hosts -m command -a "subscription-manager attach --pool NEW_POOL_ID"
ansible -i hosts -m command -a "subscription-manager repos --disable '*' \
    --enable='rhel-7-server-rpms' \
    --enable='rhel-7-server-extras-rpms' \
    --enable='rhel-7-server-ose-3.9-rpms' \
    --enable='rhel-7-fast-datapath-rpms' \
    --enable='rhel-7-server-ansible-2.4-rpms'" 

Example inventory file might look something like this:

[masters]
master1
master2
master3

[etcd:children]
masters

[infra]
infra1
infra2
infra3

[app_nodes]
app1
app2
app3

[OSEv3:children]
masters
infra
app_nodes
@dudash
Copy link
Author

dudash commented Oct 30, 2017

thanks @jaredhocutt

@dudash
Copy link
Author

dudash commented Aug 29, 2018

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