SlideShare una empresa de Scribd logo
1 de 41
Descargar para leer sin conexión
R.I.Pienaar
PuppetConf 2016
External Data in Puppet 4
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Who am I?
• Puppet User since 0.22
• Really into external data
• Author facts.d, extlookup, Hiera, MCollective
• Consultant - DevOps, Automation,
Architect, Development
• Open Source @ github.com/ripienaar
• Volcane on IRC
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
External Data
Is Configuration For
Your Code
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Hierarchical Data
class monitor (
Array[Monitor::Plugin] $plugins = []
) {
…
}
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Hierarchical Data
class{“monitor”:
plugins => [
“cpu",
“write_graphite”,
“df”, …
]
}
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Automatic Param Lookup
include monitor
# hieradb/nodes/host1.yaml
monitor::plugins:
- my_app
class{“monitor”:
plugins => [
“my_app”, “cpu”, “df”, …
]
}
+
=
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Hierarchical Data
host1 host2 host3 host4 host5 host6
prod stage dev
dc1 dc2
Site wide common data
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Hierarchical Data
host1 host2 host3 host4 host5 host6
prod stage dev
dc1 dc2
Site wide common data
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Hierarchical Data
host1 host2 host3 host4 host5 host6
prod stage dev
dc1 dc2
Site wide common data
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Hierarchical Data
host1 host2 host3 host4 host5 host6
prod stage dev
dc1 dc2
Site wide common data
$trusted[“certname”]
$environment
$facts[“dc”]
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Automatic Param Lookup
include monitor
# hieradb/nodes/host1.yaml
monitor::plugins:
- my_app
class{“monitor”:
plugins => [
“my_app”, “cpu”, “df”, …
]
}
+
=
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup
• lookup() function replaces hiera*()
• Automatic Param Lookup more useful
• environment and module aware
• Great CLI
• YAML/JSON out of the box, more to come
• Data compatible with Hiera, cohabits with
Hiera
• Pluggable
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - CLI
$ puppet lookup monitor::plugins —merge unique
——
- my_app
- write_graphite
- cpu
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
$ puppet lookup monitor::plugins —merge unique —explain
Merge strategy unique
…
Data Provider "Nodes"
Path “/etc/…/production/data/nodes/dev3.devco.net.yaml”
Original path: "nodes/%{trusted.certname}"
Found key: "monitor::plugins" value: [
"my_app"
]
…
Data Provider "common"
Path “/etc/…/data/common.yaml”
Original path: "common"
Found key: "monitor::plugins" value: [
"cpu",
"write_graphite"
]
…
Merged result: [
"my_app",
"cpu",
"write_graphite"
]
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
$ puppet lookup monitor::plugins —merge unique —explain
Merge strategy unique
…
Data Provider "Nodes"
Path “/etc/…/production/data/nodes/dev3.devco.net.yaml”
Original path: "nodes/%{trusted.certname}"
Found key: "monitor::plugins" value: [
"my_app"
]
…
Data Provider "common"
Path “/etc/…/data/common.yaml”
Original path: "common"
Found key: "monitor::plugins" value: [
"cpu",
"write_graphite"
]
…
Merged result: [
"my_app",
"cpu",
"write_graphite"
]
Every tier
Final result
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - Config
# environments/production/hiera.yaml
---
version: 4
datadir: data
hierarchy:
- name: "Nodes"
backend: yaml
path: "nodes/%{trusted.certname}"
- name: "common"
backend: yaml
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$plugins = lookup(“monitor::plugins”)
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$plugins = lookup(“monitor::plugins”, {
“value_type” => Array[Monitor::Plugin],
“default_value” => [“cpu”, …]
})
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
function monitor::params() {
$result = {
“monitor::plugins” => [
“cpu”, …
]
}
}
$plugins = lookup(“monitor::plugins”, {
“default_value_hash” => monitor::params()
})
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$servers = lookup(“monitor::plugins”, {
“merge” => “first”
})
Default behaviour
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$servers = lookup(“monitor::plugins”, {
“merge” => “unique”
})
Array Merge (hiera_array())
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$servers = lookup(“monitor::plugins”, {
“merge” => “hash”
})
Shallow Hash Merge (hiera_hash())
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$servers = lookup(“monitor::plugins”, {
“merge” => “deep”,
})
Deep Hash Merge
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
# common.yaml
users::local:
rip:
email: “rip@devco.net"
comment: “R.I.Pienaar”
sudoer: true
shell: “/bin/zsh”
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
# nodes/dev3.devco.net
users::local:
rip:
email: “arri.pienaar@client.com”
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$ puppet lookup users::local —merge deep
---
rip:
email: arri.pienaar@client.com
comment: R.I.Pienaar
sudoer: true
shell: "/bin/zsh"
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Automatic Param Lookup
include monitor
# hieradb/nodes/host1.yaml
monitor::plugins:
- my_app
class{“monitor”:
plugins => [
“my_app”, “cpu”, “df”, …
]
}
+
=
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$lookup_options = {
“merge” => {
“strategy” => “unique”
}
}
$plugins = lookup(“monitor::plugins”, $lookup_options)
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - function
$plugins = lookup(“monitor::plugins”)
# hieradata/common.yaml
lookup_options:
monitor::plugins:
merge:
strategy: unique
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
include monitor
# …/production/hieradata/common.yaml
lookup_options:
monitor::plugins:
strategy: unique
monitor::plugins:
- cpu
- …
class monitor (
Array[Monitor::Plugin] $plugins = []
) {}
Lookup - function
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Lookup - Data In Modules
# modules/monitor/hiera.yaml
---
version: 4
datadir: "data"
hierarchy:
- name: "common"
backend: "yaml"
# modules/monitor/data/common.yaml
lookup_options:
monitor::plugins:
strategy: unique
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
include monitor
# hieradata/common.yaml
monitor::plugins:
- cpu
- write_graphite
Lookup - Data In Modules
# hieradata/nodes/node1.yaml
monitor::plugins:
- my_app
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Tips and Tricks
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
lookup(“classes”, {“merge” => “unique”}).include
hiera_include()
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
hiera_include()
# common.yaml
lookup_options:
classes:
merge:
strategy: “deep”
knockout_prefix: “-“
classes:
- nagios
# nodes/node1.yaml
classes:
- -nagios
- sensu
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
lookup(“classes”).include
hiera_include()
# common.yaml
lookup_options:
classes:
merge:
strategy: “deep”
knockout_prefix: “-“
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
params.pp
# modules/ntp/hiera.yaml
---
version: 4
datadir: data
hierarchy:
- name: "Operating System Family"
backend: yaml
path: "%{facts.os.family}"
- name: "common"
backend: yaml
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
params.pp
# modules/ntp/data/AIX.yaml
---
ntp::driftfile: '/etc/ntp.drift'
ntp::package_name:
- 'bos.net.tcp.client'
ntp::restrict:
- 'default nomodify notrap nopeer noquery'
- '127.0.0.1'
ntp::service_name: 'xntpd'
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
params.pp
# modules/ntp/data/Debian.yaml
ntp::restrict:
- '-4 default kod nomodify notrap nopeer noquery'
- '-6 default kod nomodify notrap nopeer noquery'
- '127.0.0.1'
- '::1'
ntp::service_name: 'ntp'
ntp::servers:
- '0.debian.pool.ntp.org'
- '1.debian.pool.ntp.org'
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Future
• Hiera deprecated
• No more site wide hiera, only environment
and modules
• Pluggable via functions in modules - native or
ruby, much much simpler than old backends
• lookup.yaml or lookup.conf
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Questions?
twitter: @ripienaar
email: rip@devco.net
blog: www.devco.net
github: ripienaar
freenode: Volcane
slack.puppet.com: ripienaar
https://www.devco.net/

