+ All Categories
Home > Documents > An Introduction to the Puppet Ecosystem - Meetupfiles.meetup.com/14556582/Introduction to the Puppet...

An Introduction to the Puppet Ecosystem - Meetupfiles.meetup.com/14556582/Introduction to the Puppet...

Date post: 28-Jun-2018
Category:
Upload: duonghuong
View: 231 times
Download: 0 times
Share this document with a friend
39
Introduction to the Puppet Ecosystem An Introduction to the Puppet Ecosystem Trevor Vaughan - License: Onyx Point, Inc. Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) 0
Transcript

Introduction to the Puppet Ecosystem

An Introduction to the Puppet Ecosystem

Trevor Vaughan - License:

Onyx Point, Inc.Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)

0

Introduction to the Puppet Ecosystem

Onyx Point, Inc.

Puppet Labs and Red Hat PartnerGovernment ContractingSystems Automation ConsultingStrong Open Source Supporters

Hiring Geeks to build ALL THE THINGS

Enough Shameless Promotion

https://github.com/onyxpoint

Introduction to the Puppet Ecosystem

The Year was 1998...And was AMAZING!WindowMaker

Introduction to the Puppet Ecosystem

But Systems Automation Was a Mess

Home rolled scriptsCross-system warsEverything was a networked filesystemLife was fun...but difficult to repeat and share reliably

Then, I found In particular,

Infrastructures.orgthe Push/Pull argument

Introduction to the Puppet Ecosystem

Fast Forward to Today-ish

Introduction to the Puppet Ecosystem

Puppet

Written in 2005 as a solution to issues with existingautomation toolsThe front-runner in the current pack of systemsautomation utilitiesAvailable in both Open Source and Enterprise flavors

Introduction to the Puppet Ecosystem

Who is the Target Audience?

Designed to speak like a Systems Administrator butappeal to DevelopersThe ScriptRock sums thingsup nicely

Puppet vs. Chef Infographic

Introduction to the Puppet Ecosystem

Why Use Puppet

You have numerous systems that you need to keepunder controlYou may want to repeat your system configuration againexactly at some other time

This applies particularly for rapidly evolving OSs likeFedora

You need to manage many different flavors of OSsLinux - Red Hat, Ubuntu, Gentoo, etc...UNIX - Mac OS X, Solaris, AIX, HP-UXMicrosoft Windows (yeah, them too)

Introduction to the Puppet Ecosystem

Ways to Use Puppet

Server/Client (puppet agent)Traditional ModelProvides for Server Controlled System IsolationPKI Communication ProtectionCan also make all nodes a server!

Standalone (puppet apply)Apply a manifest locally to the system

Precompiled Catalog (puppet apply)Apply a compiled catalog locally to a system

Introduction to the Puppet Ecosystem

Puppet Basics - Model Driven

Create a model of your systemLet the system figure out how to get you there

Introduction to the Puppet Ecosystem

Resources

package { 'openssh-server': notify => File['/etc/ssh/sshd_config']}

file { '/etc/ssh/sshd_config': notify => Service['sshd']}

service { 'sshd': ensure => 'running'}

Introduction to the Puppet Ecosystem

Classes and Definitions

Building Blocks of Reusable FunctionalityClasses - Singletons => Can InheritDefines - Multiple => Cannot Inherit

Introduction to the Puppet Ecosystem

Classesclass 'ssh' ( $enable_service => true, $port => '22'){ file { '/etc/ssh/sshd_config': content => template('modules/ssh/sshd_config.erb') } service { 'sshd': enable => $enable_service, subscribe => File['/etc/ssh/sshd_config'] }}

include 'ssh'

Introduction to the Puppet Ecosystem

Definesdefine mkusr ( $uid) { group { $name: gid => $uid }

user { $name: uid => $uid, gid => $name }}

mkusr { 'bob': uid => '1111' }mkusr { 'alice': uid => '1112' }mkusr { 'eve': uid => '1337' }

Introduction to the Puppet Ecosystem

Facter

Over 120 Facts on mostsystems

$::osfamily => RedHat$::lsbdistid => Fedora$::lsbdistrelease => 20$::interfaces =>em1,lo,virbr0

Introduction to the Puppet Ecosystem

Hiera

/̍ hī(ә)̩ rä/

Useful for separating data from logicCan use facts and interpolation to generate morepowerful hierarchies

See for interpolating hashes andarrays

YAML or JSON inputJSON does not support comments

my custom patch

Introduction to the Puppet Ecosystem

Sample Hierarchy ConfigFile: /etc/puppet/hiera.yaml

---:backends: - yaml:yaml: :datadir: /etc/puppet/hieradata:hierarchy: - %{fqdn}.yaml - top.yaml

