SlideShare una empresa de Scribd logo
1 de 71
Descargar para leer sin conexión
Killer R10K
Workflow
Automating the Killer
Robots, all 10K of Them
Who Am I
@phil_zimmerman
Early Days
R10K Workflow Awesomeness
Demo Time
The Journey of A
Thousand Miles Begins
With A Single, Monolithic
Repo
A Single Repo?
What the F*@K?!!
Why Put Everything in a
Single Repo?
Simplify Development
Easy Jenkins Flow
Puppet Code and Hiera Data Together
Just
Starting
Out
Single CI Job
• rspec-puppet
• syntax check
• lint
Single Release Job
• create/push tag
Single Deploy Job
• Capistrano tasks
• poor man’s dynamic environments
• kludgy git logic w/conditionals in Capfile
For All Modules
Forge Modules
Capistrano -> Puppet Module Tool
Worked Well… Until It Didn’t
Did I mention the
Capistrano tasks?
KLUDGY
task "create_puppet_env", :roles => :puppet_master do
if exists?(:branchname)
run "if [ -d #{environment_basedir}/#{branchname} ]; then cd
#{environment_basedir}/#{branchname} && git pull origin
#{branchname} ; else 
git clone #{module_repository} #{environment_basedir}/
#{branchname} --branch #{branchname} ; fi"
else
puts "Please provide a valid git branch name as an argument"
end
end
task "create_puppet_env", :roles => :puppet_master do
if exists?(:branchname)
run "if [ -d #{environment_basedir}/#{branchname} ]; then cd
#{environment_basedir}/#{branchname} && git pull origin
#{branchname} ; else 
git clone #{module_repository} #{environment_basedir}/
#{branchname} --branch #{branchname} ; fi"
else
puts "Please provide a valid git branch name as an argument"
end
end
Upgrade Forge Modules
Version Management == Face Palm
Upgrading Affects all Environments!
Let Me Count the Other
Ways…
This Started to Fail
Simple Comes at a Price
You mean I have to wait for tests
to run for ALL modules before
I know if my changes are good?”
“I only changed one module….
I have to deploy
everything in order to
get my changes on the masters?
Sigh”
“I only changed one module….
everything just to get
my hiera data on the masters?”
“I need to change some hiera
data…. I have to deploy
I’m
Losing
My
Patience!
Oh - and that little problem where
upgrading forge modules can break
production…
Stop the Madness !!
Recap of Early Days:
Monolithic Repo
Long CI Cycles
All-Or-Nothing Deploys
Upgrading Forge Modules
Tools Can Be
Awesome
(we just needed a couple more)
Make Them Work For You
R10K
R10K
R10K!
https://github.com/
adrienthebo/r10k
Deploys Puppet Code
Handles Git/SvnFu
Is Awesome
R10K and Puppetfile
Match Made in Heaven (or Portland)
Manage Module Versions
Inventory of Puppet Environment
Puppetfile
Format
Inventory of
Modules
and Their
Versions
Puppetfile
lives in its
own
repository
Puppetfile
lives in its own
Repository
Inventory of
Modules and
Their Versions
Each module in its own
repository AND r10k
R10K
Deploy
r10k deploy environment test -p
deploys all modules in Puppetfile
for the test branch
r10k deploy module tomcat
deploys a single module!
CI Job Per Module
• rspec-puppet
• syntax check
• lint
Release Job Per Module
• create/push tag
• select module from dropdown list
Deploy Job For Each Module And Hiera
• simpler Capistrano tasks
• wrap r10k calls to each master/node
desc "for specified branch in puppetfile repo, use r10k to
deploy all modules for the specified environment."
task "update_environment", :roles => :puppet_master do
if exists?(:branchname)
run "r10k -v debug deploy environment #{branchname} -
p"
else
puts "Please provide a valid git branch name as an
argument"
end
end
Puppetfile
Manipulation and
Branch Creation
mod 'tomcat',
:git => 'git@github.com:fylgia/tomcat.git',
:ref => 'RELEASE_1.0.13'
Tomcat Example
go to tomcat dir (production branch)
!
‘git checkout -b dev_change_foo’
‘git push origin dev_change_foo’
Create the
‘dev_change_foo’ branch
in Puppetfile repo
Change the :ref for
tomcat to
‘dev_change_foo’
Call r10k to deploy
‘dev_change_foo’
Notify Me When It’s
Finished
Explain the Magics
Hint:
Create Branch
r10k deploy environment
Modify Branch
r10k deploy module
Delete Branch
auto-delete Puppetfile branch
Testing Multiple
Modules in the
Same Environment
go to profile dir (production branch)
!
‘git checkout -b dev_change_foo’
‘git push origin dev_change_foo’
mod 'profile',
:git => 'git@github.com:fylgia/profile.git',
:ref => 'RELEASE_0.1.124'
mod 'tomcat',
:git => 'git@github.com:fylgia/tomcat.git',
:ref => 'RELEASE_1.0.13'
production
mod 'profile',
:git => 'git@github.com:fylgia/profile.git',
:ref => ‘dev_change_foo’
mod 'tomcat',
:git => 'git@github.com:fylgia/tomcat.git',
:ref => 'dev_change_foo'
dev_change_foo
Truly Dynamic
Environments!
The Post-Receive
Hook
reaktor
Default Setup
GitHub or GitHub Enterprise
Hipchat
Just provide some config!
REAKTOR_PUPPET_MASTERS_FILE
REAKTOR_HIPCHAT_TOKEN
REAKTOR_HIPCHAT_ROOM
REAKTOR_HIPCHAT_FROM
PUPPETFILE_GIT_URL
Other Chat Providers
Campfire, Slack, etc
If it has an API, it’s
pluggable!
Other Git Providers
Gitlab, Bitbucket, etc
Need to Determine Best
Approach
Create Release
Deploy - Ship It!
Create Release
Modulefile
RELEASE_1.0.13 -> RELEASE_1.0.14
versionfile (hieradata)
Deploy
Parameterized Job
environment
version to deploy
Puppetfile Manipulation
(again)
change :ref to selected version
r10k deploy selected environment
commit/push updated Puppetfile
One-Click
Production
Deploy
Workflow Recap:
R10K and Puppetfile
Each Module in Own Repo
Post-Receive Hook Goodness
Production Deployments
Conclusion:
Early Days
R10K Workflow Awesomeness
Demos
Helpful Links and
References
https://github.com/adrienthebo/r10k
http://garylarizza.com/blog/2014/02/18/puppet-workflow-part-3/
http://garylarizza.com/blog/2014/03/07/puppet-workflow-part-3b/
http://philzim.com/2014/05/02/an-automated-r10k-workflow-that-works/
https://github.com/pzim/reaktor
PuppetConf 2014 Killer R10K Workflow Without Notes

