SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Puppet.

From 0 to 100

in 30 minutes
(intermediary and next steps are on you)
Alessandro Franceschi
@alvagante
From 0
Puppet essentials
What is Puppet?
• Puppet is a Configuration Management Tool
• It manages applications, systems' components,
network and cloud resources.
• It provides a language that describes the
managed IT resources abstracting the
implementation details.
• It implements paradigms like Infrastructure as
Code and Infrastructure as Data
Puppet components
• On managed nodes are executed Puppet agent and Facter.
• On the central Master runs the Puppet server, here public
modules and our Puppet code and data are deployed with
r10k.
• Puppet generated data is stored to PuppetDB

(it uses PostgreSQL for persistence ;)
• Our data to configure classes and manage Infrastructure can
be defined using Hiera.
• It's also possible to define what classes to use in which
nodes, with External Node Classifiers (ENC) like Puppet
Enterprise Console or The Foreman.
A Puppet run in essence
• Puppet agent use facter to collect facts about the
system and sends them to the Puppet Master
• Puppet Master, using nodes' facts and our Puppet code
and data builds a catalog of resources to manage
• The catalog is sent back to the client. The included
resources are applied locally: packages are installed, files
changed, services started, databases initialised...
• Whatever the number of runs, at the end the system should
be at the desired configuration state (idempotency)
• A report of what happens on the client is sent back to the
Puppet Master and typically stored on PuppetDB
Puppet language essentials
• Puppet represents managed resources on the systems
via a declarative Domain Specific Language (DSL)
• Puppet language is written in files called manifests,
which have a .pp extension
• The single unit of configurations are resource types
• Puppet resources are grouped in classes or defines
• Classes, user defined types (defines), along with relevant
configuration files, are shipped in modules
• Public modules are released on Puppet Forge or
GitHub
(Resource) types
• Puppet types manage resources abstracting the
underlying OS, elements of the system. Examples:
package { 'postgresql':
ensure => present,

}
service { 'postgresql':
ensure => running,
enable => true,

}
file { '/var/lib/pgsql/data/pg_hba.conf':
ensure => present,
source => puppet:///modules/postgres/pg_hba.conf',
}
• Common native resources: package, service, file,
user, group, host, cron, exec, host, mount...
Extra resources from modules
• Additional resources can be provided by dedicated
modules. Examples from puppetlabs-postgresql module:
postgresql::server::db { 'mydatabasename':
user => 'mydatabaseuser',
password => postgresql_password('mydatabaseuser', 'mypassword'),
}
postgresql::server::role { 'marmot':
password_hash => postgresql_password('marmot', 'mypasswd'),
}
postgresql::server::database_grant { 'test1':
privilege => 'ALL',
db => 'test1',
role => 'marmot',
}
postgresql::server::table_grant { 'my_table of test2':
privilege => 'ALL',
table => 'my_table',
db => 'test2',
role => 'marmot',
}
postgresql::server::pg_hba_rule { 'allow application network to access app database':
description => "Open up PostgreSQL for access from 200.1.2.0/24",
type => 'host',
database => 'app',
user => 'app',
address => '200.1.2.0/24',
auth_method => 'md5',
}
Extra resources examples
• There are modules to manage almost everything:

- Specific applications (nginx, postgresql...)

- Systems' features (iptables, sysctl, network...)

- Network equipment (cisco, arista, cumulus... )

- Storage equipment (netapp, emc...)

- Cloud resources (aws, azure, digitalocean...)

- Cloud infrastructures (openstack, opennebula...)

- Containers (docker, mesos, rkt...)
• Each module may provide specific classes and resources
to manage with Puppet DSL specific components

Classes
• Puppet classes expose parameters which define
what and how are the managed resources
class postgresql::server (
$postgres_password = undef,
$package_ensure = $postgresql::params::package_ensure,
$service_ensure = $postgresql::params::service_ensure,
$service_enable = $postgresql::params::service_enable,
) inherits postgresql::params {
[ ... ]

package { 'postgresql':
ensure => $package_ensure, # [...]

}
service { 'postgresql':
ensure => $service_ensure, # [...]

enable => $service_enable, # [...]

}
}
• Class parameters can be set via Hiera, for example
using the yaml backend
postgresql::server::postgres_password: 'my_cleartext_password'