Más contenido relacionado

La actualidad más candente

Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Robert Nelson
 
EuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystifiedEuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystifiedPablo Enfedaque
 
Introduction to Marionette Collective
Introduction to Marionette CollectiveIntroduction to Marionette Collective
Introduction to Marionette CollectivePuppet
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Apollo ecosystem
Apollo ecosystemApollo ecosystem
Apollo ecosystemJames Akwuh
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansiblebcoca
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoBrian Hogan
 
Puppet control-repo 
to the next level
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next levelAlessandro Franceschi
 
Django productivity tips and tricks
Django productivity tips and tricksDjango productivity tips and tricks
Django productivity tips and tricksSimone Federici
 
Webinar - Windows Application Management with Puppet
Webinar - Windows Application Management with PuppetWebinar - Windows Application Management with Puppet
Webinar - Windows Application Management with PuppetOlinData
 
GenStage and Flow - Jose Valim
GenStage and Flow - Jose Valim GenStage and Flow - Jose Valim
GenStage and Flow - Jose Valim Elixir Club
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with PuppetOlinData
 
Perl in the Internet of Things
Perl in the Internet of ThingsPerl in the Internet of Things
Perl in the Internet of ThingsDave Cross
 
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San FranciscoWebpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San FranciscoRyan Weaver
 
Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)Martin Schütte
 

