This is an updated version of Satellite 6.6 Puppet & r10k to support the latest version of Red Hat Satellite (6.12+). While the Puppet features are no longer enabled by default, they are still available.
In earlier version of Satellite, Pulp was able to synchronize the Puppet modules to each of the Capsule servers. However, when Pulp 4 was released, that feature was lost. R10k is a pre-existing application that is capable of replacing that missing functionality and synchronize the Puppet modules from a git repo to each of the Capsule servers.
PuppetLab releases a module that can manage R10k, however, you need to initiate the process before it will become self-managing. This can be accomplished by manually completing a couple of the tasks that would normally be done by the module.
-
Ensure your branch names are based on your environment steps. This will typically mean renaming the
main
branch toproduction
-
Add
puppet-r10k
to thePuppetfile
within your git repoWithin your git repo, make sure there is a file named
Puppetfile
in the root and add the following linemod 'puppet-r10k', :latest
-
Install R10k on the Satellite server
puppetserver gem install r10k
WARNING
Do not usegem install r10k
. This will break Satellite as R10k depends on newer version of gems than what Satellite uses. Usingpuppetserver gem
will use the version ofgem
that is included with the puppet server and will keep Satellite from seeing the gems. This is similar to how system Python modules are stored separately from the global module store. -
Configure the r10k client by writing the following content to
/etc/puppetlabs/r10k/r10k.yaml
--- :cachedir: /opt/puppetlabs/puppet/cache/r10k :sources: *source_name*: basedir: /etc/puppetlabs/code/environments remote: *git_url* :pool_size: 16
*source_name*
is an arbitrary identifier for the source
*git_url*
is the url of your git repo. If you are syncing over ssh, the ssh key will be stored in theroot
user's account -
Run the initial sync as root
/opt/puppetlabs/puppet/bin/r10k deploy environment -p
-
Configure the R10k module within Satellite
- Connect to the Satellite web interface and browse to
Configure
->Classes
- Click
Import environment from *satellite_server*
- Select the environment that contains the
r10k
module and clickImport
- Click on
r10k
in the list of classes - Select the
Smart Class Paramter
tab - Select the parameter
include prerun command
, checkOverride
, and set theDefault Value
totrue
- Select the parameter
sources
, checkOverride
, and set theDefault Value
to the following:*source_name*: remote: *git_url* basedir: "/etc/puppetlabs/code/environments"
*source_name*
is an arbitrary identifier for the source
*git_url*
is the url of your git repo. If you are syncing over ssh, the ssh key will be stored in theroot
user's account - Click
Submit
- Connect to the Satellite web interface and browse to
-
Assign the class to the Satellite server and Capsule
- Connect to the Satellite web interface and browse to
Configure
->Host Groups
- If you do not already have a Host Group for your Satellite and Capsule servers, it is recommended to create one now
- Click on the Host Group for your Satellite and Capsule servers
- Select the
Puppet ENC
tab - Expand the
r10k
module and click on ther10k
class to assign it to the Host Group - Click Submit
- Connect to the Satellite web interface and browse to
-
You can now either wait up to 30 minutes for the Puppet agent to automatically run or run the command
puppet agent -t
on the Satellite server and Capsule servers to cause Puppet to run immediately.
As long as the Capsule servers are using the Satellite server as their Puppet Master, these tasks only need to be completed on the Satellite server. If the Capsule servers are using themselves as their Puppet Master, steps 3-5 will need to be run on the Capsule servers as well