postgresql::server::package_ensure: absent



# Secrets can be encrypted using the hiera-eyaml backend. They look like:
postgresql::server::postgres_password: 'ENC[PKCS7,MIIISA ...]
Modules
• Modules are distributable directories containing manifests,
extensions, templates and files to manage.
• They have a standard structure:
mysql/ # Main module directory
mysql/manifests/ # Manifests directory. Puppet code stays here.
mysql/lib/ # Plugins directory. Ruby code that extends
# Puppet (types, providers, facts...) is here.
mysql/templates/ # ERB and EPP Templates directory
mysql/files/ # Static files directory
include mysql
# Main mysql class is placed in: $modulepath/mysql/manifests/init.pp
include mysql::server
# This class is defined in: $modulepath/mysql/manifests/server.pp
mysql::db { ...}
# This define is defined in: $modulepath/mysql/manifests/db.pp


file { '/etc/motd':
content => template('motd/motd.conf.erb'),

} # Template is in: $modulepath/motd/templates/motd.conf.erb
• This allows some conventions:
Hiera
• Hiera is a key-value lookup tool based on a
configurable hierarchy
• It can have different backends to store data in
different places (yaml, eyaml, json, redis, mysql...)
• Hiera is configured in hiera.yaml
---
:backends:
- yaml
:hierarchy:
- "hostname/%{::trusted.certname}"
- "role/%{::role}-%{::env}"
- "role/%{::role}"
- common
:yaml:
:datadir: "/etc/puppetlabs/code/environments/%{environment}/hieradata"
Roles and profiles
• A popular pattern to manage what resources
should be manages on which nodes
• A role is assigned to nodes (using different
methods: custom facts, ENC...)
• A role represents what a node does and can
include one or more profiles
• In profiles resources from modules are used to
configure local systems in the desired way
Puppet environments
• A Puppet environment is directory under

/etc/puppetlabs/code/environments/
where are is placed our Puppet manifests, modules
and Hiera data
• Puppet environments can can be distributed as git
control-repos. They contain:

manifest directory for common manifests

modules directory for modules

hieradata directory for Hiera data, if used

Puppetfile to configure r10k for public modules
to 100
Introducing example42 Puppet control repo
example42 control-repo
• The result of several years of Puppet experience.

A git repository with the content of a Puppet 4

environment featuring:
• Data and code for a state of the art modern Puppet setup
• Fabric integration for common operations
• Puppet 4 optimised code following updated design principles
• Customisable Vagrant environments to locally test code
• Docker integrations to test code or build images
• Classification based on Roles and Profiles pattern
• In green fields: whatever is needed to start a new Puppet project from scratch
• In brown fields: source of inspiration
• ... and, yes, a lot more.
Setup
• Download the repo from GitHub
• Setup environment via a shell script ...
• Or via Fabric:
• Install git hooks for pre-commit syntax checks
git clone https://github.com/example42/control-repo
cd control-repo
bin/setup.sh
fab puppet.setup
fab git.install_hooks
Explore
• Give a look to the following files and directories:


# The first manifest parsed by Puppet server

manifests/site.pp
# r10k Puppetfile and directory for public modules

Puppetfile
modules/
# Directory containing local site modules
site/
# Sample Hiera configuration file and data directory
hiera.yaml
hieradata/
# Directories for Vagrant and Docker operations
vagrant/
docker/
# Blueprint directory for new Puppet 4 modules

skeleton/
Test local code with Vagrant
Different Vagrant environments available:
fab vagrant.all_status
Single roles can be tested in relevant VMs:
fab vagrant.up:vm=dev-local-log-01
fab vagrant.provision:vm=dev-local-log-01
# All Linux servers use this class of common resources:
# site/profile/manifests/base/linux.pp
# Common settings are in:

# hieradata/common.yaml


# For role "log" specific Hiera data is in
# hieradata/role/log.yaml
Vagrant environments can be customised:
# vi vagrant/environments/$vagrant_environment/config.yaml
vi vagrant/environments/puppetinfra/config.yaml
Test local code with Docker
Build multiOS Docker images:
fab docker.build_multios
# Images are buid based on the data in:
# hieradata/role/docker_multios_build.yaml
Test a role on a given OS:
fab docker.test_role:log,ubuntu-14.04
# Available images: ubuntu-12.04, ubuntu-14.04, ubuntu-14.06

