Webinar May 2016
Oscar and Puppet
Auto-provisioning Puppet with VirtualBox
Webinar May 2016
Who am I?
• Walter Heck, Software engineer turned DBA, turned
Sysadmin, turned entrepreneur, promoted to CTO
• CTO/Founder of OlinData (http://www.olindata.com)
• Icinga partner for Holland, India and Southeast Asia
• Puppet Labs training partner for most of Asia and part of
Europe (Not NL!)
• Linux Foundation training partner
• MySQL consulting
Webinar May 2016
Overview
• What is puppet?
• Typical Puppet Architecture
• Introducing Oscar
• Why Oscar?
• Prerequisites
• Getting started
• What’s next?
• Questions
Webinar May 2016
What is Puppet and why do we care?
• Configuration management software
• http://www.olindata.com/blog/2014/08/puppet-master-agent-setup
• http://olindata.com/blog/2015/03/setup-puppet-server-centos-70
• Scales very well (from 1 to 200k+ nodes)
• Multi-platform (windows, *nix, Mac OS, BSD)
• Commercially supported Open Source
• Infrastructure as code
Webinar May 2016
Typical Puppet Architecture
Puppet Master
Puppet Code
(.git repository)
web01.olindata.com icinga.olindata.comdb01.olindata.com
Puppet Agent Puppet AgentPuppet Agent
Webinar May 2016
Challenges in non-production
Outside of your production environment there are many
instances where you want to test things quickly, locally:
•New module
•New development environment
•Automated tests
•Reproducing issues
Setting up a new master and desired agents each time is
cumbersome, so let’s make that easier!
Webinar May 2016
Why Oscar-stack
Using Oscar instead of home-made scripts provides benefits:
•Native virtualbox plugins
•Extendable, eg. not use PE but use FOSS puppet
•Create complex puppet deployments fast
Webinar May 2016
Oscar Prerequisites
Make sure you have installed the following on your host
machine:
•virtualbox (http://virtualbox.org)
•vagrant (https://www.vagrantup.com/)
•vagrant plugin oscar (https://github.com/oscar-stack/oscar)
You can install oscar plugin for vagrant with the following
command:
vagrant plugin install oscar
Webinar May 2016
About VirtualBox and Vagrant
VirtualBox Vagrant
• Desktop tool for local
virtualisation
• Similar to vmware
player/vmware fusion
• Great for local vms / testing
• Requires significant
resources on host system
https://www.virtualbox.org/
• Wrapper around virtualbox
• Easily provision new
machines
• Idempotent (ie. the resulting
boxes will always look the
same given the same
vagrantfile)
• Flat file configuration, great
for version control and
distribution with your tool’s
code
https://www.vagrantup.com/
Webinar May 2016
•Boxes are standard vms packaged in a easy to use format
• They form the base of a vagrant environment
•Check installed boxes:
# vagrant box list
puppetlabs/centos-6.6-64-nocm (virtualbox, 1.0.2)
puppetlabs/centos-7.0-64-nocm (virtualbox, 1.0.2)
puppetlabs/debian-7.8-64-nocm (virtualbox, 1.0.1)
puppetlabs/ubuntu-14.04-64-nocm (virtualbox, 1.0.2)
Vagrant boxes
Webinar May 2016
Puppet Enterprise builds
•Download PE installer for the platforms you want to use
• https://puppet.com/download-puppet-enterprise
# vagrant pe-build copy 
https://s3.amazonaws.com/pe-builds/released/2016.1.2/puppet-enterprise-2016.1.2-
el-7-x86_64.tar.gz
•Check installed pe builds:
# vagrant pe-build list
PE versions available (at /Users/walterheck/.vagrant.d/pe_builds)
---
- puppet-enterprise-2015.2.2-el-6-x86_64.tar.gz
- puppet-enterprise-2015.2.2-ubuntu-14.04-amd64.tar.gz
- puppet-enterprise-2015.3.0-el-7-x86_64.tar.gz
- puppet-enterprise-2015.3.1-el-7-x86_64.tar.gz
- puppet-enterprise-2016.1.1-el-7-x86_64.tar.gz
Webinar May 2016
• Initialize vagrant environment using oscar
• vagrant init -> # vagrant oscar init
• Add oscar machines and a puppet enterprise version
• # vagrant oscar init-vms 
--pe-version=2015.2.2 
--master master=puppetlabs/centos-7.0-64-nocm 
--agent first=puppetlabs/centos-6.6-64-nocm 
--agent second=puppetlabs/ubuntu-14.04-64-nocm 
--agent third=puppetlabs/centos-7.0-64-nocm
Your environment has been initialized with the following configuration:
masters:
- ["master", "puppetlabs/centos-7.0-64-nocm"]
agents:
- ["first", "puppetlabs/centos-6.6-64-nocm"]
- ["second", "puppetlabs/ubuntu-14.04-64-nocm"]
- ["third", "puppetlabs/centos-7.0-64-nocm"]
pe_version: 2015.2.2
Initialize oscar
Webinar May 2016
Vagrant up!
•Master:
• Bring up the master,
• install desired version of PE
• PE Console login: admin/puppetlabs
•Agents:
• Bring up the agent,
• install PE agent version,
• update /etc/hosts on all other nodes
• Sign agent certificate on the master
• Potentially adds repo to master
Webinar May 2016
What’s next?
•Auto deploy r10k
• See:
https://github.com/opstheater/opstheater/blob/production/deploy/vagran
t-oscar/config/roles.yaml#L19
• Set up foss-puppet
• See:
https://github.com/opstheater/opstheater/blob/production/deploy/vagran
t-oscar/config/roles.yaml#L34
• Check out puppet-debugging-kit for inspiration:
• See: https://github.com/Sharpie/puppet-debugging-kit
Webinar May 2016
Icinga Camp NL
•First official icinga camp in the Netherlands on June 28th
•Day before DevOpsDays Amsterdam
•Tickets only 75 EUR(!)
https://www.icinga.org/community/events/icinga-camp-
amsterdam/
Webinar May 2016
Questions?
@walterheck / @olindata
http://www.olindata.com
walterheck@olindata.com
http://github.com/olindata
Webinar May 2016
We’re hiring!
NL based consultants
jobs@olindata.com

Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar

  • 1.
    Webinar May 2016 Oscarand Puppet Auto-provisioning Puppet with VirtualBox
  • 2.
    Webinar May 2016 Whoam I? • Walter Heck, Software engineer turned DBA, turned Sysadmin, turned entrepreneur, promoted to CTO • CTO/Founder of OlinData (http://www.olindata.com) • Icinga partner for Holland, India and Southeast Asia • Puppet Labs training partner for most of Asia and part of Europe (Not NL!) • Linux Foundation training partner • MySQL consulting
  • 3.
    Webinar May 2016 Overview •What is puppet? • Typical Puppet Architecture • Introducing Oscar • Why Oscar? • Prerequisites • Getting started • What’s next? • Questions
  • 4.
    Webinar May 2016 Whatis Puppet and why do we care? • Configuration management software • http://www.olindata.com/blog/2014/08/puppet-master-agent-setup • http://olindata.com/blog/2015/03/setup-puppet-server-centos-70 • Scales very well (from 1 to 200k+ nodes) • Multi-platform (windows, *nix, Mac OS, BSD) • Commercially supported Open Source • Infrastructure as code
  • 5.
    Webinar May 2016 TypicalPuppet Architecture Puppet Master Puppet Code (.git repository) web01.olindata.com icinga.olindata.comdb01.olindata.com Puppet Agent Puppet AgentPuppet Agent
  • 6.
    Webinar May 2016 Challengesin non-production Outside of your production environment there are many instances where you want to test things quickly, locally: •New module •New development environment •Automated tests •Reproducing issues Setting up a new master and desired agents each time is cumbersome, so let’s make that easier!
  • 7.
    Webinar May 2016 WhyOscar-stack Using Oscar instead of home-made scripts provides benefits: •Native virtualbox plugins •Extendable, eg. not use PE but use FOSS puppet •Create complex puppet deployments fast
  • 8.
    Webinar May 2016 OscarPrerequisites Make sure you have installed the following on your host machine: •virtualbox (http://virtualbox.org) •vagrant (https://www.vagrantup.com/) •vagrant plugin oscar (https://github.com/oscar-stack/oscar) You can install oscar plugin for vagrant with the following command: vagrant plugin install oscar
  • 9.
    Webinar May 2016 AboutVirtualBox and Vagrant VirtualBox Vagrant • Desktop tool for local virtualisation • Similar to vmware player/vmware fusion • Great for local vms / testing • Requires significant resources on host system https://www.virtualbox.org/ • Wrapper around virtualbox • Easily provision new machines • Idempotent (ie. the resulting boxes will always look the same given the same vagrantfile) • Flat file configuration, great for version control and distribution with your tool’s code https://www.vagrantup.com/
  • 10.
    Webinar May 2016 •Boxesare standard vms packaged in a easy to use format • They form the base of a vagrant environment •Check installed boxes: # vagrant box list puppetlabs/centos-6.6-64-nocm (virtualbox, 1.0.2) puppetlabs/centos-7.0-64-nocm (virtualbox, 1.0.2) puppetlabs/debian-7.8-64-nocm (virtualbox, 1.0.1) puppetlabs/ubuntu-14.04-64-nocm (virtualbox, 1.0.2) Vagrant boxes
  • 11.
    Webinar May 2016 PuppetEnterprise builds •Download PE installer for the platforms you want to use • https://puppet.com/download-puppet-enterprise # vagrant pe-build copy https://s3.amazonaws.com/pe-builds/released/2016.1.2/puppet-enterprise-2016.1.2- el-7-x86_64.tar.gz •Check installed pe builds: # vagrant pe-build list PE versions available (at /Users/walterheck/.vagrant.d/pe_builds) --- - puppet-enterprise-2015.2.2-el-6-x86_64.tar.gz - puppet-enterprise-2015.2.2-ubuntu-14.04-amd64.tar.gz - puppet-enterprise-2015.3.0-el-7-x86_64.tar.gz - puppet-enterprise-2015.3.1-el-7-x86_64.tar.gz - puppet-enterprise-2016.1.1-el-7-x86_64.tar.gz
  • 12.
    Webinar May 2016 •Initialize vagrant environment using oscar • vagrant init -> # vagrant oscar init • Add oscar machines and a puppet enterprise version • # vagrant oscar init-vms --pe-version=2015.2.2 --master master=puppetlabs/centos-7.0-64-nocm --agent first=puppetlabs/centos-6.6-64-nocm --agent second=puppetlabs/ubuntu-14.04-64-nocm --agent third=puppetlabs/centos-7.0-64-nocm Your environment has been initialized with the following configuration: masters: - ["master", "puppetlabs/centos-7.0-64-nocm"] agents: - ["first", "puppetlabs/centos-6.6-64-nocm"] - ["second", "puppetlabs/ubuntu-14.04-64-nocm"] - ["third", "puppetlabs/centos-7.0-64-nocm"] pe_version: 2015.2.2 Initialize oscar
  • 13.
    Webinar May 2016 Vagrantup! •Master: • Bring up the master, • install desired version of PE • PE Console login: admin/puppetlabs •Agents: • Bring up the agent, • install PE agent version, • update /etc/hosts on all other nodes • Sign agent certificate on the master • Potentially adds repo to master
  • 14.
    Webinar May 2016 What’snext? •Auto deploy r10k • See: https://github.com/opstheater/opstheater/blob/production/deploy/vagran t-oscar/config/roles.yaml#L19 • Set up foss-puppet • See: https://github.com/opstheater/opstheater/blob/production/deploy/vagran t-oscar/config/roles.yaml#L34 • Check out puppet-debugging-kit for inspiration: • See: https://github.com/Sharpie/puppet-debugging-kit
  • 15.
    Webinar May 2016 IcingaCamp NL •First official icinga camp in the Netherlands on June 28th •Day before DevOpsDays Amsterdam •Tickets only 75 EUR(!) https://www.icinga.org/community/events/icinga-camp- amsterdam/
  • 16.
    Webinar May 2016 Questions? @walterheck/ @olindata http://www.olindata.com walterheck@olindata.com http://github.com/olindata
  • 17.
    Webinar May 2016 We’rehiring! NL based consultants jobs@olindata.com