SlideShare une entreprise Scribd logo
1  sur  25
Puppet Master Class
Puppet overview
About Me:
Miguel Rodrigues
DevOps
using puppet 3 years
lousy creator of slidesets
What is puppet
CM tool - Bring running systems to consistent
state;
Despite the starting point systems will end in
the same point, in a repeatable and
predictable way;
Other CM tools : Chef, Ansible, Salt,
Capistrano…..
What is the need for a CM ?
Admin one, two … servers is nice … do it on
1000 is awful
boring
repeatable
…..
To Err is Human; To Really Foul Things Up
Requires a Computer…. image the mess in
100's or 1000's of computers
@WikiLovers
Started by Luke Kanies in 2005
founded Puppet Labs
GPL
Unix* and Windows
Ruby
Have one language (DSL)
more details: Wiki for it ;-)
Declare where you want to be ( not how to get
there ) - presenting Manifest’s
file: some_manifest.pp
node ‘some_name_or_ip’ {
….
do_stuff_to_get_servers_where_You_want
….
}
puppet apply some_manifest.pp
Hold on … Are there any requisites ?
Need running system ( bootstrapping is another
issue, more on that later )
puppet installed ( How2 and dependencies are
OS specific )
Do Stuff
puppet apply classes to nodes
classes are set of resources
and resources are ….
Some Resources Examples
package
file
service
cron
exec
notify
user
…..
Full list of resources at https://docs.puppetlabs.com/references/latest/type.html
Facts: "that is life"
We take decisions based on facts , so puppet
can do it
Facts are variables to puppet
environment facts
others ( eg: this server is “yellow”)
facts can ( should be ) used in classes
Confused ??
Ntp and Time, one classic example
Challenge
What time is it ?
Systems need to be accurate
update logs with timestamps
do action based on time
Network Time Protocol (NTP) is a networking
protocol for clock synchronization
Basic Ntp on a server (variables,
resources and templates)
file: some_manifest.pp
node ‘some_name_or_ip’ {
$package_name= “ntp”
$host_config = “xpto”
$ntp1 = “ip_or_address_1”
$ntp2 = “ip_or_address_2”
package { $package_name: ensure => installed, }
file { 'ntp_config_file':
ensure => file,
path => '/etc/ntp.conf',
require => Package[$package_name],
content => template('ntp.conf.erb'),
mode => '0644',
owner => 'root',
group => 'root',
}
(variables in orange and resources in red)
service { 'ntpd':
ensure => running,
name => 'ntpd',
enable => true,
subscribe => File['ntp_config_file'],
}
}
puppet apply some_manifest.pp
Templates … Files
Files are used to
configure services
The content can be
static ;-( or should
be based on
environment
Templates can add
Dynamic content
Based on variables
have ruby logic in it
( if/else, cycles, ….
)
Ntp template (ntp.conf.erb)- template
example
restrict default ignore
<% if @host_config == "some_value" -%>
server <%= @ntp1 %>
<% else -%>
server <%= @ntp2 %>
<% end -%>
server 127.127.1.0
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
restrict 127.0.0.1
Not a clever way to code , Modules are
here
Modules are self-
contained bundles of
code and data.
file: some_manifest.pp
node ‘some_name_or_ip’ {class { 'my_ntp_module':}}
file: ./modules/my_ntp_module/manifests/init.pp
class my_ntp_module {
…. same do_stuff ….
file { 'ntp.conf':
….
content =>
template('my_ntp_module/ntp.conf.erb'),
..
}
}
file:./modules/my_ntp_module/templates/ntp.conf.erb
puppet apply --modulepath
./modules/some_manifest.pp
Clever Modules … Arguments
file: ./modules/my_ntp_module/manifests/init.pp
class my_ntp_module ($package_name, $host_config, $ntp1, $ntp2) {
…. same do_stuff ….
}
}
file: some_manifest.pp
node ‘some_name_or_ip’ {class { 'my_ntp_module':
package_name => “ntp”
host_config =>“xpto”
ntp1 => “ip_or_address_1”
ntp2 =>“ip_or_address_2”
}}
puppet apply --modulepath ./modules some_manifest.pp
Code and data “all together” :-(...
welcome to backends (Hiera)
Purpose
separate data ( values) from logic (code)
support multiple data types (values, list, hash ….)
Hiera is a key/value lookup tool for configuration
data
Hiera can use several different data backends,
including two built-in backends ( yaml and JSON
) and other optional ones.
Data Encryption
Why ?
Secrets should be kept … secret
“someone” should know about Secrets
Backends may be encrypted when and where
needed for a list of “trusted persons"
Modules with backend
file: ./modules/my_ntp_module/manifests/init.pp
class my_ntp_module ($package_name, $host_config, $ntp1, $ntp2) {
…. same do_stuff ….
}
}
file: some_manifest.pp
node default { hiera_include('classes')}
node ‘same_name_or_ip’ {class { 'my_ntp_module':}}
file: hieradata/backend.yaml
my_ntp_module::package_name: “ntp”
my_ntp_module::host_config: “xpto”
my_ntp_module::ntp1: “ip_or_address_1”
my_ntp_module::ntp2: “ip_or_address_2”
puppet apply --modulepath ./modules --hiera_config hiera.yaml --
some_manifest.pp
Where Manifests (and related stuff)
are?
Manifests (and resources specified in it) must
exist on the system at the time they are
applied
They go there “by magic”:
“Someone” send them to the system ( push approach)
fetched from some place ( eg: VCS like git, svn, … ) (pull
approach )
“just are there”
Bootstrapping Servers
How ?
:-( “manually”
CF/ AMI …. in AWS
PXE boot ( in “DC”)
Heat ( in Openstack)
others ...
Bootstrapping Servers - Process (1)
1.Install OS
2.“Hard” install
a.Set keys for VCS authorization
b.Set facts for the host (product/env/role/location/… )
c.Set hostname, and "basic stuff"
Bootstrapping Servers - Process (2)
3.“Soft” install
a.Fetch manifests code and backend data from VCS
based on facts
b.Apply puppet
Puppet overview

Contenu connexe

Tendances

Getting Started with Datatsax .Net Driver
Getting Started with Datatsax .Net DriverGetting Started with Datatsax .Net Driver
Getting Started with Datatsax .Net Driver
DataStax Academy
 
Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB
Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB
Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB
Puppet
 
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Michaël Figuière
 
Puppet barcampexercises.jzt
Puppet barcampexercises.jztPuppet barcampexercises.jzt
Puppet barcampexercises.jzt
som_nangia
 
Replication and Replica Sets
Replication and Replica SetsReplication and Replica Sets
Replication and Replica Sets
MongoDB
 

Tendances (20)

Configuring Mahout Clustering Jobs - Frank Scholten
Configuring Mahout Clustering Jobs - Frank ScholtenConfiguring Mahout Clustering Jobs - Frank Scholten
Configuring Mahout Clustering Jobs - Frank Scholten
 
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
 
Getting Started with Datatsax .Net Driver
Getting Started with Datatsax .Net DriverGetting Started with Datatsax .Net Driver
Getting Started with Datatsax .Net Driver
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
 
working with files
working with filesworking with files
working with files
 
My Sq Ldb Tut
My Sq Ldb TutMy Sq Ldb Tut
My Sq Ldb Tut
 
Spark application on ec2 cluster
Spark application on ec2 clusterSpark application on ec2 cluster
Spark application on ec2 cluster
 
Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB
Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB
Puppet Camp Melbourne 2014: Node Collaboration with PuppetDB
 
concurrency with GPars
concurrency with GParsconcurrency with GPars
concurrency with GPars
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...
 
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!
 
20141111 파이썬으로 Hadoop MR프로그래밍
20141111 파이썬으로 Hadoop MR프로그래밍20141111 파이썬으로 Hadoop MR프로그래밍
20141111 파이썬으로 Hadoop MR프로그래밍
 
Puppet barcampexercises.jzt
Puppet barcampexercises.jztPuppet barcampexercises.jzt
Puppet barcampexercises.jzt
 
eZ Publish cluster unleashed revisited
eZ Publish cluster unleashed revisitedeZ Publish cluster unleashed revisited
eZ Publish cluster unleashed revisited
 
Psycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python ScriptPsycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python Script
 
Replication and Replica Sets
Replication and Replica SetsReplication and Replica Sets
Replication and Replica Sets
 
MongoDB World 2019: Creating a Self-healing MongoDB Replica Set on GCP Comput...
MongoDB World 2019: Creating a Self-healing MongoDB Replica Set on GCP Comput...MongoDB World 2019: Creating a Self-healing MongoDB Replica Set on GCP Comput...
MongoDB World 2019: Creating a Self-healing MongoDB Replica Set on GCP Comput...
 
Hadoop
HadoopHadoop
Hadoop
 
GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)GPars (Groovy Parallel Systems)
GPars (Groovy Parallel Systems)
 