# centos-7, debian-7, debian-8, alpine-3.3
Build an image based on a role (WIP):
fab docker.build_role:log,ubuntu-14.04
Build multiple OS images based on a role (WIP):
fab docker.build_role_multios:log
next steps
learn Puppet and customise your control-repo
Learning Puppet
Check the Official docs

http://docs.puppet.com 



Ask and get involved in the Community

https://puppet.com/community
Look for modules of Puppet Forge

http://forge.puppet.com



Give a look to Tiny Puppet

(used in example42/control-repo)

http://www.tiny-puppet.com
Customise
• The control-repo is just the starting point for a
greenfield modern Puppet setup
• Define a way to set your nodes' roles
• Select the public modules to use and add them to
Puppetfile
• Write local profiles in site/profile/manifests
• Review hiera.yaml logic and customise data in
hieradata/
• Customise your Vagrant environment
• Customise the skeleton to use for custom modules
Contribute
• example42's control repo has a lot of room for
enhancements
• Provide profiles to manage applications
• Send bug and features reports
• Use and improve our code
• Spread the word!


#example42
From 0 to 100

in 30 minutes?

Thank You
(feel free to ask me anything)
Alessandro Franceschi
@alvagante

Más contenido relacionado

La actualidad más candente

Puppet Camp Paris 2016 Data in Modules
Puppet Camp Paris 2016 Data in ModulesPuppet Camp Paris 2016 Data in Modules
Puppet Camp Paris 2016 Data in ModulesMartin Alfke
 
Puppet Continuous Integration with PE and GitLab
Puppet Continuous Integration with PE and GitLabPuppet Continuous Integration with PE and GitLab
Puppet Continuous Integration with PE and GitLabAlessandro Franceschi
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with PuppetAlessandro Franceschi
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys AdminsPuppet
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionJoshua Thijssen
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twentiesPuppet
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsDECK36
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdminsPuppet
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet systemrkhatibi
 
Auto Deploy Deep Dive – vBrownBag Style
Auto Deploy Deep Dive – vBrownBag StyleAuto Deploy Deep Dive – vBrownBag Style
Auto Deploy Deep Dive – vBrownBag StyleRobert Nelson
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)DECK36
 
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpecMartin Etmajer
 
Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet
 

La actualidad más candente (20)

Puppet Camp Paris 2016 Data in Modules
Puppet Camp Paris 2016 Data in ModulesPuppet Camp Paris 2016 Data in Modules
Puppet Camp Paris 2016 Data in Modules
 
Puppet Continuous Integration with PE and GitLab
Puppet Continuous Integration with PE and GitLabPuppet Continuous Integration with PE and GitLab
Puppet Continuous Integration with PE and GitLab
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
Intro to-puppet
Intro to-puppetIntro to-puppet
Intro to-puppet
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Puppet evolutions
Puppet evolutionsPuppet evolutions
Puppet evolutions
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys Admins
 
Anatomy of a reusable module
Anatomy of a reusable moduleAnatomy of a reusable module
Anatomy of a reusable module
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 Edition
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdmins
 
Getting Started With Aura
Getting Started With AuraGetting Started With Aura
Getting Started With Aura
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet system
 
Auto Deploy Deep Dive – vBrownBag Style
Auto Deploy Deep Dive – vBrownBag StyleAuto Deploy Deep Dive – vBrownBag Style
Auto Deploy Deep Dive – vBrownBag Style
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)
 
Puppet_training
Puppet_trainingPuppet_training
Puppet_training
 
Dockerize All The Things
Dockerize All The ThingsDockerize All The Things
Dockerize All The Things
 
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
 
Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 

Similar a Puppet: From 0 to 100 in 30 minutes

Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringAlessandro Franceschi
 
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016Patrick Chanezon
 
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetImproving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetNicolas Brousse
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with PuppetJoe Ray
 
Puppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitPuppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitAlessandro Franceschi
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...Yury Bushmelev
 
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...Nicolas Brousse
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet CampPuppet
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)Puppet
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)DECK36
 
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...Nagios
 
Puppet at Bazaarvoice
Puppet at BazaarvoicePuppet at Bazaarvoice
Puppet at BazaarvoicePuppet
 
Decoupled Libraries for PHP
Decoupled Libraries for PHPDecoupled Libraries for PHP
Decoupled Libraries for PHPPaul Jones
 
Puppet slides for intelligrape
Puppet slides for intelligrapePuppet slides for intelligrape
Puppet slides for intelligrapeSharad Aggarwal
 
Exported resources design patterns
Exported resources design patternsExported resources design patterns
Exported resources design patternsYevgeny Trachtinov
 
Puppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With PuppetPuppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With PuppetPuppet
 

Similar a Puppet: From 0 to 100 in 30 minutes (20)

Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoring
 
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
 
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetImproving Operations Efficiency with Puppet
Improving Operations Efficiency with Puppet
 
Automation using Puppet 3
Automation using Puppet 3 Automation using Puppet 3
Automation using Puppet 3
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with Puppet
 
Puppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitPuppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction Kit
 
Puppet
PuppetPuppet
Puppet
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...
 
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
 
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...
 
Puppet at Bazaarvoice
Puppet at BazaarvoicePuppet at Bazaarvoice
Puppet at Bazaarvoice
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
 
Decoupled Libraries for PHP
Decoupled Libraries for PHPDecoupled Libraries for PHP
Decoupled Libraries for PHP
 
Puppet slides for intelligrape
Puppet slides for intelligrapePuppet slides for intelligrape
Puppet slides for intelligrape
 
Exported resources design patterns
Exported resources design patternsExported resources design patterns
Exported resources design patterns
 
Puppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With PuppetPuppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With Puppet
 

Más de Alessandro Franceschi

Más de Alessandro Franceschi (7)

DevOps - Evoluzione della specie - DevOps Heroes.pdf
DevOps - Evoluzione della specie - DevOps Heroes.pdfDevOps - Evoluzione della specie - DevOps Heroes.pdf
DevOps - Evoluzione della specie - DevOps Heroes.pdf
 
Tiny Puppet Can Install Everything. Prove me wrong!
Tiny Puppet Can Install Everything. Prove me wrong!Tiny Puppet Can Install Everything. Prove me wrong!
Tiny Puppet Can Install Everything. Prove me wrong!
 
ReUse Your (Puppet) Modules!
ReUse Your (Puppet) Modules!ReUse Your (Puppet) Modules!
ReUse Your (Puppet) Modules!
 
Ten years of [Puppet] installations. What now?
Ten years of [Puppet] installations. What now?Ten years of [Puppet] installations. What now?
Ten years of [Puppet] installations. What now?
 
Raise the bar! Reloaded
Raise the bar! ReloadedRaise the bar! Reloaded
Raise the bar! Reloaded
 
Raise the bar!
Raise the bar!Raise the bar!
Raise the bar!
 
Spaghetti devops
Spaghetti devopsSpaghetti devops
Spaghetti devops
 

Último

CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Onlineanilsa9823
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 

Último (20)

CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 

