Rocky Linux 9 is an open-source enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux (RHEL) 9.
Puppet r10k is a code management tool that allows you to manage your environment configurations, such as production, testing, and development, in a source control repository on your puppetmaster.
It is used to deploy Puppet environments and modules from a control repository, ensuring that each environment is updated as you update your control repository. It is provided by Puppetlabs, but not packaged with RPM. You need to use gem to install it.
In order to install R10k on Rocky 9, follow these steps:
sudo dnf groupinstall "Development Tools" -y
sudo dnf install -y ruby-devel gcc make cmake rpm-build
gem install r10k
sudo mkdir /etc/puppetlabs/r10k
sudo vi /etc/puppetlabs/r10/r10k.yaml
:cachedir: /var/cache/r10k
:sources:
:puppet:
remote: git@gitlab.example.net:path/to/repo.git
prefix: false
basedir: '/etc/puppetlabs/code/environments'
In order to access your puppet repositories in Gitlab, you need to have a deploy key enabled and the user running r10k on the puppetmaster using that key must at least once connect to gitlab using git and ssh, so the host key is added to the authorized hosts. Alternatively you can provide such file through puppet etc.
To synchronize your repos, a Puppetfile must exist in your main repo and you can then run
r10k deploy environment -pv