Slide 1

Slide 1 text

Crmngr – Control Repository Manager Or: We're bad at naming tools!

Slide 2

Slide 2 text

11/10/15 VSHN AG | http://vshn.ch 2 Agenda ● VSHN? Or: How do I spell that? ● Directory Environments ● r10k ● Crmngr (all the things!)

Slide 3

Slide 3 text

11/10/15 VSHN AG | http://vshn.ch 3 /me ● Tobias Brunner aka tobru ● VSHNeer ● Puppetizer since 2011. Modules: – Smokeping – Knot DNS – Gitlab – Identity ● Blog: https://tobrunet.ch ● Twitter: @tobruzh

Slide 4

Slide 4 text

11/10/15 VSHN AG | http://vshn.ch 4 Company Profle | v ʒ | ˈ ɪ nn ● Owner-operated Swiss company ● 12 employees at the head office in Zurich ● Service provider for DevOps, software delivery automation and confguration management ● Partner for operations/hosting of web applications ● Further specialty felds: Consulting, System Engineering, Continuous Delivery, Monitoring, Backup, 24/7 Support

Slide 5

Slide 5 text

11/10/2015 VSHN AG | http://vshn.ch 5 Directory Environments ● Puppet Module environments ● Directory environments default since Puppet 4 ● Every environment has it's own: – main manifest – module versions – environment.conf (modulepath, manifest, confg_version, environment_timeout) ● Located under $codedir/environments/ ● puppet agent -t --environment myenvironment

Slide 6

Slide 6 text

11/10/2015 VSHN AG | http://vshn.ch 6 r10k (wow such tool names!) ● Two purposes – Manage modules using a Puppetfile – Manage directory environments using git branches ● Puppetfile – specify a list of modules to install – r10k puppetfile install moduledir '/etc/puppet/modules' mod 'puppetlabs/apache', '0.10.0' mod 'apache', :git => 'https://github.com/puppetlabs/puppetlabs-apache'

Slide 7

Slide 7 text

11/10/2015 VSHN AG | http://vshn.ch 7 r10k (wow such tool names!) ● Environments – Save Puppetfile into git repository (Control Repository) – Create branch for each Puppet environment – Use r10k to deploy environments – r10k deploy environments – /etc/puppetlabs/r10k/r10k.yaml :cachedir: /var/cache/r10k :sources: puppet: basedir: /etc/puppetlabs/code/environments remote: [email protected]:r10k-control.git

Slide 8

Slide 8 text

11/10/2015 VSHN AG | http://vshn.ch 8 crmngr – Control Repository Manager ● Challenges – Keep track of module versions (forge, git, …) – Manage many control repository branches – Compare branches – Mass update module versions

Slide 9

Slide 9 text

11/10/2015 VSHN AG | http://vshn.ch 9 crmngr – Control Repository Manager

Slide 10

Slide 10 text

11/10/2015 VSHN AG | http://vshn.ch 10 crmngr – Control Repository Manager ● CLI tool crmngr / pip install crmngr ● Works on git repository / edits Puppetfile in branch ● Reporting: crmngr report – Filters available: by module, by environment, combination, unused modules, … crmngr report --branches Production --module gitlab Module: gitlab Version: Forge: vshn/gitlab: 1.5.0 [Latest: 1.6.0 (2015-11-06)] Used by: Production

Slide 11

Slide 11 text

11/10/2015 VSHN AG | http://vshn.ch 11 crmngr – Control Repository Manager ● Example 2: Module report crmngr report --module gitlab Module: gitlab Version: Forge: vshn/gitlab: 1.5.0 [Latest: 1.6.0 (2015-11-06)] Used by: Customer1, Customer2, Customer3 Version: Forge: vshn/gitlab: 1.4.0 [Latest: 1.6.0 (2015-11-06)] Used by: Customer4, Customer5 Version: Forge: vshn/gitlab: 1.2.1 [Latest: 1.6.0 (2015-11-06)] Used by: Customer6

Slide 12

Slide 12 text

11/10/2015 VSHN AG | http://vshn.ch 12 crmngr – Control Repository Manager ● Example 3: Branch report crmngr report --branches production Module: apache Version: Forge: puppetlabs/apache: 1.6.0 [Latest: 1.6.0 (2015-07-30)] Used by: production Module: apt Version: Forge: puppetlabs/apt: 2.1.0 [Latest: 2.2.0 (2015-09-29)] Used by: production Module: aptly Version: Git: https://github.com/gds-operations/puppet-aptly.git UNSPECIFIED [Latest: v0.3.0 (2015-04-23)] Used by: production ...

Slide 13

Slide 13 text

11/10/2015 VSHN AG | http://vshn.ch 13 crmngr – Control Repository Manager ● Udating: crmngr update – Update stdlib module in all branches to latest forge version: crmngr update --module puppetlabs/stdlib --version – Update stdlib module in all branches to latest forge version. Additionally add the module to branches that currently lack the stdlib module: crmngr update --add --module puppetlabs/stdlib –version

Slide 14

Slide 14 text

11/10/2015 VSHN AG | http://vshn.ch 14 crmngr – Control Repository Manager ● More examples: – Remove icinga modules from control repository branches that end with Vagrant: crmngr update --remove --module icinga --branches "*Vagrant" – Update apache module to git branch 2.0.x in control repository branch Devel: crmngr update --branches Devel --module apache –git [email protected]:puppetlabs/puppetlabs- apache.git --branch 2.0.x

Slide 15

Slide 15 text

11/10/2015 VSHN AG | http://vshn.ch 15 crmngr – Control Repository Manager ● Roadmap – Put on Github under BSD-3-Clause license (soon!) – Iron out some UX issues – Add a few features like: ● Creating and Removing environments ● Update all modules to latest version ● Template environments ● Some more...

Slide 16

Slide 16 text

11/10/2015 VSHN AG | http://vshn.ch 16 Questions?

Slide 17

Slide 17 text

11/10/2015 VSHN AG | http://vshn.ch 17 We're hiring Speak to: @tobruzh, @aarnoaukia or any other VSHNeer