Skip to content

Instantly share code, notes, and snippets.

@omaciel
Last active November 12, 2020 07:13
Show Gist options
  • Save omaciel/554db7a82559000d5ec0bf629a13aef9 to your computer and use it in GitHub Desktop.
Save omaciel/554db7a82559000d5ec0bf629a13aef9 to your computer and use it in GitHub Desktop.

Register both Satellite and Capsule systems

Run these commands on both Satellite and Capsule systems to properly register them to CDN and to remove Beaker repositories (only needed for Red Hat QE folks)

export USER_NAME=""
export USER_PASSWORD=""
export POOLID=""
export ADMIN_USER="admin"
export ADMIN_PASSWORD="changeme"

# Remove Beaker repos
mv /etc/yum.repos.d/beaker* .

# Register and subscribe
subscription-manager register --force --username=${USER_NAME} --password=${USER_PASSWORD}
subscription-manager subscribe --pool ${POOLID}

# Disable anything that may have been auto-attached
subscription-manager repos --disable "*"

# Clean up repository information
yum clean all

Install a Satellite System

if uname -r | grep -q el6; then export OS_VERSION=6; else export OS_VERSION=7; fi

# Enable required repositories
subscription-manager repos --enable rhel-server-${OS_VERSION}-satellite-6-beta-rpms  --enable rhel-${OS_VERSION}-server-rpms --enable rhel-server-rhscl-${OS_VERSION}-rpms

# Check that you're using SELinux
setenforce 1

# Update the system first
yum update -y

# Install
yum install -y satellite

# Run the installer script
foreman-installer --scenario katello  -v --foreman-admin-password="changeme"

# Check that everything looks good
hammer -u ${ADMIN_USER} -p ${ADMIN_PASSWORD} ping

Install a Capsule System

if uname -r | grep -q el6; then export OS_VERSION=6; else export OS_VERSION=7; fi

# Enable required repositories
subscription-manager repos --enable rhel-server-${OS_VERSION}-satellite-capsule-6-beta-rpms  --enable rhel-${OS_VERSION}-server-rpms

# Check that you're using SELinux
setenforce 1

# Update the system first
yum update -y

# Install
yum install -y satellite-capsule

Assuming that MASTER_FQDN represents your Satellite 6 server and CAPSULE_FQDN is the system which you want to use as your capsule:

Server

Take special note of the output generated by capsule-certs-generate:

export MASTER_FQDN=$(hostname)
export CAPSULE_FQDN=$FQDN_FOR_YOUR_CAPSULE

capsule-certs-generate --capsule-fqdn $CAPSULE_FQDN --certs-tar ~/$CAPSULE_FQDN-certs.tar
scp /root/$CAPSULE_FQDN-certs.tar root@$CAPSULE_FQDN:.

Capsule

Run the following commands in your client:

export MASTER_FQDN=$FQDN_FOR_YOUR_SAT6_SERVER

rpm -Uvh http://$MASTER_FQDN/pub/katello-ca-consumer-latest.noarch.rpm
subscription-manager register --org Default_Organization --activationkey 'ak-capsule-6-server-64'
subscription-manager refresh
yum clean all && yum repolist
yum install -y satellite-capsule

Now, run the command generated by the output from the capsule-certs-generate command in the server. It should be something similar to:

foreman-installer --scenario capsule\
                    --parent-fqdn                         "${MASTER_FQDN}"\
                    --register-in-foreman                 "true"\
                    --foreman-base-url                    "https://${MASTER_FQDN{"\
                    --trusted-hosts                       "${MASTER_FQDN}"\
                    --trusted-hosts                       $(localhost)\
                    --oauth-consumer-key                  "shZTdZdJzhn8cAksGn2Dpji4EchrKLmF"\
                    --oauth-consumer-secret               "BWzd3Tch93rwH9JyJFRK7mv4cSBdBLDP"\
                    --pulp-oauth-secret                   "VEikbCF8dYDjNwNDnR8BDfngHdVqucU8"\
                    --certs-tar                           "/root/$(localhost)-certs.tar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment