SUSE Manager/Managing Oracle Linux

From MicroFocusInternationalWiki
Jump to: navigation, search

SUSE Manager Main Page

Native Oracle Linux (Traditional RHN stack)

1. Install spacewalk-utils on your SUMA server:

zypper in spacewalk-utils

Run the spacewalk-common-channels script to add base channel, Spacewalk client, and others as desired. Oracle includes all updates in their public yum

spacewalk-common-channels -v -a x86_64 oraclelinux7
spacewalk-common-channels -v -a x86_64 oraclelinux7-uek-r4
spacewalk-common-channels -v -a x86_64 spacewalk24-client-oraclelinux7

Manually sync the channels

spacewalk-repo-sync --channel=oraclelinux7-x86_64
spacewalk-repo-sync --channel=oraclelinux7-x86_64-uek-r4
spacewalk-repo-sync --channel=spacewalk24-client-oraclelinux7-x86_64

Use the Manage Software Channels->channel name->Repositories->Sync web interface to schedule regular sync if desired.

2. Be sure to copy any and all relevant GPG keys to /srv/www/htdocs/pub. This includes the Oracle key, Spacewalk key, SUSE keys and the Red Hat keys. By copying them there, you can reference them in a comma-delimited list in your bootstrap script (see example below)

 Oracle 7 key: http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7
 Spacewalk key: http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2015
 Red Hat keys: http://www.redhat.com/contact/security-response-team/gpg-keys.html

3. Create the ol7 bootstrap repository (we need jabberpy to install osad so pull it from the Oracle spacewalk repo)

mkdir -p /srv/www/htdocs/pub/repositories/ol7
cd /srv/www/htdocs/pub/repositories/ol7
wget -r -nH --cut-dirs=5 --no-parent --reject="index.html*" http://yum.spacewalkproject.org/2.4-client/RHEL/7/x86_64/
wget http://public-yum.oracle.com/repo/OracleLinux/OL7/spacewalk24/client/x86_64/getPackage/jabberpy-0.5-0.27.el7.noarch.rpm
createrepo .

4. Create a repo file "ol7-client.repo" in /srv/www/htdocs/pub/repositories/ol7

[ol7-client]
name=ol7-client
baseurl=http://<servername.fqdn>/pub/repositories/ol7
enabled=1
gpgcheck=0

5. Create an activation key for the channel e.g. 1-ol7-x64

6. Create/edit a bootstrap script to correctly reflect the following:

# NOTE: ACTIVATION_KEYS *must* be used to bootstrap a client machine.

ACTIVATION_KEYS=1-ol7-x64
ORG_GPG_KEY=RPM-GPG-KEY-oracle-ol7,RPM-GPG-KEY-redhat-release,RPM-GPG-KEY-spacewalk-2015,RPM-GPG-KEY-redhat-legacy-release,suse-307E3D54.key,suse-39DB7C82.key,suse-9C800ACA.key,res.key,res-gpg-pubkey-0182b964-4911a584.key,ptf-gpg-pubkey-b37b98a9-5328792f.key,RPM-GPG-KEY-redhat-legacy-former

FULLY_UPDATE_THIS_BOX=0

## Added to copy the repo file to the client so the prerequisites are in place for registration
curl -Sks http://<servername.fqdn>/pub/repositories/ol7/ol7-client.repo >> /etc/yum.repos.d/ol7-client.repo

yum clean all
# Install the required prerequisites
yum -y install yum-rhn-plugin rhn-setup osad jabberpy

Add this above "if [ $ALLOW_CONFIG_ACTIONS -eq 1 ] ; then"

## Will install rhncfg-actions, python-selinux, rhncfg and rhncfg-client to allow config actions and remote commands
if [ ! -x "/usr/bin/rhn-actions-control" ] ; then
        yum -y install rhncfg-actions
fi

Add these lines to the very bottom of your script, (just before echo “-bootstrap complete -” )

# clean up and run the rhnsd & osad services for real time updating
mv /etc/yum.repos.d/ol7-* /root/
yum clean all
chkconfig rhnsd on
chkconfig osad on
service rhnsd restart
/bin/systemctl restart  osad.service

7. Register the clients using the bootstrap script

curl -Sks https://<servername.fqdn>/pub/bootstrap/bootstrap-ol7-20170316.sh | /bin/bash