Más contenido relacionado

La actualidad más candente

Testing Salt States (part 1)
Testing Salt States (part 1)Testing Salt States (part 1)
Testing Salt States (part 1)
jasondenning
 
Vagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of developmentVagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of development
Paul Stack
 
Automating Your Salt Tests
Automating Your Salt TestsAutomating Your Salt Tests
Automating Your Salt Tests
Ryan Currah
 

La actualidad más candente (20)

Супер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOSСупер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOS
 
Continuous Integration with Puppet
Continuous Integration with PuppetContinuous Integration with Puppet
Continuous Integration with Puppet
 
Testing Salt States (part 1)
Testing Salt States (part 1)Testing Salt States (part 1)
Testing Salt States (part 1)
 
Vagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of developmentVagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of development
 
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...
20150314  - Functional Testing for Configuration Management @ Cascadia IT Con...20150314  - Functional Testing for Configuration Management @ Cascadia IT Con...
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...
 
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Continuously Testing Infrastructure - Beyond Module Testing - PuppetConf 2014
Continuously Testing Infrastructure - Beyond Module Testing - PuppetConf 2014Continuously Testing Infrastructure - Beyond Module Testing - PuppetConf 2014
Continuously Testing Infrastructure - Beyond Module Testing - PuppetConf 2014
 
Tugbot - Testing Framework for Docker Containers
Tugbot - Testing Framework for Docker ContainersTugbot - Testing Framework for Docker Containers
Tugbot - Testing Framework for Docker Containers
 
Automating Your Salt Tests
Automating Your Salt TestsAutomating Your Salt Tests
Automating Your Salt Tests
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Social Coding GitHub 2015
Social Coding GitHub 2015Social Coding GitHub 2015
Social Coding GitHub 2015
 
創科資訊四月小聚 - React Native Clonecat 101
創科資訊四月小聚 - React Native Clonecat 101創科資訊四月小聚 - React Native Clonecat 101
創科資訊四月小聚 - React Native Clonecat 101
 
Testing your infallibleness
Testing your infalliblenessTesting your infallibleness
Testing your infallibleness
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
Rest, sockets em golang
Rest, sockets em golangRest, sockets em golang
Rest, sockets em golang
 
Buildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in pythonBuildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in python
 
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to git
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 

Similar a PuppetConf 2014 Killer R10K Workflow Without Notes

Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacript
Lei Kang
 

Similar a PuppetConf 2014 Killer R10K Workflow Without Notes (20)

Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Puppet at GitHub / ChatOps
Puppet at GitHub / ChatOpsPuppet at GitHub / ChatOps
Puppet at GitHub / ChatOps
 
Puppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven DevelopmentPuppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven Development
 
20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacript
 
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.
 
Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoring
 
Cloudops fundamentals management, tdd, test driven design, continuous integra...
Cloudops fundamentals management, tdd, test driven design, continuous integra...Cloudops fundamentals management, tdd, test driven design, continuous integra...
Cloudops fundamentals management, tdd, test driven design, continuous integra...
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Terraform GitOps on Codefresh
Terraform GitOps on CodefreshTerraform GitOps on Codefresh
Terraform GitOps on Codefresh
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
 
Why you should revisit mgmt
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmt
 
Take a Stroll in the Bazaar
Take a Stroll in the BazaarTake a Stroll in the Bazaar
Take a Stroll in the Bazaar
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
 
Jedi Mind Tricks in Git
Jedi Mind Tricks in GitJedi Mind Tricks in Git
Jedi Mind Tricks in Git
 
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
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 

Último

+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

PuppetConf 2014 Killer R10K Workflow Without Notes