Puppet 4.5 and git & R10K

207 views
Skip to first unread message

Alex Samad

unread,
May 31, 2016, 6:40:49 AM5/31/16
to Puppet Users
Hi

New install, I am doing this on Centos 6.x
I have installed the repo RPM

I believe this is PC1 repo


yum --disablerepo '*' --enablerepo puppetlabs-pc1 list | grep puppetlabs-pc1
puppet-agent.x86_64                  1.5.0-1.el6                @puppetlabs-pc1
puppetdb.noarch                      4.1.0-1.el6                @puppetlabs-pc1
puppetdb-termini.noarch              4.1.0-1.el6                @puppetlabs-pc1
puppetserver.noarch                  2.4.0-1.el6                @puppetlabs-pc1
puppet-client-tools.x86_64           1.0.0-1.el6                puppetlabs-pc1
puppetdb-terminus.noarch             3-1.el6                    puppetlabs-pc1

I believe I have installed puppet , server , db and agent.

But I can't find r10k

rpm -qa | grep puppet
puppetdb-4.1.0-1.el6.noarch
puppet-agent-1.5.0-1.el6.x86_64
puppetserver-2.4.0-1.el6.noarch
puppetdb-termini-4.1.0-1.el6.noarch
puppetlabs-release-pc1-1.0.0-2.el6.noarch

I was following Rob's blog for puppet r10K + git and couldn't find  /etc/r10k.yaml

so how do I install r10k :) 

Lowe Schmidt

unread,
May 31, 2016, 7:04:31 AM5/31/16
to puppet...@googlegroups.com
Have a look over here: https://github.com/puppetlabs/r10k

--
Lowe Schmidt | +46 723 867 157

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/672db58c-e03b-4e60-9003-0afce7b37af8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Nelson

unread,
May 31, 2016, 12:22:05 PM5/31/16
to puppet...@googlegroups.com
Which article were you reading? If you're looking at https://rnelson0.com/2014/05/19/puppet-and-git-201-r10k-setup-installation/, be aware that was written 2 years ago, and the location of files have moved since then (I'll add a note shortly). You shouldn't actually need to manage that file directly, anyway. Keep going to the 'Install r10k' section header, where I use the forge module zack/r10k to configure and install r10k via a .pp file (ex: https://github.com/puppetinabox/controlrepo/blob/production/r10k_installation.pp). As long as you use a recent version of that module, the r10k.yaml file will be created in the correct location for you.

Lee DaeHyung

unread,
May 31, 2016, 2:23:03 PM5/31/16
to Puppet Users
Hi

I think you could see this page first: https://forge.puppet.com/zack/r10k
and this http://garylarizza.com/blog/2014/08/31/r10k-plus-directory-environments/

These will guide you how to use it.



2016년 5월 31일 화요일 오후 3시 40분 49초 UTC+9, Alex Samad 님의 말:

Alex Samad

unread,
Jun 1, 2016, 12:57:01 AM6/1/16
to puppet...@googlegroups.com
Hi

Lowe - okay - so I presume by that it doesn't come as a centos rpm ..
Rob - yes
Lee


So it looks like (more for my documentation )

install the puppet repo into centos
install the puppet base components (DB, server, agent)

Then I can install r10k via puppet ?

i'm looking at this
https://docs.puppet.com/pe/2016.1/cmgmt_managing_code.html

should I follow this to setup ?


"
If you are already using r10k to manage your Puppet code, we suggest
that you upgrade to Code Manager. Code Manager works in concert with
r10k, so when you switch to Code Manager, you no longer interact
directly with r10k.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/836ysw94ya4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/e3d27c2a-4604-4c0d-9f31-d17dba05ef17%40googlegroups.com.

Alex Samad

unread,
Jun 1, 2016, 1:54:34 AM6/1/16
to puppet...@googlegroups.com

Rob Nelson

unread,
Jun 1, 2016, 2:51:06 AM6/1/16
to puppet...@googlegroups.com
Just to be sure, code manager is PE only. It looks like you're using Puppet Opensource instead.
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJ%2BQ1PUihWLQK8dfL-JP7q3Shrxq8ow44hXjKuFxvn-10Jr2_Q%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


--

Alex Samad

unread,
Jun 2, 2016, 12:04:52 AM6/2/16
to Puppet Users
Oh... 

Okay now I am getting lost :) Sorry trying to multi task.

I will go back to the docu & link and see which I need to do.

But I believe I am at the setup git / r10k stage ...




