SlideShare a Scribd company logo
1 of 51
Download to read offline
Moving from Exec to Types and
Providers
This is not a talk, more a story.
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
example42 GmbH - Berlin / Germany
Martin Alfke
CEO & Co-Founder
2
The Story begins ...
Part #1 - Puppet Module using Exec CLI
3
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Puppet Module for VM management system
4
OpenNebula config concept - Image taken from opennebula.org
Solution 1 - Exec Resource Type
Run the CLI tools
5
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Exec Resource Type
6
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Exec Resource Type
● one-time commands
● does not deal well with changes
(yes, you can use refreshonly =>
true)
● was only capable of managing
all artefacts of a configuration
7
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Exec Resource Type
● root Shell with empty
environment
● “Emergency Exit” (Luke
Kanies - Berlin - Q4/2015)
8
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Exec Resource Type
9
The Story continues ...
Part #2 - Puppet Module using Defined Resource Types
10
Solution 2 - Defined Resource Type
File - Service Pattern
11
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Defined Resource Type
● (Package) - File - Service
pattern
● self defined resource type as
wrapper
● config artefact per title (data
from hash)
12
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Defined Resource Type
13
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Defined Resource Type
● Service Resource
● Always check hasrestart, hasstatus options
● Possibility to manage individual config artefacts
● Difficulty when changing parameters of an existing config
artefact -> restart = stop, start
● Wrapper shell script -> Exec replacement
14
The Story continues ...
Part #3 - Puppet Module using Custom Resource Types
15
Solution 3 - Custom Resource Type
Idempotent, non-breaking, prefetch capable configuration
16
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Custom Resource Type
17
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Custom Resource Type
18
Types and Providers
Basic concept
19
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Types and Providers
● Are CLI tools / API’s available
?
● Can output be rendered in
structured data ?
20
Types
Describe Puppet DSL Syntax
21
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Type - Beginning
22
<module>/lib/puppet/type/my_file.rb
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Type - Properties and Parameters
● Properties
● everything you can set or modify (e.g. UID)
● Parameters
● change the way how the provider works (e.g. managehome)
23
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Type - Properties and Parameters
24
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Type - DSL
25
Providers
Command Logic
26
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Provider - Beginning
27
<module>/lib/puppet/provider/my_file/ruby.rb
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Provider - Running commands
28
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Provider - Properties and Parameters
● Getter
● read the existing state of an attribute
● Setter
● set the desired state of an attribute
● Idempotency
29
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Provider - Getters and Setters
30
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Provider - Create and Destroy
31
Types and Providers
Part #4 - Do’s and don’t’s
32
Dont’s
What you don’t want to do - please.
33
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Types and Providers
● exec in custom Providers
● running %x(...) or exec(...)
● use of restricted words
34
Do
What you want to do.
35
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Types and Providers
● one type
● one or more providers
● What do you want to manage?
● What may be changed ?
● What can be set on creation only ?
36
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Types and Providers
● Multiple providers will allow you
to react on
● New SW version with new CLI
format or new commands
● Different SW usage on
different OS
37
Why Types and Providers
Manage an Enterprise Application
38
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Types and Providers
● Vendor forbids to edit config
files
● Vendor insists in using CLI tools
● e.g. IBM WebSphere
39
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Dear Enterprise Software producers
● give us code for our CfgMgmt
tool
● we want one tool to manage
everything
● we want to still have your
support for your software
40
Types and Providers
Part #5 - How to start
41
Ruby
Version and Tools
42
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Ruby - Version and Tools
● Don’t mess your system Ruby
● RVM / rbenv
● Gems
● bundler
● wirble
● pry
43
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Ruby - ~/.irbrc
44
Types & Providers
Implementation Examples
45
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Types & Providers - Examples
● Books
● https://www.amazon.com/Puppet-Types-Providers-Dan-Bode/
dp/1449339328
● Blogs
● http://garylarizza.com/blog/2013/11/25/fun-with-providers/
● https://www.enterprisemodules.com/blog/2014/01/puppet-
custom-types-the-easy-way/
● http://www.datacentred.co.uk/blog/puppet-custom-types/
46
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Types & Providers - Examples
● Docs
● https://docs.puppet.com/guides/custom_types.html
● https://docs.puppet.com/guides/provider_development.html
● https://docs.puppet.com/puppet/latest/reference/
lang_reserved.html
● Talks
● http://www.slideshare.net/TimCinel/writing-custom-puppet-
types-and-providers-to-manage-webbased-applications
47
Types and Providers
Part #6 - Summary
48
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Moving from Exec to Types and Providers - Summary
● Exec is for one time commands only -
it is an emergency exit
● Types and Providers are not difficult
● Types have the Puppet DSL syntax,
Providers have Logic and Commands
49
Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016
Moving from Exec to Types and Providers - Summary
● Ruby is easy to learn
● Start with IRB + Wirble
● Use Pry Gem for debugging
● Start doing configuration the right way
● Use Puppet’s power for Extensions
50
PuppetConf 2016 Moving from Exec to Types and Provides

More Related Content

What's hot

What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
Simplilearn
 
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlantaPlugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Alexandre Gouaillard
 
Building Eclipse Plugins and RCP applications with Tycho
Building Eclipse Plugins and RCP applications with TychoBuilding Eclipse Plugins and RCP applications with Tycho
Building Eclipse Plugins and RCP applications with Tycho
jsievers
 

What's hot (20)

What's New in Plug-in Development (Galileo)
What's New in Plug-in Development (Galileo)What's New in Plug-in Development (Galileo)
What's New in Plug-in Development (Galileo)
 
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)
 
Maven 3 / Tycho
Maven 3 / TychoMaven 3 / Tycho
Maven 3 / Tycho
 
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
 
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
 
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlantaPlugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
 
FAST for SharePoint Deep Dive
FAST for SharePoint Deep DiveFAST for SharePoint Deep Dive
FAST for SharePoint Deep Dive
 
Using Docker in CI process
Using Docker in CI processUsing Docker in CI process
Using Docker in CI process
 
Continuous Integration Testing Techniques to Improve Chef Cookbook Quality
Continuous Integration Testing Techniques to Improve Chef Cookbook QualityContinuous Integration Testing Techniques to Improve Chef Cookbook Quality
Continuous Integration Testing Techniques to Improve Chef Cookbook Quality
 
Building Eclipse Plugins and RCP applications with Tycho
Building Eclipse Plugins and RCP applications with TychoBuilding Eclipse Plugins and RCP applications with Tycho
Building Eclipse Plugins and RCP applications with Tycho
 
10 things you need to know to deliver a successful Alfresco project
10 things you need to know to deliver a successful Alfresco project10 things you need to know to deliver a successful Alfresco project
10 things you need to know to deliver a successful Alfresco project
 
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
 
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsMigrating from PDE to Tycho builds
Migrating from PDE to Tycho builds
 
Wuff: Building Eclipse Applications and Plugins with Gradle
Wuff: Building Eclipse Applications and Plugins with GradleWuff: Building Eclipse Applications and Plugins with Gradle
Wuff: Building Eclipse Applications and Plugins with Gradle
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Continuous Deployment To The Cloud @DevoxxPL 2017
Continuous Deployment To The Cloud @DevoxxPL 2017 Continuous Deployment To The Cloud @DevoxxPL 2017
Continuous Deployment To The Cloud @DevoxxPL 2017
 
Drupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond JenkinsDrupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond Jenkins
 
Foundations for the perfect technology stream
Foundations for the perfect technology streamFoundations for the perfect technology stream
Foundations for the perfect technology stream
 
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
 
Turnkey Continuous Delivery
Turnkey Continuous DeliveryTurnkey Continuous Delivery
Turnkey Continuous Delivery
 

Similar to PuppetConf 2016 Moving from Exec to Types and Provides

Similar to PuppetConf 2016 Moving from Exec to Types and Provides (20)

Trunk based development
Trunk based developmentTrunk based development
Trunk based development
 
Angular TS(typescript)
Angular TS(typescript)Angular TS(typescript)
Angular TS(typescript)
 
Continuous Deployment To The Cloud
Continuous Deployment To The CloudContinuous Deployment To The Cloud
Continuous Deployment To The Cloud
 
An introduction to Emulsify
An introduction to EmulsifyAn introduction to Emulsify
An introduction to Emulsify
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code clean
 
The Top 5 Practices of a Highly Successful ChangeMan ZMF Administrator
The Top 5 Practices of a Highly Successful ChangeMan ZMF AdministratorThe Top 5 Practices of a Highly Successful ChangeMan ZMF Administrator
The Top 5 Practices of a Highly Successful ChangeMan ZMF Administrator
 
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
 
Ff for product success
Ff for product successFf for product success
Ff for product success
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016
 
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
 
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Continuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfestContinuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfest
 
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
 
Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentation
 
