SlideShare a Scribd company logo
1 of 18
Download to read offline
Intro to PDK
Steven Pritchard
Onyx Point
Welcome to Intro to PDK!
System Integrity Management Platform (SIMP) Open Source stewards
DevOps, Compliance, and Automation consulting
Professional services for SIMP, Puppet, Red Hat®, and GitLab
Puppet Gold Partners
Steven Pritchard
Senior Consultant
Puppet Certified Professional (2017)
Linux and Open Source geek for over 20 years
Southern Illinois Linux Users Group
Vim Geeks
What is PDK?
The Puppet Development Kit (PDK) is an All‑In‑One set of tools for developing and testing Puppet
modules.
PDK includes a bundled version of Ruby plus various gems and utilities required for creating and
testing Puppet modules.
PDK was announced in August of 2017 with the goal of making it easier to build high‑quality
Puppet modules that follow best practices and use the available testing frameworks to avoid
deploying bad code to live infrastructure.
Installation
PDK packages for various Linux distributions, Windows, and MacOS X can be downloaded from
https://puppet.com/download‑puppet‑development‑kit.
https://puppet.com/docs/pdk/latest/pdk.html
Creating a Module - The Old Way
$ puppet module generate author-modulename --skip-interview
$ cd modulename
...Lots of editing...
$ puppet module build
...Upload to Forge...
What's Wrong With the Old Way?
Module skeleton quality varied wildly.
Often easier to create everything from scratch.
The skeleton was only used as an initial template.
puppet module generate was deprecated in Puppet 5.4.0.
Creating a Module - The New Way
$ pdk new module author-modulename
$ cd modulename
$ pdk new class modulename
...Lots of editing...
$ pdk validate
$ pdk test unit
$ pdk build
...Upload to Forge...
Why is this better?
Generated code follows best practices.
pdk new class classname creates manifests/classname.pp and
spec/classes/classname_spec.rb.
Testing out of the box!
The default templates (https://github.com/puppetlabs/pdk‑templates) include lots of
goodies:
CI configurations for Travis CI, GitLab CI/CD, and AppVeyor
operatingsystem_support and requirements in metadata.json
Git configuration (.gitignore, .gitattributes)
Puppet Strings in generated code
Updates to the templates can be applied to (some files in) the module.
Interaction with Ruby tooling ( bundle , rake ) is not required.
Did I mention that puppet module generate was deprecated in Puppet 5.4.0?
Using PDK
Create a new module
$ pdk new module mynewmodule
(Or you can skip the interview...)
$ pdk new module mynewmodule --skip-interview
Convert an existing module to PDK format
$ pdk convert
(Note that this does not add tests for existing classes, defined types, etc.)
Update from the templates in an existing PDK-format module
$ pdk update
Using PDK
Create a new class
$ pdk new class classname
Create a new defined type
$ pdk new defined_type typename
Create a new task
$ pdk new task taskname
Testing
Smoke tests (simple lint , rubocop , and parser checks) can be run with the following command:
$ pdk validate
Unit tests (Ruby scripts that use rspec‑puppet to test the contents of a compiled catalog) can be
executed with the following command:
$ pdk test unit
The default tests use rspec‑puppet‑facts to test catalog compilation on each supported OS.
https://puppet.com/docs/pdk/1.x/pdk_testing.html
pdk bundle
PDK allows you to run arbitrary bundle commands with pdk bundle . For example, to see what
rake tasks are available, you can run the following command:
$ pdk bundle exec rake -- -T
To see all output of the rake tasks run by pdk test unit , you can run the following command:
$ pdk bundle exec rake spec
Acceptance Tests
Acceptance tests spin up VMs or Docker containers to test the behavior of a module on a live
system.
PDK currently has no direct support for acceptance tests, but if you have an existing module with
working tests, you should be able to make some minor additions to Gemfile and run the
following:
$ pdk bundle exec rake beaker
For more information on acceptance tests, see the following:
beaker‑rspec
beaker
Serverspec
PDK Templates
The default PDK templates can be found here:
https://github.com/puppetlabs/pdk‑templates
Files in the moduleroot_init directory are created only if they don't exist.
Files in the moduleroot directory will replace any existing file when you run pdk update or pdk
convert .
Files in the object_templates directory are used by the various pdk new commands.
The default settings for the template output can be found in the file config_defaults.yml.
Customizing Template Output
Settings in the file .sync.yml in the root of your module can be used to customize the output of
the templates.
.sync.yml contains a hash. The keys of the hash are the names of the generated files. The exact
values can be found by looking at the PDK templates README.md, config_defaults.yml in the
templates, and the code of the templates.
After updating .sync.yml, run pdk update to regenerate files from the templates.
Example .sync.yml
---
Gemfile:
optional:
':acceptance':
- gem: beaker
- gem: beaker-rspec
- gem: beaker-puppet_install_helper
- gem: beaker-module_install_helper
- gem: vagrant-wrapper
.gitignore:
paths:
- /update_report.txt
spec/spec_helper.rb:
spec_overrides: |-
# Add coverage report.
RSpec.configure do |c|
c.after(:suite) do
RSpec::Puppet::Coverage.report!
end
end
Future of PDK
PDK has experimental support for creating a new provider with pdk new provider . See
https://github.com/puppetlabs/puppet‑resource_api#getting‑started for more information.
Other interesting features that may be coming soon:
More module features
pdk new function PDK‑700
pdk new fact PDK‑683
Multi‑Puppet Support PDK‑414
Support for additional platforms PDK‑399
Testing on multiple Puppet and Ruby versions PDK‑785, PDK‑840, etc.
Data in modules by default PDK‑908
CLI ability to update metadata.json PDK‑878
Improved CI/CD support PDK‑477
Control repo support PDK‑564, puppetlabs/pdk#333
Bundled git support
For More Information...
PDK
https://puppet.com/download‑puppet‑development‑kit
Onyx Point
https://onyxpoint.com/
https://simp‑project.com/
Me
https://twitter.com/silug
https://github.com/silug

More Related Content

What's hot

PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...
PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...
PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...Puppet
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdbRoman Podoliaka
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R projectWLOG Solutions
 
Managing large scale projects in R with R Suite
Managing large scale projects in R with R SuiteManaging large scale projects in R with R Suite
Managing large scale projects in R with R SuiteWLOG Solutions
 
Idiomatic gradle plugin writing
Idiomatic gradle plugin writingIdiomatic gradle plugin writing
Idiomatic gradle plugin writingSchalk Cronjé
 
What's new in python 3.8? | Python 3.8 New Features | Edureka
What's new in python 3.8? | Python 3.8 New Features | EdurekaWhat's new in python 3.8? | Python 3.8 New Features | Edureka
What's new in python 3.8? | Python 3.8 New Features | EdurekaEdureka!
 
Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019Christie Wilson
 
[DEPRECATED]Gradle the android
[DEPRECATED]Gradle the android[DEPRECATED]Gradle the android
[DEPRECATED]Gradle the androidJun Liu
 
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Cloud-Native CI/CD on Kubernetes with Tekton PipelinesCloud-Native CI/CD on Kubernetes with Tekton Pipelines
Cloud-Native CI/CD on Kubernetes with Tekton PipelinesNikhil Thomas
 
PGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores Finnoto
PGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores FinnotoPGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores Finnoto
PGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores FinnotoEqunix Business Solutions
 
[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetes[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetesGlobalLogic Ukraine
 
MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...Hoffman Lab
 
Multiplatform Apps with Spring, Kotlin, and RSocket
Multiplatform Apps with Spring, Kotlin, and RSocketMultiplatform Apps with Spring, Kotlin, and RSocket
Multiplatform Apps with Spring, Kotlin, and RSocketVMware Tanzu
 
Openshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceDarnette A
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golangTing-Li Chou
 

What's hot (20)

PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...
PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...
PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R project
 
Managing large scale projects in R with R Suite
Managing large scale projects in R with R SuiteManaging large scale projects in R with R Suite
Managing large scale projects in R with R Suite
 
Idiomatic gradle plugin writing
Idiomatic gradle plugin writingIdiomatic gradle plugin writing
Idiomatic gradle plugin writing
 
What's new in python 3.8? | Python 3.8 New Features | Edureka
What's new in python 3.8? | Python 3.8 New Features | EdurekaWhat's new in python 3.8? | Python 3.8 New Features | Edureka
What's new in python 3.8? | Python 3.8 New Features | Edureka
 
Testing in go
Testing in goTesting in go
Testing in go
 
Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019
 
[DEPRECATED]Gradle the android
[DEPRECATED]Gradle the android[DEPRECATED]Gradle the android
[DEPRECATED]Gradle the android
 
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
Cloud-Native CI/CD on Kubernetes with Tekton PipelinesCloud-Native CI/CD on Kubernetes with Tekton Pipelines
Cloud-Native CI/CD on Kubernetes with Tekton Pipelines
 
Moving applications to HDF5 1.8
Moving applications to HDF5 1.8Moving applications to HDF5 1.8
Moving applications to HDF5 1.8
 
PGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores Finnoto
PGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores FinnotoPGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores Finnoto
PGConf.ASIA 2019 Bali - Patroni on GitLab.com - Jose Cores Finnoto
 
[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetes[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetes
 
JSX
JSXJSX
JSX
 
MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...MultiQC: summarize analysis results for multiple tools and samples in a singl...
MultiQC: summarize analysis results for multiple tools and samples in a singl...
 
JSX Optimizer
JSX OptimizerJSX Optimizer
JSX Optimizer
 
Multiplatform Apps with Spring, Kotlin, and RSocket
Multiplatform Apps with Spring, Kotlin, and RSocketMultiplatform Apps with Spring, Kotlin, and RSocket
Multiplatform Apps with Spring, Kotlin, and RSocket
 
Openshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhce
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 

Similar to Intro to PDK

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet
 
PuppetCamp2021-Testing Modules and ControlRepo.pdf
PuppetCamp2021-Testing Modules and ControlRepo.pdfPuppetCamp2021-Testing Modules and ControlRepo.pdf
PuppetCamp2021-Testing Modules and ControlRepo.pdfMartin Alfke
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet CampPuppet
 
Puppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitPuppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitAlessandro Franceschi
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introductionJoel W. King
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKMarco Cavallini
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)p3castro
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
Introduction to package manager
Introduction to package managerIntroduction to package manager
Introduction to package manageryashobantabai
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPANdaoswald
 
A New Chapter of Data Processing with CDK
A New Chapter of Data Processing with CDKA New Chapter of Data Processing with CDK
A New Chapter of Data Processing with CDKShu-Jeng Hsieh
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization modelEuropean Collaboration Summit
 
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPInria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPStéphanie Roger
 
Build and Distributing SDK Add-Ons
Build and Distributing SDK Add-OnsBuild and Distributing SDK Add-Ons
Build and Distributing SDK Add-OnsDave Smith
 

Similar to Intro to PDK (20)

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 
PuppetCamp2021-Testing Modules and ControlRepo.pdf
PuppetCamp2021-Testing Modules and ControlRepo.pdfPuppetCamp2021-Testing Modules and ControlRepo.pdf
PuppetCamp2021-Testing Modules and ControlRepo.pdf
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
 
Puppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitPuppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction Kit
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introduction
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Introduction to package manager
Introduction to package managerIntroduction to package manager
Introduction to package manager
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPAN
 
A New Chapter of Data Processing with CDK
A New Chapter of Data Processing with CDKA New Chapter of Data Processing with CDK
A New Chapter of Data Processing with CDK
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
 
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPInria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
 
Build and Distributing SDK Add-Ons
Build and Distributing SDK Add-OnsBuild and Distributing SDK Add-Ons
Build and Distributing SDK Add-Ons
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
Readme
ReadmeReadme
Readme
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Intro to PDK

  • 1. Intro to PDK Steven Pritchard Onyx Point
  • 2. Welcome to Intro to PDK! System Integrity Management Platform (SIMP) Open Source stewards DevOps, Compliance, and Automation consulting Professional services for SIMP, Puppet, Red Hat®, and GitLab Puppet Gold Partners Steven Pritchard Senior Consultant Puppet Certified Professional (2017) Linux and Open Source geek for over 20 years Southern Illinois Linux Users Group Vim Geeks
  • 3. What is PDK? The Puppet Development Kit (PDK) is an All‑In‑One set of tools for developing and testing Puppet modules. PDK includes a bundled version of Ruby plus various gems and utilities required for creating and testing Puppet modules. PDK was announced in August of 2017 with the goal of making it easier to build high‑quality Puppet modules that follow best practices and use the available testing frameworks to avoid deploying bad code to live infrastructure.
  • 4. Installation PDK packages for various Linux distributions, Windows, and MacOS X can be downloaded from https://puppet.com/download‑puppet‑development‑kit. https://puppet.com/docs/pdk/latest/pdk.html
  • 5. Creating a Module - The Old Way $ puppet module generate author-modulename --skip-interview $ cd modulename ...Lots of editing... $ puppet module build ...Upload to Forge...
  • 6. What's Wrong With the Old Way? Module skeleton quality varied wildly. Often easier to create everything from scratch. The skeleton was only used as an initial template. puppet module generate was deprecated in Puppet 5.4.0.
  • 7. Creating a Module - The New Way $ pdk new module author-modulename $ cd modulename $ pdk new class modulename ...Lots of editing... $ pdk validate $ pdk test unit $ pdk build ...Upload to Forge...
  • 8. Why is this better? Generated code follows best practices. pdk new class classname creates manifests/classname.pp and spec/classes/classname_spec.rb. Testing out of the box! The default templates (https://github.com/puppetlabs/pdk‑templates) include lots of goodies: CI configurations for Travis CI, GitLab CI/CD, and AppVeyor operatingsystem_support and requirements in metadata.json Git configuration (.gitignore, .gitattributes) Puppet Strings in generated code Updates to the templates can be applied to (some files in) the module. Interaction with Ruby tooling ( bundle , rake ) is not required. Did I mention that puppet module generate was deprecated in Puppet 5.4.0?
  • 9. Using PDK Create a new module $ pdk new module mynewmodule (Or you can skip the interview...) $ pdk new module mynewmodule --skip-interview Convert an existing module to PDK format $ pdk convert (Note that this does not add tests for existing classes, defined types, etc.) Update from the templates in an existing PDK-format module $ pdk update
  • 10. Using PDK Create a new class $ pdk new class classname Create a new defined type $ pdk new defined_type typename Create a new task $ pdk new task taskname
  • 11. Testing Smoke tests (simple lint , rubocop , and parser checks) can be run with the following command: $ pdk validate Unit tests (Ruby scripts that use rspec‑puppet to test the contents of a compiled catalog) can be executed with the following command: $ pdk test unit The default tests use rspec‑puppet‑facts to test catalog compilation on each supported OS. https://puppet.com/docs/pdk/1.x/pdk_testing.html
  • 12. pdk bundle PDK allows you to run arbitrary bundle commands with pdk bundle . For example, to see what rake tasks are available, you can run the following command: $ pdk bundle exec rake -- -T To see all output of the rake tasks run by pdk test unit , you can run the following command: $ pdk bundle exec rake spec
  • 13. Acceptance Tests Acceptance tests spin up VMs or Docker containers to test the behavior of a module on a live system. PDK currently has no direct support for acceptance tests, but if you have an existing module with working tests, you should be able to make some minor additions to Gemfile and run the following: $ pdk bundle exec rake beaker For more information on acceptance tests, see the following: beaker‑rspec beaker Serverspec
  • 14. PDK Templates The default PDK templates can be found here: https://github.com/puppetlabs/pdk‑templates Files in the moduleroot_init directory are created only if they don't exist. Files in the moduleroot directory will replace any existing file when you run pdk update or pdk convert . Files in the object_templates directory are used by the various pdk new commands. The default settings for the template output can be found in the file config_defaults.yml.
  • 15. Customizing Template Output Settings in the file .sync.yml in the root of your module can be used to customize the output of the templates. .sync.yml contains a hash. The keys of the hash are the names of the generated files. The exact values can be found by looking at the PDK templates README.md, config_defaults.yml in the templates, and the code of the templates. After updating .sync.yml, run pdk update to regenerate files from the templates.
  • 16. Example .sync.yml --- Gemfile: optional: ':acceptance': - gem: beaker - gem: beaker-rspec - gem: beaker-puppet_install_helper - gem: beaker-module_install_helper - gem: vagrant-wrapper .gitignore: paths: - /update_report.txt spec/spec_helper.rb: spec_overrides: |- # Add coverage report. RSpec.configure do |c| c.after(:suite) do RSpec::Puppet::Coverage.report! end end
  • 17. Future of PDK PDK has experimental support for creating a new provider with pdk new provider . See https://github.com/puppetlabs/puppet‑resource_api#getting‑started for more information. Other interesting features that may be coming soon: More module features pdk new function PDK‑700 pdk new fact PDK‑683 Multi‑Puppet Support PDK‑414 Support for additional platforms PDK‑399 Testing on multiple Puppet and Ruby versions PDK‑785, PDK‑840, etc. Data in modules by default PDK‑908 CLI ability to update metadata.json PDK‑878 Improved CI/CD support PDK‑477 Control repo support PDK‑564, puppetlabs/pdk#333 Bundled git support
  • 18. For More Information... PDK https://puppet.com/download‑puppet‑development‑kit Onyx Point https://onyxpoint.com/ https://simp‑project.com/ Me https://twitter.com/silug https://github.com/silug