Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Crmngr – Control Repository Manager

Crmngr – Control Repository Manager

A small CLI tool to help managing r10k control repositories

Tobias Brunner

November 11, 2015
Tweet

More Decks by Tobias Brunner

Other Decks in Technology

Transcript

  1. 11/10/15 VSHN AG | http://vshn.ch 2 Agenda • VSHN? Or:

    How do I spell that? • Directory Environments • r10k • Crmngr (all the things!)
  2. 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
  3. 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
  4. 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/<name> • puppet agent -t --environment myenvironment
  5. 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'
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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 ...
  11. 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
  12. 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
  13. 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...
  14. 11/10/2015 VSHN AG | http://vshn.ch 17 We're hiring Speak to:

    @tobruzh, @aarnoaukia or any other VSHNeer