>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/e3d27c2a-4604-4c0d-9f31-d17dba05ef17%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.


--

Alex Samad

unread,
Jun 2, 2016, 12:32:46 AM6/2/16
to Puppet Users
Hi

So I have 

or

Currently stuck on the control-repo 

I have cloned their repo to my work box


replaced origin with my destination. I prepped the destination with git init --bare

then do the push. but all i get is the logs.

when I do a clone of my repo into another directoy on my work box I get no files.

So I thought different approach 
create the repo (puppet.git) with --bare on my internet git server
create a new git repo on my work box and then copy over all the files from the control-repo into my repo minus the .git directory 
then I can commit and push back up to my git server.

But branches ??? I read I need to have a production branch ...

Stefan Heijmans

unread,
Jun 2, 2016, 7:33:31 PM6/2/16
to Puppet Users
HI,

Maybe you check the r10k workshop [1] which will do a complete walkthrough of r10k or just watch their video [2] of it.


Stefan

Ben West

unread,
Jun 8, 2016, 7:06:36 PM6/8/16
to Puppet Users
At least to answer the question of installing r10k tool for use with open source Puppetserver (or just puppet agent), I do this in a bootstrap script for my Puppetserver to install r10k from gem, and do the initial deployment of the control repo.  This for directory-based environments.

# Install r10k gem and deploy control repo for this environment
/opt/puppetlabs/puppet/bin/gem install r10k --no-ri --no-rdoc
mkdir
-p /etc/puppetlabs/r10k
cat
> /etc/puppetlabs/r10k/r10k.yaml <<R10K
:cachedir: '/opt/puppetlabs/puppet/cache/r10k'
:sources:
 
:controlrepo:
    remote
: '${PUPPET_CONTROLREPO_URL}'
    basedir
: '/etc/puppetlabs/code/environments'
R10K

rm
-rf /etc/puppetlabs/code/environments/*

/opt/puppetlabs/puppet/bin/r10k deploy environment -pv info ${PUPPET_ENVIRONMENT}

Rob Nelson

unread,
Jun 8, 2016, 7:39:30 PM6/8/16
to puppet...@googlegroups.com
I do something similar with zack/r10k:
#r10k_installation.pp
Package { allow_virtual => true, } sshkey { 'github.com': type => 'ssh-rsa', key => 'AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==', } class { 'r10k': version => '2.1.1', sources => { 'puppet' => { 'remote' => 'g...@github.com:puppetinabox/controlrepo.git', 'basedir' => $::settings::environmentpath, 'prefix' => false, }, }, manage_modulepath => false }
# bootstrap.sh snippets
mkdir -p /root/bootstrap/modules
puppet module install --modulepath=/root/bootstrap/modules zack/r10k --version 3.2.0
puppet apply --modulepath=/root/bootstrap/modules r10k_installation.pp
r10k deploy environment -p
Since I don't know where the files move around from version to version, I let zack/r10k worry about that for me :)

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/51cad53b-2969-41ee-9e39-e5030286792e%40googlegroups.com.

Alex Samad

unread,
Jun 9, 2016, 12:43:30 AM6/9/16
to puppet...@googlegroups.com
Cool.

spent the last week getting my head around git .. branching and such.
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/836ysw94ya4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAC76iT-oqSkbMyOaALueCUqepXCPbz5JjEe%3DeMCRm7G5%3DMbH%3Dg%40mail.gmail.com.

Alex Samad

unread,
Jun 20, 2016, 4:02:27 AM6/20/16
to puppet...@googlegroups.com
Hi

Okay done some git training, did the R10k workshop. So just to refresh.

Centos 6.x install

i install the puppet repo rpm
then install

puppet-agent.x86_64
puppetserver
postgresql92.x86_64 postgresql92-server.x86_64
postgresql92-contrib.x86_64
check_postgres.noarch
puppetdb
git

Then I can use the script (robs)
to do the R10K install.

What I need todo is bootstrap my initial repo with the puppet repo.
https://github.com/puppetlabs/control-repo

Need to work that out first

Then I presume I need to use HIERA to classify nodes into environments ?
and then config Puppetfiles for each environment that I want.


I believe that leaves me with
automating the link between git push into the repo and R10K pull

A




On 9 June 2016 at 05:39, Rob Nelson <rnel...@gmail.com> wrote:
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/836ysw94ya4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAC76iT-oqSkbMyOaALueCUqepXCPbz5JjEe%3DeMCRm7G5%3DMbH%3Dg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages