How to install and configure r10k in puppet

0 votes
I recently read about a Code management tool  r10k that helps in managing environment configurations related to different kind of environments that we can configure in Puppet such as development, testing, and production. How can I install and configure it?
Jul 29, 2019 in Puppet by Karan
• 19,610 points
3,412 views

1 answer to this question.

0 votes

In order to get the latest version, we will use rpm and rpm package manager to do the installation. 

Following is an example for the same.

$ urlgrabber -o /etc/yum.repos.d/timhughes-r10k-epel-6.repo
https://copr.fedoraproject.org/coprs/timhughes/yum -y install rubygem-r10k 

Configure environment in /etc/puppet/puppet.conf

[main] 
environmentpath = $confdir/environments 

Create a Configuration File for r10k Config:

cat <<EOF >/etc/r10k.yaml 
# The location to use for storing cached Git repos 
:cachedir: '/var/cache/r10k' 
# A list of git repositories to create 
:sources: 
# This will clone the git repository and instantiate an environment per 
# branch in /etc/puppet/environments 
:opstree: 
#remote: 'https://github.com/fullstack-puppet/fullstackpuppet-environment.git' 
remote: '/var/lib/git/fullstackpuppet-environment.git' 
basedir: '/etc/puppet/environments' 
EOF

Installing Puppet Manifest and Module:

r10k deploy environment -pv 

As we need to continue updating the environment in every 15 minutes, we will create a cron job for the same.

cat << EOF > /etc/cron.d/r10k.conf 
SHELL = /bin/bash 
PATH = /sbin:/bin:/usr/sbin:/usr/bin 
H/15 * * * * root r10k deploy environment -p 
EOF

You could test the installation as specified in the following  https://www.edureka.co/community/40554/confirm-r10k-installation-and-configuration?

answered Jul 29, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer

How to install a package in the slave node with Puppet ?

Hi@akhtar, You need to add your node definition ...READ MORE

answered Dec 31, 2020 in Puppet by MD
• 95,440 points
1,052 views
0 votes
1 answer
0 votes
1 answer

How to Install Puppet on CentOS?

You need two nodes for Puppet to ...READ MORE

answered Feb 27, 2019 in Puppet by Avinash
525 views
0 votes
1 answer

How do I install factor and puppet using Ruby Gem?

Hey @Kiara, execute these commands to install ...READ MORE

answered Mar 8, 2019 in Puppet by Yogesh
1,813 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,518 views
+2 votes
1 answer
0 votes
1 answer

What is PSON in puppet and how is it different from JSON?

PSON is a variant of JSON which ...READ MORE

answered Jul 24, 2019 in Puppet by Sirajul
• 59,230 points
1,996 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP