<div dir="ltr"><div>Thank you so very much!</div><div><br></div><div>Since I have two types of clients, Ubuntu 16.04 and 18.04, do I need two different activation keys? I currently do have one setup.</div><div><br></div><div>Respectfully,</div><div><br></div><div>James</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--<br>--<br>James W. Krych<br>CCNP, CCNA, Net+, Security+, A+, Linux+<br>Mobile: 843-847-1446<br><a href="mailto:james.w.krych@gmail.com" target="_blank">james.w.krych@gmail.com</a><br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 29, 2019 at 2:07 PM Paul-Andre Panon <<a href="mailto:paul-andre.panon@avigilon.com">paul-andre.panon@avigilon.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 29 Jan 2019 13:22:30 -0500, James Krych <<a href="mailto:james.w.krych@gmail.com" target="_blank">james.w.krych@gmail.com</a>><br>
wrote:<br>
>>For Ubuntu / Debian, these default bootstrap scripts do not work. You<br>
have to create your own."<br>
<br>
>Is there a source of these scripts for use with Debian clients?<br>
<br>
>Very respectfully,<br>
<br>
>James<br>
<br>
We use something like the script below. You will want to adjust it for<br>
your environment. It has the advantage that you can use it on CentOS or<br>
Ubuntu clients, so you can just put it in /var/www/html/pub/ on your<br>
spacewalk server and have people download and run it.<br>
<br>
You will need to customize it to use your activation key names (and set up<br>
the activation keys to add your preferred channels for each distribution).<br>
It also needs a few more files set up on the spacewalk server in the<br>
/var/www/html/pub directory: the packages for Ubuntu 18.04 (in<br>
pub/bionic-debs), and a stub configuration file for the<br>
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1187189" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1187189</a> workaround. It might<br>
need a few more tweaks but it should be enough to get you started.<br>
<br>
#!/bin/bash<br>
#<br>
# Install the SpaceWalk client on three possible O/S targets, CentOS 7,<br>
Ubuntu 14.04, and Ubuntu 16.04<br>
# Register the client with the Avigilon Spacewalk server<br>
#<br>
spacewalkserver="yourspacewalkserver.yourdomain"<br>
<br>
install_centos7_client() {<br>
  echo Installing Spacewalk client for CentOS 7.X<br>
  rpm -Uvh<br>
<a href="http://yum.spacewalkproject.org/2.6-client/RHEL/7/x86_64/spacewalk-client-repo-2.6-0.el7.noarch.rpm" rel="noreferrer" target="_blank">http://yum.spacewalkproject.org/2.6-client/RHEL/7/x86_64/spacewalk-client-<br>
repo-2.6-0.el7.noarch.rpm</a><br>
  wget <a href="https://muug.ca/mirror/fedora-epel/RPM-GPG-KEY-EPEL-7" rel="noreferrer" target="_blank">https://muug.ca/mirror/fedora-epel/RPM-GPG-KEY-EPEL-7</a><br>
  rpm --import ./RPM-GPG-KEY-EPEL-7<br>
  BASEARCH=$(uname -i)<br>
  rpm -Uvh<br>
<a href="http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" rel="noreferrer" target="_blank">http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm</a><br>
  yum -y install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto<br>
yum-rhn-plugin<br>
  rpm -Uvh<br>
http://$spacewalkserver/pub/rhn-org-trusted-ssl-cert-1.0-2.noarch.rpm<br>
  rhnreg_ks --serverUrl=https://$spacewalkserver/XMLRPC<br>
--sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br>
--activationkey=1-centos7-x86_64<br>
  # enable osad<br>
  yum install osad<br>
  /bin/perl -pi -e "s/osa_ssl_cert =/osa_ssl_cert =<br>
\/usr\/share\/rhn\/RHN-ORG-TRUSTED-SSL-CERT/" /etc/sysconfig/rhn/osad.conf<br>
  /bin/systemctl enable osad<br>
  /bin/systemctl osad start<br>
  # enable openscap<br>
  yum install openscap-scanner spacewalk-oscap<br>
  wget<br>
<a href="https://copr-be.cloud.fedoraproject.org/results/openscapmaint/openscap-latest/epel-7-x86_64/00482175-scap-security-guide/scap-security-guide-0.1.31-2.el7.centos.noarch.rpm" rel="noreferrer" target="_blank">https://copr-be.cloud.fedoraproject.org/results/openscapmaint/openscap-lat<br>
est/epel-7-x86_64/00482175-scap-security-guide/scap-security-guide-0.1.31<br>
-2.el7.centos.noarch.rpm</a><br>
  rpm -ivh scap-security-guide-0.1.31-2.el7.centos.noarch.rpm<br>
  yum history sync<br>
}<br>
<br>
install_ubuntu14.04_client() {<br>
  echo Installing Spacewalk client for Ubuntu 14.04<br>
<br>
  if [ -n "`which rhnreg_ks`" ] ; then echo rhnreg_ks is already<br>
installed. Aborting; exit; fi<br>
<br>
  # Install some pre-requisites before our packages<br>
  apt-get -y install python-dbus python-newt python-dmidecode python-gudev<br>
python-dbus-dev python-support python-libxml2 python-gobject python-gi<br>
python-g object-2 python-ethtool python-jabber<br>
  apt-get -y install apt-transport-spacewalk python-rhn rhn-client-tools<br>
rhnsd<br>
  wget "https://$spacewalkserver/pub/spacewalk.gpg.pubkey"<br>
  apt-key add spacewalk.gpg.pubkey<br>
  # Now set up and register with our Spacewalk server<br>
  mkdir /var/lock/subsys<br>
  wget https://$spacewalkserver/pub/RHN-ORG-TRUSTED-SSL-CERT -O<br>
/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br>
  rhnreg_ks --force --serverUrl=https://$spacewalkserver/XMLRPC<br>
--sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br>
--activationkey=1-avo-ubuntu-trusty-key<br>
  # Take updates and security patches for main and universe from spacewalk<br>
  echo "deb spacewalk://$spacewalkserver/XMLRPC channels: main<br>
trusty-updates trusty-backports trusty-security" ><br>
/etc/apt/sources.list.d/spacewalk.list<br>
  cp /etc/apt/sources.list /etc/apt/sources.list.bak<br>
  # and not from the standard repositories<br>
  perl -pi -e 's/^deb([-src]*) (.*) trusty main/#deb$1 $2 trusty main/'<br>
/etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) trusty-updates ([m|u][^u])/#deb$1 $2<br>
trusty-updates $3/' /etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) trusty-security ([m|u][^u])/#deb$1 $2<br>
trusty-security $3/' /etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) trusty-backports/#deb$1 $2<br>
trusty-backports/' /etc/apt/sources.list<br>
<br>
  # Work around <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1187189" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1187189</a><br>
  wget https://$spacewalkserver/pub/49spacewalk-workaround -O<br>