La actualidad más candente (20)

Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
 
EuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystifiedEuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystified
 
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
 
Refactoring Infrastructure Code
Refactoring Infrastructure CodeRefactoring Infrastructure Code
Refactoring Infrastructure Code
 
Introduction to Marionette Collective
Introduction to Marionette CollectiveIntroduction to Marionette Collective
Introduction to Marionette Collective
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Apollo ecosystem
Apollo ecosystemApollo ecosystem
Apollo ecosystem
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with Hugo
 
Puppet control-repo 
to the next level
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next level
 
Refactoring terraform
Refactoring terraformRefactoring terraform
Refactoring terraform
 
Django productivity tips and tricks
Django productivity tips and tricksDjango productivity tips and tricks
Django productivity tips and tricks
 
Webinar - Windows Application Management with Puppet
Webinar - Windows Application Management with PuppetWebinar - Windows Application Management with Puppet
Webinar - Windows Application Management with Puppet
 
GenStage and Flow - Jose Valim
GenStage and Flow - Jose Valim GenStage and Flow - Jose Valim
GenStage and Flow - Jose Valim
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
 
Perl in the Internet of Things
Perl in the Internet of ThingsPerl in the Internet of Things
Perl in the Internet of Things
 
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San FranciscoWebpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San Francisco
 
Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)
 
Concurrecny inf sharp
Concurrecny inf sharpConcurrecny inf sharp
Concurrecny inf sharp
 

Similar a External Data in Puppet 4

PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsGraham Dumpleton
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with BackstageOpsta
 
Pemrograman Python untuk Pemula
Pemrograman Python untuk PemulaPemrograman Python untuk Pemula
Pemrograman Python untuk PemulaOon Arfiandwi
 
Hands-on go profiling
Hands-on go profilingHands-on go profiling
Hands-on go profilingDaniel Ammar
 
Large Scale Continuous Delivery
Large Scale Continuous DeliveryLarge Scale Continuous Delivery
Large Scale Continuous Deliveryripienaar
 
Introduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R ShinyIntroduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R Shinyanamarisaguedes
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
Monitoring using Sensu
Monitoring using SensuMonitoring using Sensu
Monitoring using Sensuripienaar
 
Introduction to Configuration Management
Introduction to Configuration ManagementIntroduction to Configuration Management
Introduction to Configuration Managementripienaar
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Innomatic Platform
 
Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.CocoaHeads France
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with pythonroskakori
 
Advanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automationAdvanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automationCysinfo Cyber Security Community
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using DjangoSunil kumar Mohanty
 
2nd Content Providers Community Call
2nd Content Providers Community Call2nd Content Providers Community Call
2nd Content Providers Community CallOpenAIRE
 
Website Testing Practices
Website Testing PracticesWebsite Testing Practices
Website Testing Practicesdeseomar
 

Similar a External Data in Puppet 4 (20)

PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
Pemrograman Python untuk Pemula
Pemrograman Python untuk PemulaPemrograman Python untuk Pemula
Pemrograman Python untuk Pemula
 
Hands-on go profiling
Hands-on go profilingHands-on go profiling
Hands-on go profiling
 
Large Scale Continuous Delivery
Large Scale Continuous DeliveryLarge Scale Continuous Delivery
Large Scale Continuous Delivery
 
Introduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R ShinyIntroduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R Shiny
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Monitoring using Sensu
Monitoring using SensuMonitoring using Sensu
Monitoring using Sensu
 