Java 7 new features
Java 7 new featuresJava 7 new features
Java 7 new features
 

Similaire à Puppet overview

PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operations
grim_radical
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
Carlos Sanchez
 
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
Carlos Sanchez
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
Carlos Sanchez
 

Similaire à Puppet overview (20)

Learning Puppet basic thing
Learning Puppet basic thing Learning Puppet basic thing
Learning Puppet basic thing
 
Intro to-puppet
Intro to-puppetIntro to-puppet
Intro to-puppet
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Modules reduce reuse_recycle
Modules reduce reuse_recycleModules reduce reuse_recycle
Modules reduce reuse_recycle
 
PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operations
 
Cloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the CloudCloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the Cloud
 
Ansible
AnsibleAnsible
Ansible
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
 
GDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in UnityGDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in Unity
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Puppet: From 0 to 100 in 30 minutes
Puppet: From 0 to 100 in 30 minutesPuppet: From 0 to 100 in 30 minutes
Puppet: From 0 to 100 in 30 minutes
 
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 
Writing and Publishing Puppet Modules
Writing and Publishing Puppet ModulesWriting and Publishing Puppet Modules
Writing and Publishing Puppet Modules
 
NodeJs
NodeJsNodeJs
NodeJs
 
Puppet
PuppetPuppet
Puppet
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvars
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Puppet overview

  • 2. About Me: Miguel Rodrigues DevOps using puppet 3 years lousy creator of slidesets
  • 3. What is puppet CM tool - Bring running systems to consistent state; Despite the starting point systems will end in the same point, in a repeatable and predictable way; Other CM tools : Chef, Ansible, Salt, Capistrano…..
  • 4. What is the need for a CM ? Admin one, two … servers is nice … do it on 1000 is awful boring repeatable ….. To Err is Human; To Really Foul Things Up Requires a Computer…. image the mess in 100's or 1000's of computers
  • 5. @WikiLovers Started by Luke Kanies in 2005 founded Puppet Labs GPL Unix* and Windows Ruby Have one language (DSL) more details: Wiki for it ;-)
  • 6. Declare where you want to be ( not how to get there ) - presenting Manifest’s file: some_manifest.pp node ‘some_name_or_ip’ { …. do_stuff_to_get_servers_where_You_want …. } puppet apply some_manifest.pp
  • 7. Hold on … Are there any requisites ? Need running system ( bootstrapping is another issue, more on that later ) puppet installed ( How2 and dependencies are OS specific )
  • 8. Do Stuff puppet apply classes to nodes classes are set of resources and resources are ….
  • 9. Some Resources Examples package file service cron exec notify user ….. Full list of resources at https://docs.puppetlabs.com/references/latest/type.html
  • 10. Facts: "that is life" We take decisions based on facts , so puppet can do it Facts are variables to puppet environment facts others ( eg: this server is “yellow”) facts can ( should be ) used in classes
  • 12. Ntp and Time, one classic example Challenge What time is it ? Systems need to be accurate update logs with timestamps do action based on time Network Time Protocol (NTP) is a networking protocol for clock synchronization
  • 13. Basic Ntp on a server (variables, resources and templates) file: some_manifest.pp node ‘some_name_or_ip’ { $package_name= “ntp” $host_config = “xpto” $ntp1 = “ip_or_address_1” $ntp2 = “ip_or_address_2” package { $package_name: ensure => installed, } file { 'ntp_config_file': ensure => file, path => '/etc/ntp.conf', require => Package[$package_name], content => template('ntp.conf.erb'), mode => '0644', owner => 'root', group => 'root', } (variables in orange and resources in red) service { 'ntpd': ensure => running, name => 'ntpd', enable => true, subscribe => File['ntp_config_file'], } } puppet apply some_manifest.pp
  • 14. Templates … Files Files are used to configure services The content can be static ;-( or should be based on environment Templates can add Dynamic content Based on variables have ruby logic in it ( if/else, cycles, …. )
  • 15. Ntp template (ntp.conf.erb)- template example restrict default ignore <% if @host_config == "some_value" -%> server <%= @ntp1 %> <% else -%> server <%= @ntp2 %> <% end -%> server 127.127.1.0 fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift broadcastdelay 0.008 keys /etc/ntp/keys restrict 127.0.0.1
  • 16. Not a clever way to code , Modules are here Modules are self- contained bundles of code and data. file: some_manifest.pp node ‘some_name_or_ip’ {class { 'my_ntp_module':}} file: ./modules/my_ntp_module/manifests/init.pp class my_ntp_module { …. same do_stuff …. file { 'ntp.conf': …. content => template('my_ntp_module/ntp.conf.erb'), .. } } file:./modules/my_ntp_module/templates/ntp.conf.erb puppet apply --modulepath ./modules/some_manifest.pp
  • 17. Clever Modules … Arguments file: ./modules/my_ntp_module/manifests/init.pp class my_ntp_module ($package_name, $host_config, $ntp1, $ntp2) { …. same do_stuff …. } } file: some_manifest.pp node ‘some_name_or_ip’ {class { 'my_ntp_module': package_name => “ntp” host_config =>“xpto” ntp1 => “ip_or_address_1” ntp2 =>“ip_or_address_2” }} puppet apply --modulepath ./modules some_manifest.pp
  • 18. Code and data “all together” :-(... welcome to backends (Hiera) Purpose separate data ( values) from logic (code) support multiple data types (values, list, hash ….) Hiera is a key/value lookup tool for configuration data Hiera can use several different data backends, including two built-in backends ( yaml and JSON ) and other optional ones.
  • 19. Data Encryption Why ? Secrets should be kept … secret “someone” should know about Secrets Backends may be encrypted when and where needed for a list of “trusted persons"
  • 20. Modules with backend file: ./modules/my_ntp_module/manifests/init.pp class my_ntp_module ($package_name, $host_config, $ntp1, $ntp2) { …. same do_stuff …. } } file: some_manifest.pp node default { hiera_include('classes')} node ‘same_name_or_ip’ {class { 'my_ntp_module':}} file: hieradata/backend.yaml my_ntp_module::package_name: “ntp” my_ntp_module::host_config: “xpto” my_ntp_module::ntp1: “ip_or_address_1” my_ntp_module::ntp2: “ip_or_address_2” puppet apply --modulepath ./modules --hiera_config hiera.yaml -- some_manifest.pp
  • 21. Where Manifests (and related stuff) are? Manifests (and resources specified in it) must exist on the system at the time they are applied They go there “by magic”: “Someone” send them to the system ( push approach) fetched from some place ( eg: VCS like git, svn, … ) (pull approach ) “just are there”
  • 22. Bootstrapping Servers How ? :-( “manually” CF/ AMI …. in AWS PXE boot ( in “DC”) Heat ( in Openstack) others ...
  • 23. Bootstrapping Servers - Process (1) 1.Install OS 2.“Hard” install a.Set keys for VCS authorization b.Set facts for the host (product/env/role/location/… ) c.Set hostname, and "basic stuff"
  • 24. Bootstrapping Servers - Process (2) 3.“Soft” install a.Fetch manifests code and backend data from VCS based on facts b.Apply puppet