/etc/apt/apt-conf.d/49spacewalk-workaround<br>
<br>
  # clean up and test<br>
  popd<br>
  rm -Rf /tmp/trusty-debs<br>
  apt-get update<br>
}<br>
<br>
install_ubuntu16.04_client() {<br>
  echo Installing Spacewalk client for Ubuntu 16.04<br>
  apt-get -y install apt-transport-spacewalk python-rhn python-ethtool<br>
rhnsd rhn-client-tools python-jabber<br>
  if [ `dpkg -l apt-transport-spacewalk  | wc -l` -lt 6 ]; then<br>
     echo "Could not download necessary prerequisites. Aborting"<br>
     exit<br>
  fi<br>
  wget https://$spacewalkserver/pub/RHN-ORG-TRUSTED-SSL-CERT -O<br>
/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br>
  rhnreg_ks --force --serverUrl=https://$spacewalkserver/XMLRPC<br>
--sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br>
--activationkey=1-avo-ubuntu-xenial-key<br>
  wget "https://$spacewalkserver/pub/spacewalk.gpg.pubkey"<br>
  apt-key add spacewalk.gpg.pubkey<br>
  # Take updates and security patches for main and universe from spacewalk<br>
  echo 'deb spacewalk://$spacewalkserver/XMLRPC channels: main<br>
xenial-updates xenial-backports xenial-security' ><br>
/etc/apt/sources.list.d/spacewalk.list<br>
  cp /etc/apt/sources.list /etc/apt/sources.list.bak<br>
  # and not from the standard repositories<br>
  perl -pi -e 's/^deb([-src]*) (.*) xenial main/#deb$1 $2 xenial main/'<br>
/etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) xenial-updates ([m|u][^u])/#deb $2<br>
xenial-updates $3/' /etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) xenial-security ([m|u][^u])/#deb$1 $2<br>
xenial-security $3/' /etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) xenial-backports/#deb$1 $2<br>
xenial-backports/' /etc/apt/sources.list<br>
<br>
  if [ ! -d /var/lib/up2date ]<br>
  then<br>
     mkdir /var/lib/up2date<br>
  fi<br>
<br>
  # Work around <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1187189" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1187189</a><br>
  wget https://$spacewalkserver/pub/49spacewalk-workaround -O<br>
/etc/apt/apt.conf.d/49spacewalk-workaround<br>
  # and test<br>
  apt-get update<br>