Puppet: From 0 to 100 in 30 minutes

  • 1. Puppet.
 From 0 to 100
 in 30 minutes (intermediary and next steps are on you) Alessandro Franceschi @alvagante
  • 3. What is Puppet? • Puppet is a Configuration Management Tool • It manages applications, systems' components, network and cloud resources. • It provides a language that describes the managed IT resources abstracting the implementation details. • It implements paradigms like Infrastructure as Code and Infrastructure as Data
  • 4. Puppet components • On managed nodes are executed Puppet agent and Facter. • On the central Master runs the Puppet server, here public modules and our Puppet code and data are deployed with r10k. • Puppet generated data is stored to PuppetDB
 (it uses PostgreSQL for persistence ;) • Our data to configure classes and manage Infrastructure can be defined using Hiera. • It's also possible to define what classes to use in which nodes, with External Node Classifiers (ENC) like Puppet Enterprise Console or The Foreman.
  • 5. A Puppet run in essence • Puppet agent use facter to collect facts about the system and sends them to the Puppet Master • Puppet Master, using nodes' facts and our Puppet code and data builds a catalog of resources to manage • The catalog is sent back to the client. The included resources are applied locally: packages are installed, files changed, services started, databases initialised... • Whatever the number of runs, at the end the system should be at the desired configuration state (idempotency) • A report of what happens on the client is sent back to the Puppet Master and typically stored on PuppetDB
  • 6. Puppet language essentials • Puppet represents managed resources on the systems via a declarative Domain Specific Language (DSL) • Puppet language is written in files called manifests, which have a .pp extension • The single unit of configurations are resource types • Puppet resources are grouped in classes or defines • Classes, user defined types (defines), along with relevant configuration files, are shipped in modules • Public modules are released on Puppet Forge or GitHub
  • 7. (Resource) types • Puppet types manage resources abstracting the underlying OS, elements of the system. Examples: package { 'postgresql': ensure => present,
 } service { 'postgresql': ensure => running, enable => true,
 } file { '/var/lib/pgsql/data/pg_hba.conf': ensure => present, source => puppet:///modules/postgres/pg_hba.conf', } • Common native resources: package, service, file, user, group, host, cron, exec, host, mount...
  • 8. Extra resources from modules • Additional resources can be provided by dedicated modules. Examples from puppetlabs-postgresql module: postgresql::server::db { 'mydatabasename': user => 'mydatabaseuser', password => postgresql_password('mydatabaseuser', 'mypassword'), } postgresql::server::role { 'marmot': password_hash => postgresql_password('marmot', 'mypasswd'), } postgresql::server::database_grant { 'test1': privilege => 'ALL', db => 'test1', role => 'marmot', } postgresql::server::table_grant { 'my_table of test2': privilege => 'ALL', table => 'my_table', db => 'test2', role => 'marmot', } postgresql::server::pg_hba_rule { 'allow application network to access app database': description => "Open up PostgreSQL for access from 200.1.2.0/24", type => 'host', database => 'app', user => 'app', address => '200.1.2.0/24', auth_method => 'md5', }
  • 9. Extra resources examples • There are modules to manage almost everything:
 - Specific applications (nginx, postgresql...)
 - Systems' features (iptables, sysctl, network...)
 - Network equipment (cisco, arista, cumulus... )
 - Storage equipment (netapp, emc...)
 - Cloud resources (aws, azure, digitalocean...)
 - Cloud infrastructures (openstack, opennebula...)
 - Containers (docker, mesos, rkt...) • Each module may provide specific classes and resources to manage with Puppet DSL specific components

  • 10. Classes • Puppet classes expose parameters which define what and how are the managed resources class postgresql::server ( $postgres_password = undef, $package_ensure = $postgresql::params::package_ensure, $service_ensure = $postgresql::params::service_ensure, $service_enable = $postgresql::params::service_enable, ) inherits postgresql::params { [ ... ]
 package { 'postgresql': ensure => $package_ensure, # [...]
 } service { 'postgresql': ensure => $service_ensure, # [...]
 enable => $service_enable, # [...]
 } } • Class parameters can be set via Hiera, for example using the yaml backend postgresql::server::postgres_password: 'my_cleartext_password'
 postgresql::server::package_ensure: absent
 
 # Secrets can be encrypted using the hiera-eyaml backend. They look like: postgresql::server::postgres_password: 'ENC[PKCS7,MIIISA ...]
  • 11. Modules • Modules are distributable directories containing manifests, extensions, templates and files to manage. • They have a standard structure: mysql/ # Main module directory mysql/manifests/ # Manifests directory. Puppet code stays here. mysql/lib/ # Plugins directory. Ruby code that extends # Puppet (types, providers, facts...) is here. mysql/templates/ # ERB and EPP Templates directory mysql/files/ # Static files directory include mysql # Main mysql class is placed in: $modulepath/mysql/manifests/init.pp include mysql::server # This class is defined in: $modulepath/mysql/manifests/server.pp mysql::db { ...} # This define is defined in: $modulepath/mysql/manifests/db.pp 
 file { '/etc/motd': content => template('motd/motd.conf.erb'),
 } # Template is in: $modulepath/motd/templates/motd.conf.erb • This allows some conventions:
  • 12. Hiera • Hiera is a key-value lookup tool based on a configurable hierarchy • It can have different backends to store data in different places (yaml, eyaml, json, redis, mysql...) • Hiera is configured in hiera.yaml --- :backends: - yaml :hierarchy: - "hostname/%{::trusted.certname}" - "role/%{::role}-%{::env}" - "role/%{::role}" - common :yaml: :datadir: "/etc/puppetlabs/code/environments/%{environment}/hieradata"
  • 13. Roles and profiles • A popular pattern to manage what resources should be manages on which nodes • A role is assigned to nodes (using different methods: custom facts, ENC...) • A role represents what a node does and can include one or more profiles • In profiles resources from modules are used to configure local systems in the desired way
  • 14. Puppet environments • A Puppet environment is directory under
 /etc/puppetlabs/code/environments/ where are is placed our Puppet manifests, modules and Hiera data • Puppet environments can can be distributed as git control-repos. They contain:
 manifest directory for common manifests
 modules directory for modules
 hieradata directory for Hiera data, if used
 Puppetfile to configure r10k for public modules
  • 15. to 100 Introducing example42 Puppet control repo
  • 16. example42 control-repo • The result of several years of Puppet experience.
 A git repository with the content of a Puppet 4
 environment featuring: • Data and code for a state of the art modern Puppet setup • Fabric integration for common operations • Puppet 4 optimised code following updated design principles • Customisable Vagrant environments to locally test code • Docker integrations to test code or build images • Classification based on Roles and Profiles pattern • In green fields: whatever is needed to start a new Puppet project from scratch • In brown fields: source of inspiration • ... and, yes, a lot more.
  • 17. Setup • Download the repo from GitHub • Setup environment via a shell script ... • Or via Fabric: • Install git hooks for pre-commit syntax checks git clone https://github.com/example42/control-repo cd control-repo bin/setup.sh fab puppet.setup fab git.install_hooks
  • 18. Explore • Give a look to the following files and directories: 
 # The first manifest parsed by Puppet server
 manifests/site.pp # r10k Puppetfile and directory for public modules
 Puppetfile modules/ # Directory containing local site modules site/ # Sample Hiera configuration file and data directory hiera.yaml hieradata/ # Directories for Vagrant and Docker operations vagrant/ docker/ # Blueprint directory for new Puppet 4 modules
 skeleton/
  • 19. Test local code with Vagrant Different Vagrant environments available: fab vagrant.all_status Single roles can be tested in relevant VMs: fab vagrant.up:vm=dev-local-log-01 fab vagrant.provision:vm=dev-local-log-01 # All Linux servers use this class of common resources: # site/profile/manifests/base/linux.pp # Common settings are in:
 # hieradata/common.yaml 
 # For role "log" specific Hiera data is in # hieradata/role/log.yaml Vagrant environments can be customised: # vi vagrant/environments/$vagrant_environment/config.yaml vi vagrant/environments/puppetinfra/config.yaml
  • 20. Test local code with Docker Build multiOS Docker images: fab docker.build_multios # Images are buid based on the data in: # hieradata/role/docker_multios_build.yaml Test a role on a given OS: fab docker.test_role:log,ubuntu-14.04 # Available images: ubuntu-12.04, ubuntu-14.04, ubuntu-14.06
 # centos-7, debian-7, debian-8, alpine-3.3 Build an image based on a role (WIP): fab docker.build_role:log,ubuntu-14.04 Build multiple OS images based on a role (WIP): fab docker.build_role_multios:log
  • 21. next steps learn Puppet and customise your control-repo
  • 22. Learning Puppet Check the Official docs
 http://docs.puppet.com 
 
 Ask and get involved in the Community
 https://puppet.com/community Look for modules of Puppet Forge
 http://forge.puppet.com
 
 Give a look to Tiny Puppet
 (used in example42/control-repo)
 http://www.tiny-puppet.com
  • 23. Customise • The control-repo is just the starting point for a greenfield modern Puppet setup • Define a way to set your nodes' roles • Select the public modules to use and add them to Puppetfile • Write local profiles in site/profile/manifests • Review hiera.yaml logic and customise data in hieradata/ • Customise your Vagrant environment • Customise the skeleton to use for custom modules
  • 24. Contribute • example42's control repo has a lot of room for enhancements • Provide profiles to manage applications • Send bug and features reports • Use and improve our code • Spread the word! 
 #example42
  • 25. From 0 to 100
 in 30 minutes?
 Thank You (feel free to ask me anything) Alessandro Franceschi @alvagante