{"id":2424,"date":"2011-12-06T17:58:21","date_gmt":"2011-12-06T07:58:21","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=2424"},"modified":"2011-12-06T17:58:21","modified_gmt":"2011-12-06T07:58:21","slug":"puppet-vagrant-jenkins-automated-bliss","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2011\/12\/06\/puppet-vagrant-jenkins-automated-bliss\/","title":{"rendered":"Puppet + Vagrant + jenkins = automated bliss"},"content":{"rendered":"<p>I&#8217;m currently teaching myself how to do Puppet. Why? Well, at <a href=\"http:\/\/www.percona.com\">Percona<\/a> we support a bunch of platforms for our software. This means we have to maintain a bunch of <a href=\"http:\/\/www.jenkins-ci.org\">Jenkins<\/a> slaves to build the software on. We want to add new machines and have (up until now) maintained a magic &#8220;apt-get install&#8221; command line in the Jenkins EC2 configuration. This isn&#8217;t an ideal situation and there&#8217;s been talk of getting <a href=\"http:\/\/www.puppetlabs.com\/puppet\">Puppet<\/a> to do the heavy lifting for a while.<\/p>\n<p>So I sat down to do it.<\/p>\n<p>Step 1: take the &#8220;apt-get install&#8221; line and convert it into puppet speak.<\/p>\n<p>This was pretty easy. I started off with Vagrant starting a Ubuntu Lucid 32 VM (just like in the Vagrant getting started guide) and enabled the provision using puppet bit.<\/p>\n<p>Step 2: find out you need to run &#8220;apt-get update&#8221;<\/p>\n<p>Since the base VM I&#8217;m using was made there had been updates, so I needed to make any package installation depend on running &#8220;apt-get update&#8221; to ensure I was both installing the latest version and that the repositories would have the files I was looking for.<\/p>\n<p>This was pretty easy (once I knew how):<\/p>\n<pre>exec {\"apt-update\":\r\n       command =&gt; \"\/usr\/bin\/apt-get update\",\r\n}<\/pre>\n<pre>Exec[\"apt-update\"] -&gt; Package &lt;| |&gt;<\/pre>\n<p>This simply does two things: specify to run &#8220;apt-get update&#8221; and then specify that any package install depends on having run &#8220;apt-update&#8221; first.<\/p>\n<p>I&#8217;ve also needed things such as:<\/p>\n<pre>case $operatingsystem {\r\n     debian, ubuntu: { $libaiodev = \"libaio-dev\" }\r\n     centos, redhat: { $libaiodev = \"aio-devel\" }\r\n     default: { fail(\"Unrecognised OS for libaio-dev\") }\r\n}\r\npackage { \"libaio-dev\":\r\n          name =&gt; $libaiodev,\r\n          ensure =&gt; latest,\r\n}<\/pre>\n<p>The idea being that when I go and test all this stuff running on CentOS, it should mostly &#8220;just work&#8221; there too.<\/p>\n<p>The next step? Setting up and running the Jenkins slave.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m currently teaching myself how to do Puppet. Why? Well, at Percona we support a bunch of platforms for our software. This means we have to maintain a bunch of Jenkins slaves to build the software on. We want to &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2011\/12\/06\/puppet-vagrant-jenkins-automated-bliss\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[70,438,628,440,441],"class_list":["post-2424","post","type-post","status-publish","format-standard","hentry","category-general","tag-drizzle","tag-jenkins","tag-mysql","tag-puppet","tag-vagrant"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-D6","jetpack-related-posts":[{"id":2427,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/12\/06\/puppet-snippet-for-setting-up-a-machine-to-build-drizzle\/","url_meta":{"origin":2424,"position":0},"title":"Puppet snippet for setting up a machine to build Drizzle","author":"Stewart Smith","date":"2011-12-06","format":false,"excerpt":"You could use this in a Vagrant setup if you like (I've done so for testing). Step 1)\u00c2\u00a0Set the following in your Vagrantfile: Vagrant::Config.run do |config| config.vm.box = \"lucid32\" config.vm.box_url = \"http:\/\/files.vagrantup.com\/lucid32.box\" config.vm.provision :puppet end Step 2) Get puppet-apt helper. I used https:\/\/github.com\/evolvingweb\/puppet-apt\u00c2\u00a0and put it in a manifests\/ directory like\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3043,"url":"https:\/\/www.flamingspork.com\/blog\/2012\/06\/28\/hacking-the-jenkins-bzr-plugin\/","url_meta":{"origin":2424,"position":1},"title":"Hacking the Jenkins BZR plugin","author":"Stewart Smith","date":"2012-06-28","format":false,"excerpt":"For Drizzle and for all of the projects we work on at Percona we use the Bazaar revision control system (largely because it's what we were using at MySQL and it's what MySQL still uses). We also use Jenkins. We have a lot of jobs in our Jenkins. A lot.\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3912,"url":"https:\/\/www.flamingspork.com\/blog\/2014\/12\/03\/running-skiboot-opal-on-the-power8-simulator\/","url_meta":{"origin":2424,"position":2},"title":"Running skiboot (OPAL) on the POWER8 Simulator","author":"Stewart Smith","date":"2014-12-03","format":false,"excerpt":"skiboot is open source boot and runtime firmware for OpenPOWER. On real POWER8 hardware, you will also need HostBoot to do this (basically, to make the chip work) but in a functional simulator (such as this one released by IBM) you don't need a bunch of hardware procedures to make\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":737,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/09\/21\/and-the-morning-annoyance-award-goes-to\/","url_meta":{"origin":2424,"position":3},"title":"and the morning annoyance award goes to&#8230;.","author":"Stewart Smith","date":"2006-09-21","format":false,"excerpt":"goes to VMware. Honestly, why every time i go and upgrade a kernel or\u00c2\u00a0 version of the free (as in beer) VM it asks me about serial numbers. They also get a \"annoyance award\" for not listing Victoria as a state that could be in Australia on their web site.\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4325,"url":"https:\/\/www.flamingspork.com\/blog\/2017\/11\/22\/installing-windows-on-a-usb-key\/","url_meta":{"origin":2424,"position":4},"title":"Installing Windows on a USB key","author":"Stewart Smith","date":"2017-11-22","format":false,"excerpt":"For some unknown reason, the Windows installer doesn't let you install to a USB key. Luckily, there's a simple workaround. It turns out that only the very first step of installation cares about that. So, if you can fool it (say, by running in qemu), you can have a USB\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3051,"url":"https:\/\/www.flamingspork.com\/blog\/2012\/06\/28\/new-jenkins-bazaar-plugin-release-1-18\/","url_meta":{"origin":2424,"position":5},"title":"New Jenkins Bazaar plugin release! 1.18","author":"Stewart Smith","date":"2012-06-28","format":false,"excerpt":"From the desk of your new Bazaar plugin for Jenkins maintainer, I give you Version 1.18. This release has two good bug fixes: UI fix for checkout option (JENKINS-12261) Auto-recover from corrupt BZR branches (e.g. bzr branch\/checkout killed at inopportune moment) by cleaning the workspace and trying again (this is\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=2424"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2424\/revisions"}],"predecessor-version":[{"id":2426,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/2424\/revisions\/2426"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=2424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=2424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=2424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}