{"id":257,"date":"2016-11-21T17:14:19","date_gmt":"2016-11-21T22:14:19","guid":{"rendered":"http:\/\/brucetimberlake.com\/blog\/?p=257"},"modified":"2016-11-21T17:14:19","modified_gmt":"2016-11-21T22:14:19","slug":"puppet-environments-vs-git-branches","status":"publish","type":"post","link":"https:\/\/brucetimberlake.com\/blog\/2016\/11\/21\/puppet-environments-vs-git-branches\/","title":{"rendered":"Puppet environments vs Git branches"},"content":{"rendered":"<p>Learning Puppet and Git at the same time does make for a lot of confusion most of the time. But a <a href=\"https:\/\/www.youtube.com\/watch?v=v9LB-NX4_KQ\" target=\"_blank\">video<\/a> I watched the other day finally made something &#8220;click&#8221; in my head about how to manage our multiple environments with Puppet.  I had been struggling with the belief that, since we have 3 environments &#8212; Dev, Test, Production &#8212; we were going to need to maintain 2 long-lived branches (&#8220;dev&#8221; and &#8220;test&#8221;) for modules and Puppet code to track changes we&#8217;re making, and then deal with using pull requests\/etc to migrate the changes from Dev to Test to Production.<\/p>\n<p>That seemed like it was all wrong. And I think it is.<\/p>\n<p>Instead, a branch for a module\/whatever will be used for testing something, and deployed as a dynamic environment via r10k to target server(s) for testing, and then we will issue a pull request\/code review to merge that change back into the &#8220;master&#8221; branch once testing is complete.  So all &#8220;real&#8221; servers in Dev, Test, and Production will always get &#8220;master&#8221; code deployed to them, with environment-specific differences managed via Hiera. The deployment will be controlled via something like Jenkins to ensure that once a change has been merged back into &#8220;master&#8221; it does not go right to Production with the next puppet agent run.  Tags or something will need to be used to mark &#8220;master&#8221; as ready to go to Prod.  Or else it would just be changes to the r10k control repository, and set eligibile versions there. Maintaining long-lived separate instances of a single control repo for each environment is not as daunting as maintaining three branches of everything all the time.<\/p>\n<p>Anyway. Just tracking my current state of mind on this problem. When I think on it for a while, it seems clear in my head, but then I forget it by the next time I need to use it. So I&#8217;m leaving this here as a memory jog next time I get stuck.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learning Puppet and Git at the same time does make for a lot of confusion most of the time. But a video I watched the other day finally made something &#8220;click&#8221; in my head about how to manage our multiple environments with Puppet. I had been struggling with the belief that, since we have 3 &hellip; <a href=\"https:\/\/brucetimberlake.com\/blog\/2016\/11\/21\/puppet-environments-vs-git-branches\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Puppet environments vs Git branches&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,35,37],"tags":[],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-git","category-puppet","category-workflow"],"_links":{"self":[{"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":1,"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions\/258"}],"wp:attachment":[{"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brucetimberlake.com\/blog\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}