Monthly Archives: September 2014

Solve “unable to find provision template for” in Satellite 6.0

One of the tricky parts of Satellite 6.0 is that there’s not so much information about it yet.

Last day I was facing this issue:

# tail /var/log/foreman/production.log
Processing by UnattendedController#provision as */*
  Parameters: {"token"=>"2cef5164-592e-4a2b-b476-b5b48dc519e9"}
Remove puppet certificate for
Adding autosign entry for
unable to find provision template for [] running [RedHat 6.5]
  Rendered text template (0.0ms)
Completed 404 Not Found in 1440ms (Views: 0.5ms | ActiveRecord: 4.2ms)

And once I was deploying a new server via PXE I could see a 404 request in Apache:

# tail /var/log/httpd/foreman_access.log - - [24/Sep/2014:21:40:53 +0000] "GET /unattended/provision?token=2cef5164-592e-4a2b-b476-b5b48dc519e9 HTTP/1.1" 404 77 "-" "anaconda/13.21.215"

And from server side I could only see that PXE was fine as it was booting but dracut was just timing out due to this 404.

So after some debugging I’ve noticed that I didn’t have any provision template for my OS, but Satellite 6.0 wasn’t complaining about it, so here’s a snippet that could help you out setting PXE/Provision template to a OS:

PXEID=$(hammer --csv template list | grep 'Kickstart default PXELinux' | awk -F, {'print $1'})
SATID=$(hammer --csv template list | grep 'Satellite Kickstart Default' | awk -F, {'print $1'})
for i in $(hammer --csv os list | awk -F, {'print $1'} | grep -vi '^ID')
    hammer template add-operatingsystem --id="${PXEID}" --operatingsystem-id="${i}"
    hammer os set-default-template --id="${i}" --config-template-id="${PXEID}"
    hammer os add-config-template --id="${i}" --config-template-id="${SATID}"
    hammer os set-default-template --id="${i}" --config-template-id="${SATID}"

Enable tftp smart proxy on Red Hat Satellite Capsule Server 6.0

Adding TFTP Smart Proxy:

  # katello-installer --capsule-tftp=true
  # systemctl restart foreman
  # systemctl restart foreman-proxy

Enable UDP port for TFTP:

  # firewall-cmd --permanent --zone=public --add-service=tftp
  # systemct restart firewalld

Refreshing features from our Capsule Server:

  # for i in $(hammer --csv capsule list | awk -F, {'print $1'} | grep -v ^Id); do hammer proxy refresh-features --id=${i}; done

Now if we want to deploy a server via PXE we need to configure a few more options like domain, subnet, etc.

Let’s see it another day.

How to install Red Hat Satellite 6.0 with RHEL7 in disconnected mode

In order to install RHS6, first of all we mount our satellite iso:

  # mkdir /root/rhs6
  # mount -o loop satellite-6.0.4-rhel-7-x86_64-dvd.iso /root/rhs6

And as we’re in a disconnected mode, we don’t have access to Red Hat Software Collections and RHS6 depends on ruby193. As the installer doesn’t do it automatically, we create a local repo for it.
It would be nice to report it to RH but I’m lazy 🙂

   # cat /etc/yum.repos.d/rhel7rhscl.repo
   name = RHEL7 RHSCL
   baseurl = file:///root/rhs6/RHCSL/
   enabled = 1

And then we can proceed to install RHS6 and configure it:

  # cd /root/rhs6
  # ./install_packages
  # katello-installer
  * Katello is running at https://xxxx
      Initial credentials are admin / xxxxx
  * Capsule is running at https://xxxx:9090
  * To install additional capsule on separate machine continue by running:"
      capsule-certs-generate --capsule-fqdn "$CAPSULE" --certs-tar "~/$CAPSULE-certs.tar"
  The full log is at /var/log/katello-installer/katello-installer.log

And then we need to open some ports in order to make everything work:

  # firewall-cmd --permanent --zone=public --add-service=http
  # firewall-cmd --permanent --zone=public --add-service=https
  # firewall-cmd --permanent --zone=public --add-port=5671/tcp
  # firewall-cmd --permanent --zone=public --add-port=8080/tcp
  # firewall-cmd --permanent --zone=public --add-port=8140/tcp
  # firewall-cmd --permanent --zone=public --add-port=9090/tcp
  # firewall-cmd --permanent --zone=public --add-port=9200/tcp
  # systemctl reload firewalld

As a first step you can login to RHS through its web interface using admin as user and the autogenerated password that katello-installer provided us:

* https://xxxx


DNF (Experimental Yum Replacement)

In order to test DNF (Dandified Yum) we can follow these steps:

# yum install -y dnf
# dnf install fedora-release-rawhide
# dnf upgrade --enablerepo=rawhide
# cat /etc/fedora-release 
Fedora release 22 (Rawhide)

Take into account that this also will upgrade our machine to Fedora Rawhide.

As a command reference it’s almost equal to yum syntaxis:

List of Main Commands

check-update              Check for available package upgrades
clean                     Remove cached data
distro-sync               Synchronize installed packages to the latest available versions
downgrade                 downgrade a package
erase                     Remove a package or packages from your system
group                     Display, or use, the groups information
help                      Display a helpful usage message
history                   Display, or use, the transaction history
info                      Display details about a package or group of packages
install                   Install a package or packages on your system
list                      List a package or groups of packages
makecache                 Generate the metadata cache
provides                  Find what package provides the given value
reinstall                 reinstall a package
repolist                  Display the configured software repositories
repository-packages       Run commands on top of all packages in given repository
search                    Search package details for the given string
updateinfo                Display advisories about packages
upgrade                   Upgrade a package or packages on your system
upgrade-to                Upgrade a package on your system to the specified version

Eudyptula Challenge completed

No updates means that I was busy 🙂

So finally I got to finish Eudyptula challenge and I would like to recommend you once again to try it and finish it.

I’ve learned so many things about the kernel that without the “guidance” of little I wouldn’t be aware of.

And if you’re curious that’s a quote from little:

Very nice job, you are now done!

If you were curious, you are the 50th person to complete the series of tasks, with over 7100 people currently attempting it. It’s not a race, but you’ve done a great job.