What's New in Primavera 15.2 Webcast
What's New in Primavera 15.2 WebcastWhat's New in Primavera 15.2 Webcast
What's New in Primavera 15.2 Webcast
 
An intuitive guide to combining free monad and free applicative
An intuitive guide to combining free monad and free applicativeAn intuitive guide to combining free monad and free applicative
An intuitive guide to combining free monad and free applicative
 

More from Martin Alfke

Gluster fs buero20_presentation
Gluster fs buero20_presentationGluster fs buero20_presentation
Gluster fs buero20_presentation
Martin Alfke
 
Puppet buero20 presentation
Puppet buero20 presentationPuppet buero20 presentation
Puppet buero20 presentation
Martin Alfke
 

More from Martin Alfke (15)

CfgMgmtCamp 2023 - Puppet is YAML.pdf
CfgMgmtCamp 2023 - Puppet is YAML.pdfCfgMgmtCamp 2023 - Puppet is YAML.pdf
CfgMgmtCamp 2023 - Puppet is YAML.pdf
 
HashiTalksDACH-Terraform-Managing training instances in the Cloud
HashiTalksDACH-Terraform-Managing training instances in the CloudHashiTalksDACH-Terraform-Managing training instances in the Cloud
HashiTalksDACH-Terraform-Managing training instances in the Cloud
 
PuppetCamp2021-Testing Modules and ControlRepo.pdf
PuppetCamp2021-Testing Modules and ControlRepo.pdfPuppetCamp2021-Testing Modules and ControlRepo.pdf
PuppetCamp2021-Testing Modules and ControlRepo.pdf
 
OpenRheinRuhr 2018 - Ops hates containers! Why?
OpenRheinRuhr 2018 - Ops hates containers! Why?OpenRheinRuhr 2018 - Ops hates containers! Why?
OpenRheinRuhr 2018 - Ops hates containers! Why?
 
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
 
Power of Puppet 4
Power of Puppet 4Power of Puppet 4
Power of Puppet 4
 
Can you upgrade to Puppet 4.x?
Can you upgrade to Puppet 4.x?Can you upgrade to Puppet 4.x?
Can you upgrade to Puppet 4.x?
 
Upgrading Puppet CommitterConf Essen 2014
Upgrading Puppet CommitterConf Essen 2014Upgrading Puppet CommitterConf Essen 2014
Upgrading Puppet CommitterConf Essen 2014
 
GUUG Hamburg OpenNebula
GUUG Hamburg OpenNebulaGUUG Hamburg OpenNebula
GUUG Hamburg OpenNebula
 
Puppet camp london-modulerewritingsmartway
Puppet camp london-modulerewritingsmartwayPuppet camp london-modulerewritingsmartway
Puppet camp london-modulerewritingsmartway
 
One
OneOne
One
 
Puppet future parser
Puppet future parserPuppet future parser
Puppet future parser
 
developing sysadmin, sysadmining developersGuug devops puppet
developing sysadmin, sysadmining developersGuug devops puppetdeveloping sysadmin, sysadmining developersGuug devops puppet
developing sysadmin, sysadmining developersGuug devops puppet
 
Gluster fs buero20_presentation
Gluster fs buero20_presentationGluster fs buero20_presentation
Gluster fs buero20_presentation
 
Puppet buero20 presentation
Puppet buero20 presentationPuppet buero20 presentation
Puppet buero20 presentation
 

Recently uploaded

Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
galaxypingy
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
Asmae Rabhi
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 

Recently uploaded (20)

Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 

PuppetConf 2016 Moving from Exec to Types and Provides

  • 1. Moving from Exec to Types and Providers This is not a talk, more a story.
  • 2. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 example42 GmbH - Berlin / Germany Martin Alfke CEO & Co-Founder 2
  • 3. The Story begins ... Part #1 - Puppet Module using Exec CLI 3
  • 4. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Puppet Module for VM management system 4 OpenNebula config concept - Image taken from opennebula.org
  • 5. Solution 1 - Exec Resource Type Run the CLI tools 5
  • 6. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Exec Resource Type 6
  • 7. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Exec Resource Type ● one-time commands ● does not deal well with changes (yes, you can use refreshonly => true) ● was only capable of managing all artefacts of a configuration 7
  • 8. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Exec Resource Type ● root Shell with empty environment ● “Emergency Exit” (Luke Kanies - Berlin - Q4/2015) 8
  • 9. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Exec Resource Type 9
  • 10. The Story continues ... Part #2 - Puppet Module using Defined Resource Types 10
  • 11. Solution 2 - Defined Resource Type File - Service Pattern 11
  • 12. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Defined Resource Type ● (Package) - File - Service pattern ● self defined resource type as wrapper ● config artefact per title (data from hash) 12
  • 13. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Defined Resource Type 13
  • 14. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Defined Resource Type ● Service Resource ● Always check hasrestart, hasstatus options ● Possibility to manage individual config artefacts ● Difficulty when changing parameters of an existing config artefact -> restart = stop, start ● Wrapper shell script -> Exec replacement 14
  • 15. The Story continues ... Part #3 - Puppet Module using Custom Resource Types 15
  • 16. Solution 3 - Custom Resource Type Idempotent, non-breaking, prefetch capable configuration 16
  • 17. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Custom Resource Type 17
  • 18. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Custom Resource Type 18
  • 20. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Types and Providers ● Are CLI tools / API’s available ? ● Can output be rendered in structured data ? 20
  • 22. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Type - Beginning 22 <module>/lib/puppet/type/my_file.rb
  • 23. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Type - Properties and Parameters ● Properties ● everything you can set or modify (e.g. UID) ● Parameters ● change the way how the provider works (e.g. managehome) 23
  • 24. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Type - Properties and Parameters 24
  • 25. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Type - DSL 25
  • 27. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Provider - Beginning 27 <module>/lib/puppet/provider/my_file/ruby.rb
  • 28. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Provider - Running commands 28
  • 29. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Provider - Properties and Parameters ● Getter ● read the existing state of an attribute ● Setter ● set the desired state of an attribute ● Idempotency 29
  • 30. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Provider - Getters and Setters 30
  • 31. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Provider - Create and Destroy 31
  • 32. Types and Providers Part #4 - Do’s and don’t’s 32
  • 33. Dont’s What you don’t want to do - please. 33
  • 34. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Types and Providers ● exec in custom Providers ● running %x(...) or exec(...) ● use of restricted words 34
  • 35. Do What you want to do. 35
  • 36. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Types and Providers ● one type ● one or more providers ● What do you want to manage? ● What may be changed ? ● What can be set on creation only ? 36
  • 37. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Types and Providers ● Multiple providers will allow you to react on ● New SW version with new CLI format or new commands ● Different SW usage on different OS 37
  • 38. Why Types and Providers Manage an Enterprise Application 38
  • 39. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Types and Providers ● Vendor forbids to edit config files ● Vendor insists in using CLI tools ● e.g. IBM WebSphere 39
  • 40. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Dear Enterprise Software producers ● give us code for our CfgMgmt tool ● we want one tool to manage everything ● we want to still have your support for your software 40
  • 41. Types and Providers Part #5 - How to start 41
  • 43. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Ruby - Version and Tools ● Don’t mess your system Ruby ● RVM / rbenv ● Gems ● bundler ● wirble ● pry 43
  • 44. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Ruby - ~/.irbrc 44
  • 46. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Types & Providers - Examples ● Books ● https://www.amazon.com/Puppet-Types-Providers-Dan-Bode/ dp/1449339328 ● Blogs ● http://garylarizza.com/blog/2013/11/25/fun-with-providers/ ● https://www.enterprisemodules.com/blog/2014/01/puppet- custom-types-the-easy-way/ ● http://www.datacentred.co.uk/blog/puppet-custom-types/ 46
  • 47. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Types & Providers - Examples ● Docs ● https://docs.puppet.com/guides/custom_types.html ● https://docs.puppet.com/guides/provider_development.html ● https://docs.puppet.com/puppet/latest/reference/ lang_reserved.html ● Talks ● http://www.slideshare.net/TimCinel/writing-custom-puppet- types-and-providers-to-manage-webbased-applications 47
  • 48. Types and Providers Part #6 - Summary 48
  • 49. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Moving from Exec to Types and Providers - Summary ● Exec is for one time commands only - it is an emergency exit ● Types and Providers are not difficult ● Types have the Puppet DSL syntax, Providers have Logic and Commands 49
  • 50. Moving from Exec to Types and providers - Martin Alfke © example42 GmbH 2016 Moving from Exec to Types and Providers - Summary ● Ruby is easy to learn ● Start with IRB + Wirble ● Use Pry Gem for debugging ● Start doing configuration the right way ● Use Puppet’s power for Extensions 50