Introduction to the Puppet Ecosystem

Sample HierarchyFile: /etc/puppet/hieradata/top.yaml

File: /etc/puppet/hieradata/my.f.q.d.n.yaml

---classes: - 'foo'

foo::var1: 'foo'foo::var2: %{'foo::var1'}foo::var3: 'bar'

---foo::var3: 'baz'

Introduction to the Puppet Ecosystem

Example

Hostname: my.f.q.d.n

Hostname: other.f.q.d.n

class foo ($var1 = 'one', $var2 = 'two', $var3 = 'three', $var4 = 'four'){ notice("Var1 = $var1") notice("Var2 = $var2") notice("Var3 = $var3") notice("Var4 = $var4")}

Var1 = fooVar2 = fooVar3 = bazVar4 = four

Var1 = fooVar2 = fooVar3 = *bar*Var4 = four

Introduction to the Puppet Ecosystem

What Puppet Is Not...Yet

A cross-system orchestration frameworkSystems are not aware of other system configurationsSome additional tools can be used to fill this gapIdeas have been passed around regarding methodsfor greater awareness

That's pretty much it, I haven't found anything else thatcan't be done

Introduction to the Puppet Ecosystem

Where to get Started

The Module Forge Great resource for pre-built modulesDon't expect them all to work together seamlesslyEven if it doesn't work for you out of the box, it's agreat place to start and learn

The Docs! The The

https://forge.puppetlabs.com

http://docs.puppetlabs.com/Learning Puppet SeriesDrive-Thru Cheat Sheets

Introduction to the Puppet Ecosystem

Checks for syntax correctness against the PuppetStyle Guide

Uses Rspec to evaluate the correctness of yourmanifests as compiledCan masquerade facts and parametersCan use Mocks and StubsWill save you countless hours of trivial debuggingtime

Puppet Lint

Rspec Puppet

Introduction to the Puppet Ecosystem

Puppet Friends!

Introduction to the Puppet Ecosystem

Close Friends

Introduction to the Puppet Ecosystem

An Eclipse-based IDE for Puppet ModulesTakes care of a LOT of the learning and management ofyour codebaseWritten by the primary author of the future parser inPuppet -

Geppetto

Henrik Lindberg

Introduction to the Puppet Ecosystem

The Puppet Labs solution to cross-system orchestrationExcellent Security ModelUses AMQP middleware to broadcast commands asquickly as possibleSimple to extend using RubySupports both Puppet, Chef, Facter, and Ohai formetadata collection

MCollective

Introduction to the Puppet Ecosystem

A data collection service for PuppetEnables the inventory service and exported resourcesContains the most recent facts and catalog for all nodesCan retain multiple run reports for all nodes

PuppetDB

Introduction to the Puppet Ecosystem

A system lifecycle management toolAllows for provisioning and management of physical andvirtual hostsCan act as an external node classifier (ENC) for PuppetBesides Puppet Enterprise, the most powerfulmanagement and reporting utility

Introduction to the Puppet Ecosystem

Introduction to the Puppet Ecosystem

A new reporting interface for PuppetDBStill VERY young but shows promise

Puppetboard

Introduction to the Puppet Ecosystem

The original Puppet DashboardNow 100% community maintained

Puppet Dashboard

Introduction to the Puppet Ecosystem

A bare-metal/VM auto-provisioning toolNew technologyAttempts to generically solve the pre-automation phase

Razor

Introduction to the Puppet Ecosystem

Friendly Neighbors

Introduction to the Puppet Ecosystem

An alternate method for ordered cross-systemorchestrationOften used alongside Puppet for one-off events across acluster of systemsUses SSH as opposed to agentsYAML as opposed to DSLWritten in Python

Introduction to the Puppet Ecosystem

Yet another method for ordered cross-systemorchestrationAlso used alongside Puppet for one-off events across acluster of systemsHas an agent on each node for executionYAML as opposed to DSLWritten in Python

Introduction to the Puppet Ecosystem

Passing Acquaintances

Introduction to the Puppet Ecosystem

Similar to Puppet in terms of focusMuch more developer focused, no DSLOperations are strictly ordered and failures areimmediate

Ruby rescue statements can be used to bypass failurestates

Cookbooks are pulled onto the various nodes andexecuted independently

Introduction to the Puppet Ecosystem

One of the oldest configuration management systemsWritten in C for speedUses a type of DSL that feels similar to CUnlike Puppet or Chef, requires more low-levelprogramming understanding to modify the core

Introduction to the Puppet Ecosystem

Presentation Information

This presentation was made possible by:by

by Reveal.js Hakim El HattabReveal.js Modifications José Manuel Ciges Regueiro


Recommended