![Page 1: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/1.jpg)
Continuous Deployment
using Hiera as an ENC
of Dynamic Environments
Scott Phelps Puppet Camp June 5th, 2014
Washington, DC
![Page 2: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/2.jpg)
1. Hieradata 2. Roles using Hieradata 3. Profiles 4. Testing
a. rspec-puppet b. beaker
5. Continuous Integration with Teamcity 6. Questions?
What I’m Going to Talk About
![Page 3: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/3.jpg)
Hieradata the single source of truth
![Page 4: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/4.jpg)
with Hiera it’s easy to specify parameter values specific to a location, role, profile, fqdn, or whatever facts you decide
![Page 5: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/5.jpg)
no defaults in modules
to be the single source of truth for all modules
allows Hieradata
![Page 6: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/6.jpg)
Roles defined exclusively in Hiera
![Page 7: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/7.jpg)
roles provide the layer of abstraction between business logic and operations logic
![Page 8: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/8.jpg)
Profiles modules that abstract modules
![Page 9: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/9.jpg)
profiles provide the layer of abstraction between operations logic and module logic
![Page 10: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/10.jpg)
Testing using rspec-puppet and beaker
![Page 11: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/11.jpg)
Test Driven Development
● Provides rapid feedback ● Produces high quality,
robust code
![Page 12: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/12.jpg)
Unit tests are provided using the rspec-puppet Gem. They help to ensure that your module passes the compilation phase.
![Page 13: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/13.jpg)
• Acceptance tests are provided using the Beaker Gem.
• They help to ensure that your
module does what you expect on a live node.
• The Serverspec Gem allows you to compare the end state of that live node to a set of RSpec
• Expectations.
![Page 14: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/14.jpg)
Continuous Integration
using Teamcity
![Page 15: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/15.jpg)
Automated Building of Pull Requests….
![Page 16: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/16.jpg)
Merging and Promotion of Branches...
![Page 17: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/17.jpg)
Module Deployment…
CI R10K PE
R10k is a tool for deploying puppet code
Agent
it creates a new environment for each branch
![Page 18: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/18.jpg)
R10k Results
![Page 19: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/19.jpg)
Puppetfile
![Page 20: Puppet Camp DC 2014: Continuous Deployment of Dynamic Environments Using Hiera ENC](https://reader034.vdocuments.site/reader034/viewer/2022042606/53fddd618d7f72a81c8b4b65/html5/thumbnails/20.jpg)
Questions?