<br>
}<br>
<br>
install_ubuntu18.04_client() {<br>
<br>
  echo Installing Spacewalk client for Ubuntu 18.04<br>
<br>
  if [ -n "`which rhnreg_ks`" ] ; then echo rhnreg_ks is already<br>
installed. Aborting; exit; fi<br>
<br>
  # Install some pre-requisites before our packages<br>
  apt-get -y install gir1.2-gudev-1.0 libgudev-1.0-0 python-dbus<br>
python-newt python-dmidecode python-dbus-dev python-libxml2 python-gobject<br>
python-gi python-gobject-2 python-ethtool python-jabber python-apt<br>
python-openssl<br>
  apt-get -y -f install<br>
<br>
  # Download and install our spacewalk packages, which are newer than in<br>
the default 18.04 repo<br>
  mkdir /tmp/bionic-debs<br>
  pushd /tmp/bionic-debs<br>
  wget<br>
https://$spacewalkserver/pub/bionic-debs/apt-transport-spacewalk_1.0.7-1_a<br>
ll.deb<br>
  wget<br>
https://$spacewalkserver/pub/bionic-debs/python-gudev_147.2-3_amd64.deb<br>
  wget<br>
https://$spacewalkserver/pub/bionic-debs/python-rhn_2.5.72-1_all.deb<br>
  wget<br>
https://$spacewalkserver/pub/bionic-debs/<a href="http://rhn-client-tools_2.3.5-1_amd64.de" rel="noreferrer" target="_blank">rhn-client-tools_2.3.5-1_amd64.de</a><br>
b<br>
  wget https://$spacewalkserver/pub/bionic-debs/rhnsd_5.0.4-3_amd64.deb<br>
  wget<br>
https://$spacewalkserver/pub/bionic-debs/python-ethtool_0.12-1.1_amd64.deb<br>
  dpkg -i *.deb<br>
  apt-get -y -f install<br>
  wget "https://$spacewalkserver/pub/spacewalk.gpg.pubkey"<br>
  apt-key add spacewalk.gpg.pubkey<br>
<br>
  # Now set up and register with our Spacewalk server<br>
  mkdir /var/lock/subsys<br>
  wget https://$spacewalkserver/pub/RHN-ORG-TRUSTED-SSL-CERT -O<br>
/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br>
  rhnreg_ks --force --serverUrl=https://$spacewalkserver/XMLRPC<br>
--sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT<br>
--activationkey=1-avo-ubuntu-bionic-key<br>
  # Take updates and security patches for main and universe from spacewalk<br>
  echo "deb spacewalk://$spacewalkserver/XMLRPC channels: main<br>
bionic-updates bionic-backports bionic-security" ><br>
/etc/apt/sources.list.d/spacewalk.list<br>
  cp /etc/apt/sources.list /etc/apt/sources.list.bak<br>
  # and not from the standard repositories<br>
  perl -pi -e 's/^deb([-src]*) (.*) bionic main/#deb$1 $2 bionic main/'<br>
/etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) bionic-updates ([m|u][^u])/#deb$1 $2<br>
bionic-updates $3/' /etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) bionic-security ([m|u][^u])/#deb$1 $2<br>
bionic-security $3/' /etc/apt/sources.list<br>
  perl -pi -e 's/^deb([-src]*) (.*) bionic-backports/#deb$1 $2<br>
bionic-backports/' /etc/apt/sources.list<br>
<br>
  # Work around <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1187189" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1187189</a><br>
  wget https://$spacewalkserver/pub/49spacewalk-workaround -O<br>
/etc/apt/apt-conf.d/49spacewalk-workaround<br>
<br>
  # clean up and test<br>
  popd<br>
  rm -Rf /tmp/bionic-debs<br>
  apt-get update<br>
}<br>
<br>
<br>
if [ ! -d /usr/local/share/ca-certificates/york.lan ]<br>
then<br>
   mkdir -p /usr/local/share/ca-certificates/york.lan<br>
   wget -P /usr/local/share/ca-certificates/york.lan<br>
"https://$spacewalkserver/pub/cacerts/AVO-IssCA1.crt"<br>
--no-check-certificate<br>
   wget -P /usr/local/share/ca-certificates/york.lan<br>
"https://$spacewalkserver/pub/cacerts/AVO-IssCA2.crt"<br>
--no-check-certificate<br>
   wget -P /usr/local/share/ca-certificates/york.lan<br>
"https://$spacewalkserver/pub/cacerts/AVO-rootca.crt"<br>
--no-check-certificate<br>
   sudo update-ca-certificates<br>
fi<br>
<br>
if [ -n "`which rhnreg_ks`" ]<br>
then echo rhnreg_ks is already installed. Aborting<br>
     exit<br>
fi<br>
<br>
if [ -e /etc/centos-release ]<br>
then<br>
   CENTOS_RELEASE=`cat /etc/centos-release`<br>
   if [ "`expr substr \"$CENTOS_RELEASE\" 1 23`" = "CentOS Linux release<br>
7." ]<br>
   then install_centos7_client<br>
   fi<br>
elif [ -e `which lsb_release` ]<br>
then<br>
   OTHER_DISTRIB=`lsb_release -a | fgrep "Description:"`<br>
   if [ `expr match "$OTHER_DISTRIB" ".*Ubuntu.*"` -ge 6 ]<br>
   then<br>
      if [ `expr match "$OTHER_DISTRIB" ".*14\.04.*"` -ge 5 ]<br>
      then<br>
          install_ubuntu14.04_client<br>
      elif [ `expr match "$OTHER_DISTRIB" ".*16\.04.*"` -ge 5 ]<br>
      then<br>
          install_ubuntu16.04_client<br>
      elif [ `expr match "$OTHER_DISTRIB" ".*18\.04.*"` -ge 5 ]<br>
      then<br>
          install_ubuntu18.04_client<br>
      fi<br>
   fi<br>
fi<br>
<br>
_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com" target="_blank">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
</blockquote></div>