Introduction to Configuration Management
Introduction to Configuration ManagementIntroduction to Configuration Management
Introduction to Configuration Management
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
 
Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with python
 
Advanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automationAdvanced malware analysis training session5 reversing automation
Advanced malware analysis training session5 reversing automation
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using Django
 
实战Ecos
实战Ecos实战Ecos
实战Ecos
 
2nd Content Providers Community Call
2nd Content Providers Community Call2nd Content Providers Community Call
2nd Content Providers Community Call
 
router-simple.cr
router-simple.crrouter-simple.cr
router-simple.cr
 
Mini Curso de Django
Mini Curso de DjangoMini Curso de Django
Mini Curso de Django
 
Website Testing Practices
Website Testing PracticesWebsite Testing Practices
Website Testing Practices
 

Último

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
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 WorkerThousandEyes
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Último (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

External Data in Puppet 4

  • 2. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Who am I? • Puppet User since 0.22 • Really into external data • Author facts.d, extlookup, Hiera, MCollective • Consultant - DevOps, Automation, Architect, Development • Open Source @ github.com/ripienaar • Volcane on IRC
  • 3. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar External Data Is Configuration For Your Code
  • 4. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Hierarchical Data class monitor ( Array[Monitor::Plugin] $plugins = [] ) { … }
  • 5. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Hierarchical Data class{“monitor”: plugins => [ “cpu", “write_graphite”, “df”, … ] }
  • 6. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Automatic Param Lookup include monitor # hieradb/nodes/host1.yaml monitor::plugins: - my_app class{“monitor”: plugins => [ “my_app”, “cpu”, “df”, … ] } + =
  • 7. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Hierarchical Data host1 host2 host3 host4 host5 host6 prod stage dev dc1 dc2 Site wide common data
  • 8. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Hierarchical Data host1 host2 host3 host4 host5 host6 prod stage dev dc1 dc2 Site wide common data
  • 9. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Hierarchical Data host1 host2 host3 host4 host5 host6 prod stage dev dc1 dc2 Site wide common data
  • 10. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Hierarchical Data host1 host2 host3 host4 host5 host6 prod stage dev dc1 dc2 Site wide common data $trusted[“certname”] $environment $facts[“dc”]
  • 11. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Automatic Param Lookup include monitor # hieradb/nodes/host1.yaml monitor::plugins: - my_app class{“monitor”: plugins => [ “my_app”, “cpu”, “df”, … ] } + =
  • 12. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup • lookup() function replaces hiera*() • Automatic Param Lookup more useful • environment and module aware • Great CLI • YAML/JSON out of the box, more to come • Data compatible with Hiera, cohabits with Hiera • Pluggable
  • 13. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - CLI $ puppet lookup monitor::plugins —merge unique —— - my_app - write_graphite - cpu
  • 14. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar $ puppet lookup monitor::plugins —merge unique —explain Merge strategy unique … Data Provider "Nodes" Path “/etc/…/production/data/nodes/dev3.devco.net.yaml” Original path: "nodes/%{trusted.certname}" Found key: "monitor::plugins" value: [ "my_app" ] … Data Provider "common" Path “/etc/…/data/common.yaml” Original path: "common" Found key: "monitor::plugins" value: [ "cpu", "write_graphite" ] … Merged result: [ "my_app", "cpu", "write_graphite" ]
  • 15. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar $ puppet lookup monitor::plugins —merge unique —explain Merge strategy unique … Data Provider "Nodes" Path “/etc/…/production/data/nodes/dev3.devco.net.yaml” Original path: "nodes/%{trusted.certname}" Found key: "monitor::plugins" value: [ "my_app" ] … Data Provider "common" Path “/etc/…/data/common.yaml” Original path: "common" Found key: "monitor::plugins" value: [ "cpu", "write_graphite" ] … Merged result: [ "my_app", "cpu", "write_graphite" ] Every tier Final result
  • 16. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - Config # environments/production/hiera.yaml --- version: 4 datadir: data hierarchy: - name: "Nodes" backend: yaml path: "nodes/%{trusted.certname}" - name: "common" backend: yaml
  • 17. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $plugins = lookup(“monitor::plugins”)
  • 18. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $plugins = lookup(“monitor::plugins”, { “value_type” => Array[Monitor::Plugin], “default_value” => [“cpu”, …] })
  • 19. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function function monitor::params() { $result = { “monitor::plugins” => [ “cpu”, … ] } } $plugins = lookup(“monitor::plugins”, { “default_value_hash” => monitor::params() })
  • 20. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $servers = lookup(“monitor::plugins”, { “merge” => “first” }) Default behaviour
  • 21. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $servers = lookup(“monitor::plugins”, { “merge” => “unique” }) Array Merge (hiera_array())
  • 22. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $servers = lookup(“monitor::plugins”, { “merge” => “hash” }) Shallow Hash Merge (hiera_hash())
  • 23. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $servers = lookup(“monitor::plugins”, { “merge” => “deep”, }) Deep Hash Merge
  • 24. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function # common.yaml users::local: rip: email: “rip@devco.net" comment: “R.I.Pienaar” sudoer: true shell: “/bin/zsh”
  • 25. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function # nodes/dev3.devco.net users::local: rip: email: “arri.pienaar@client.com”
  • 26. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $ puppet lookup users::local —merge deep --- rip: email: arri.pienaar@client.com comment: R.I.Pienaar sudoer: true shell: "/bin/zsh"
  • 27. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Automatic Param Lookup include monitor # hieradb/nodes/host1.yaml monitor::plugins: - my_app class{“monitor”: plugins => [ “my_app”, “cpu”, “df”, … ] } + =
  • 28. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $lookup_options = { “merge” => { “strategy” => “unique” } } $plugins = lookup(“monitor::plugins”, $lookup_options)
  • 29. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - function $plugins = lookup(“monitor::plugins”) # hieradata/common.yaml lookup_options: monitor::plugins: merge: strategy: unique
  • 30. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar include monitor # …/production/hieradata/common.yaml lookup_options: monitor::plugins: strategy: unique monitor::plugins: - cpu - … class monitor ( Array[Monitor::Plugin] $plugins = [] ) {} Lookup - function
  • 31. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Lookup - Data In Modules # modules/monitor/hiera.yaml --- version: 4 datadir: "data" hierarchy: - name: "common" backend: "yaml" # modules/monitor/data/common.yaml lookup_options: monitor::plugins: strategy: unique
  • 32. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar include monitor # hieradata/common.yaml monitor::plugins: - cpu - write_graphite Lookup - Data In Modules # hieradata/nodes/node1.yaml monitor::plugins: - my_app
  • 33. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Tips and Tricks
  • 34. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar lookup(“classes”, {“merge” => “unique”}).include hiera_include()
  • 35. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar hiera_include() # common.yaml lookup_options: classes: merge: strategy: “deep” knockout_prefix: “-“ classes: - nagios # nodes/node1.yaml classes: - -nagios - sensu
  • 36. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar lookup(“classes”).include hiera_include() # common.yaml lookup_options: classes: merge: strategy: “deep” knockout_prefix: “-“
  • 37. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar params.pp # modules/ntp/hiera.yaml --- version: 4 datadir: data hierarchy: - name: "Operating System Family" backend: yaml path: "%{facts.os.family}" - name: "common" backend: yaml
  • 38. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar params.pp # modules/ntp/data/AIX.yaml --- ntp::driftfile: '/etc/ntp.drift' ntp::package_name: - 'bos.net.tcp.client' ntp::restrict: - 'default nomodify notrap nopeer noquery' - '127.0.0.1' ntp::service_name: 'xntpd'
  • 39. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar params.pp # modules/ntp/data/Debian.yaml ntp::restrict: - '-4 default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '::1' ntp::service_name: 'ntp' ntp::servers: - '0.debian.pool.ntp.org' - '1.debian.pool.ntp.org'
  • 40. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Future • Hiera deprecated • No more site wide hiera, only environment and modules • Pluggable via functions in modules - native or ruby, much much simpler than old backends • lookup.yaml or lookup.conf
  • 41. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Questions? twitter: @ripienaar email: rip@devco.net blog: www.devco.net github: ripienaar freenode: Volcane slack.puppet.com: ripienaar https://www.devco.net/