<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Carlos Sanchez&#039;s Weblog</title>
	<atom:link href="http://blog.csanchez.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.csanchez.org</link>
	<description>software at the end of the universe</description>
	<lastBuildDate>Wed, 19 Jun 2013 17:06:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.csanchez.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/ab9becbefab8bb8411765ea70acb5391?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Carlos Sanchez&#039;s Weblog</title>
		<link>http://blog.csanchez.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.csanchez.org/osd.xml" title="Carlos Sanchez&#039;s Weblog" />
	<atom:link rel='hub' href='http://blog.csanchez.org/?pushpress=hub'/>
		<item>
		<title>Binary Repository Management refcard on DZone</title>
		<link>http://blog.csanchez.org/2013/04/23/binary-repository-management-refcard-on-dzone/</link>
		<comments>http://blog.csanchez.org/2013/04/23/binary-repository-management-refcard-on-dzone/#comments</comments>
		<pubDate>Tue, 23 Apr 2013 12:04:49 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[archiva]]></category>
		<category><![CDATA[artifactory]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[nexus]]></category>
		<category><![CDATA[repository]]></category>

		<guid isPermaLink="false">http://blog.csanchez.org/?p=1348</guid>
		<description><![CDATA[Binary Repository Management refcard on DZone The people at DZone were kind enough to ask me to write a refcard on Binary Repository Management a few months ago, and it&#8217;s now available for download. I wrote about benefits and best &#8230; <a href="http://blog.csanchez.org/2013/04/23/binary-repository-management-refcard-on-dzone/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1348&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a title="Binary Repository Management refcard on DZone" href="http://refcardz.dzone.com/refcardz/binary-repository-management"><img class="alignright size-full wp-image-1354" alt="DZone logo" src="http://carlossanchez.files.wordpress.com/2013/04/mh_dzone_logo.png?w=584"   />Binary Repository Management refcard on DZone</a> The people at <a href="http://dzone.com">DZone</a> were kind enough to ask me to write a refcard on Binary Repository Management a few months ago, and it&#8217;s now available for <a href="http://refcardz.dzone.com/refcardz/binary-repository-management">download</a>.</p>
<p>I wrote about benefits and best practices when using a repository and compare the three tools in the space: <a href="http://archiva.apache.org">Apache Archiva</a>, <a href="http://www.sonatype.org/nexus/">Sonatype Nexus</a> and <a href="http://www.jfrog.com/home/v_artifactory_opensource_overview">JFrog Artifactory</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1348&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2013/04/23/binary-repository-management-refcard-on-dzone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2013/04/mh_dzone_logo.png?w=120" />
		<media:content url="http://carlossanchez.files.wordpress.com/2013/04/mh_dzone_logo.png?w=120" medium="image">
			<media:title type="html">DZone logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>

		<media:content url="http://carlossanchez.files.wordpress.com/2013/04/mh_dzone_logo.png" medium="image">
			<media:title type="html">DZone logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing puppet modules</title>
		<link>http://blog.csanchez.org/2013/01/29/testing-puppet-modules/</link>
		<comments>http://blog.csanchez.org/2013/01/29/testing-puppet-modules/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 14:00:36 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[librarian]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[vagrant]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">https://carlossanchez.wordpress.com/?p=1299</guid>
		<description><![CDATA[There are several steps depending on how much involved the tests are, what parts are tested and, of course, how long it takes to run the tests. For unit testing we use rspec puppet, and we can check that our &#8230; <a href="http://blog.csanchez.org/2013/01/29/testing-puppet-modules/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1299&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png"><img class="size-thumbnail wp-image-1158 alignleft" alt="Puppet Labs logo" src="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150&#038;h=70" width="150" height="70" /></a>There are several steps depending on how much involved the tests are, what parts are tested and, of course, how long it takes to run the tests.</p>
<p>For unit testing we use <strong><a href="http://rspec-puppet.com/">rspec puppet</a></strong>, and we can check that our manifests and modules compile and contain the expected values. It can be used to test that specific types, classes or definitions are in the compiled catalog and that the parameters math the expectations.</p>
<p>Later on we can do some integration testing starting a new VM with <a href="http://vagrantup.com"><strong>Vagrant</strong></a> and checking that there are no errors in the provisioning, as well as checking that some conditions are met.</p>
<p>For rspec-puppet, PuppetLabs has created a project called <strong><a href="https://github.com/puppetlabs/puppetlabs_spec_helper">puppetlabs_spec_helper</a></strong> that let&#8217;s us avoid writing a bunch of boilerplate. A missing point though is that it only allows to use modules for testing from git. If you&#8217;re already using <strong><a title="Managing Puppet modules with librarian-puppet" href="http://blog.csanchez.org/2013/01/24/managing-puppet-modules-with-librarian-puppet/">librarian-puppet</a></strong> (and you should!) you can easily use the same Puppetfile for deploying modules <strong>and</strong> to test them. Doing otherwise sounds like a bit of useless testing, you could end with different versions in different development machines, CI server, puppet master,&#8230; So just add a call to librarian puppet in your rakefile to populate the rspec-puppet fixtures before running the specs.</p>
<p>Unfortunately rspec-puppet doesn&#8217;t work with Puppet 3.0.x and  at least Puppet 3.1.0-rc1 is required. It was a bit of a setback when we moved to Puppet 3 and started using <a href="https://github.com/puppetlabs/hiera">hiera</a>, which is proving to be very useful to have simpler manifests and external data injected for our <a href="http://www.maestrodev.com/">Maestro</a> <a href="https://github.com/maestrodev/maestro-puppet-example">installations</a> with Puppet from scratch.</p>
<p>You can also use the same Puppetfile to start Vagrant boxes with the exact same version of the modules. We are using Cucumber and Aruba to execute vagrant, provision the VM with puppet and check several things, like open ports, services up,&#8230; but that&#8217;s a different story <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h1>Example</h1>
<p>In this <a href="https://github.com/carlossg/puppet-for-java-devs">puppet-for-java-devs</a> project you will find the bits that showcase all these tools integrated. It includes definition of a 3-tier system with Puppet definitions for a postgresql database, tomcat nodes with a war installed and apache nodes fronting them.</p>
<p>Install all required gems</p>
<pre><code>bundle install
</code></pre>
<p>Install all Puppet modules with Puppet Librarian</p>
<pre><code>librarian-puppet install
</code></pre>
<p>Run the specs with puppet-rspec</p>
<pre><code>bundle exec rake
</code></pre>
<p>Start all the vms with Vagrant</p>
<pre><code>vagrant up</code></pre>
<h2>Rakefile</h2>
<pre class="brush: ruby; title: ; notranslate">
require 'bundler'
Bundler.require(:rake)
require 'rake/clean'

require 'puppetlabs_spec_helper/rake_tasks'

CLEAN.include('modules', 'spec/fixtures/', 'doc')
CLOBBER.include('.tmp', '.librarian')

task :librarian_spec_prep do
 sh &quot;librarian-puppet install&quot;
end
task :spec_prep =&gt; :librarian_spec_prep

task :default =&gt; [:spec]
</pre>
<h2>Puppetfile for librarian-puppet</h2>
<pre class="brush: ruby; title: ; notranslate">
forge 'http://forge.puppetlabs.com'

mod 'puppetlabs/java', '0.1.6'
mod 'puppetlabs/apache', '0.4.0'
mod 'inkling/postgresql', '0.2.0'
mod 'puppetlabs/firewall', '0.0.4'
mod 'tomcat', :git =&gt; 'https://github.com/carlossg/puppet-tomcat.git', :ref =&gt; 'centos'
mod 'maestrodev/maven', '1.x'
mod 'stahnma/epel', '0.0.2'
mod 'maestrodev/avahi', '1.x'
mod 'other', :path =&gt; 'mymodules/other'
</pre>
<h2>tomcat_spec.rb with rspec-puppet</h2>
<pre class="brush: ruby; title: ; notranslate">
require 'spec_helper'

describe 'tomcat1.acme.com' do
  let(:facts) { {:osfamily =&gt; 'RedHat', <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> peratingsystem =&gt; 'CentOS', <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> peratingsystemrelease =&gt; 6.3} }

  it { should contain_class('java').with_distribution /openjdk/ }

  it &quot;configure webapp&quot; do
    should contain_maven('/srv/tomcat/appfuse/webapps/ROOT.war')
    should contain_maven('/srv/tomcat/appfuse/webapps/ROOT/WEB-INF/lib/postgresql-9.1-901.jdbc4.jar')
  end
end
</pre>
<h2>Vagrantfile</h2>
<pre class="brush: ruby; title: ; notranslate">
Vagrant::Config.run do |config|
  config.vm.box = &quot;CentOS-6.3-x86_64-minimal&quot;
  config.vm.box_url = &quot;https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box&quot;

  config.vm.customize [&quot;modifyvm&quot;, :id, &quot;--rtcuseutc&quot;, &quot;on&quot;] # use UTC clock https://github.com/mitchellh/vagrant/issues/912

  # db server
  config.vm.define :db do |config|
    config.vm.host_name = &quot;db.acme.local&quot;
    config.vm.customize [&quot;modifyvm&quot;, :id, &quot;--name&quot;, &quot;db&quot;] # name for VirtualBox GUI
    config.vm.forward_port 5432, 5432
    config.vm.network :hostonly, &quot;192.168.33.10&quot;
    config.vm.provision :puppet do |puppet|
      puppet.module_path = &quot;modules&quot;
      puppet.manifest_file = &quot;site.pp&quot;
    end
  end

  # tomcat server
  config.vm.define :tomcat1 do |config|
    config.vm.host_name = &quot;tomcat1.acme.local&quot;
    config.vm.customize [&quot;modifyvm&quot;, :id, &quot;--name&quot;, &quot;tomcat1&quot;] # name for VirtualBox GUI
    config.vm.forward_port 8080, 8081
    config.vm.network :hostonly, &quot;192.168.33.11&quot;
    config.vm.provision :puppet do |puppet|
      puppet.module_path = &quot;modules&quot;
      puppet.manifest_file = &quot;site.pp&quot;
    end
  end

  # web server
  config.vm.define :www do |config|
    config.vm.host_name = &quot;www.acme.local&quot;
    config.vm.customize [&quot;modifyvm&quot;, :id, &quot;--name&quot;, &quot;www&quot;] # name for VirtualBox GUI
    config.vm.forward_port 80, 8080
    config.vm.network :hostonly, &quot;192.168.33.12&quot;
    config.vm.provision :puppet do |puppet|
      puppet.module_path = &quot;modules&quot;
      puppet.manifest_file = &quot;site.pp&quot;
    end
  end

end
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1299/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1299&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2013/01/29/testing-puppet-modules/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150" medium="image">
			<media:title type="html">Puppet Labs logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>
	</item>
		<item>
		<title>Managing Puppet modules with librarian-puppet</title>
		<link>http://blog.csanchez.org/2013/01/24/managing-puppet-modules-with-librarian-puppet/</link>
		<comments>http://blog.csanchez.org/2013/01/24/managing-puppet-modules-with-librarian-puppet/#comments</comments>
		<pubDate>Thu, 24 Jan 2013 14:00:31 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[dependency]]></category>
		<category><![CDATA[librarian]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">https://carlossanchez.wordpress.com/?p=1298</guid>
		<description><![CDATA[Once you have your Infrastructure defined as code you need to use coding best practises. This definitely applies to Puppet code, you have Puppet classes to encapsulate functionality, and modules that group classes together for reuse and redistribution. Modules can &#8230; <a href="http://blog.csanchez.org/2013/01/24/managing-puppet-modules-with-librarian-puppet/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1298&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-thumbnail wp-image-1158" alt="Puppet Labs logo" src="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150&#038;h=70" width="150" height="70" />Once you have your<a title="Infrastructure as Code" href="http://blog.csanchez.org/2012/03/13/infrastructure-as-code/"> Infrastructure defined as code</a> you need to use coding best practises.</p>
<p>This definitely applies to Puppet code, you have Puppet classes to encapsulate functionality, and modules that group classes together for reuse and redistribution. Modules can be reused from git repositories or from the <a href="http://forge.puppetlabs.com/">Puppet Forge</a>, a web archive of tarballed modules in the same fashion as rpm or maven repositories. Modules in the forge are defined by a provider, module name and version, much like Maven groupid, artifactid and version, and <a href="http://forge.puppetlabs.com/maestrodev">a provider</a> has full control over the modules that can be published under its name, with a more open approach, as anybody can upload anything themselves through the forge website, just signup and start uploading them.</p>
<p>But trouble starts when you are using a number of modules from different places, as each module can have its own set of dependencies. How can the dependencies be defined, downloaded and installed automatically as happens with any other package manager?</p>
<p>There are several options actually</p>
<ul>
<li><a href="http://git-scm.com/book/en/Git-Tools-Submodules">Git submodules</a>. This is the poor man&#8217;s version, where you add the git repositories of other modules as git submodules and use git submodule init and update commands to stay up to date</li>
<li><a href="http://puppetlabs.com/blog/module-of-the-week-puppet-module-tool-part-1/">Puppet module tool</a>. Allows the installation of modules from the Puppet forge based on the module name provider/name and version. It will download and unpackage the module in the directory specified</li>
<li><a href="http://librarian-puppet.com/">Librarian-puppet</a>. It is an extension of ruby&#8217;s <a href="http://gembundler.com/">bundler</a> model to install gems, having a file that defines your dependencies, <em>Gemfile</em> in the case of bundler, <em>Puppetfile</em> in the case of librarian, and a .lock file with the resolved dependencies.</li>
</ul>
<p>The resolution model is different than those of yum, apt-get or maven, that resolve dependencies at every run on the client, relying on the clients to consistently do that over versions and machines. In the bundler or librarian model, resolution only happens once and it&#8217;s saved to the lock file, which is used from there on by the clients until dependencies are changed.</p>
<h1>Dependency declaration</h1>
<p>The librarian <em>Puppetfile</em> allows defining module dependencies from several sources</p>
<h2>Puppet Forge</h2>
<p>Using the forge provider and module name, and optionally version it calls puppet module tool to fetch the tarball and extract it in the designed directory</p>
<pre class="brush: ruby; title: ; notranslate">
mod &quot;maestrodev/maven&quot;, &quot;1.0.0&quot;
</pre>
<h2>Git</h2>
<p>Modules can also be cloned from a git repository optionally defining what branch, tag or revision to checkout</p>
<pre class="brush: ruby; title: ; notranslate">
mod &quot;maven&quot;,
  :git =&gt; &quot;https://github.com/maestrodev/puppet-maven.git&quot;,
  :ref =&gt; 'v1.0.0'
</pre>
<h2>Path folders</h2>
<p>Useful mostly for testing or while transitioning to a full dependency model, local paths can be used as modules</p>
<pre class="brush: ruby; title: ; notranslate">
mod 'mymodule', :path =&gt; './private/mymodule'
</pre>
<h1>Improvements and issues</h1>
<p>Librarian offers several improvements over the puppet module tool. Besides being able to bring in modules from different sources, librarian locks the versions of modules used, which is a must in order to consistently reproduce results. Let&#8217;s say you define a dependency on module <a href="http://forge.puppetlabs.com/maestrodev/maven">maestrodev/maven</a> &gt; 1.0.0. If you run it now then librarian will lock the version to 1.0.0. If 1.1.0 is released later your dependencies will stay the same. If you try to run the puppet module tool with</p>
<pre class="brush: plain; title: ; notranslate">
puppet module install maestrodev-maven
</pre>
<p>you would end with 1.0.0 now and  a newer version later on.</p>
<p>There are some problems, and we hit (and fixed!) a lot of them. We have <a href="https://github.com/maestrodev/librarian-puppet/tree/maestrodev">a fork of the original project</a> where we keep updating the <em>maestrodev</em> branch while our pull requests don&#8217;t make it to the original repo. Unfortunately some of the patches have been sitting there for too long and we went ahead and created the <a href="https://rubygems.org/gems/librarian-puppet-maestrodev">librarian-puppet-maestrodev</a> gem  that you can use instead of the original one.</p>
<p>Some of the issues you&#8217;ll likely find are the mismatch between puppet module version conventions and gem versions. librarian uses the bundler gemfile resolution mechanism which does not accept some versions such as the ones including dashes 1.0-rc1, or the puppet module dependency type 1.x which our librarian gem will adequately convert to ~&gt;1.0 instead of failing. Check out the <a href="http://docs.rubygems.org/read/chapter/7">rubygems version policies</a> for more details.</p>
<p>Next post I&#8217;ll cover how to use librarian in combination with <a href="https://github.com/puppetlabs/puppetlabs_spec_helper">puppetlabs spec helper</a> to make your puppet testing much easier and consistent, and I&#8217;ll cover the topic in my <a href="http://na.apachecon.com/schedule/presentation/187/">upcoming talk on continuous delivery at ApacheCon Portland</a> in February, plus you&#8217;ll find me next monday the 28th at the <a href="http://www.meetup.com/ladevops/events/98428332/">Los Angeles DevOps meetup</a>, and at <a href="http://www.socallinuxexpo.org/scale11x/devops-day-la">DevOps Days LA</a> February 22nd as part of the SCALE conference.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1298&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2013/01/24/managing-puppet-modules-with-librarian-puppet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150" medium="image">
			<media:title type="html">Puppet Labs logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>
	</item>
		<item>
		<title>Puppet Module of the Week: maestrodev/maven – Maven repository artifact downloads</title>
		<link>http://blog.csanchez.org/2012/09/25/puppet-module-of-the-week-maestrodevmaven-maven-repository-artifact-downloads/</link>
		<comments>http://blog.csanchez.org/2012/09/25/puppet-module-of-the-week-maestrodevmaven-maven-repository-artifact-downloads/#comments</comments>
		<pubDate>Tue, 25 Sep 2012 17:01:36 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blog.carlossanchez.eu/?p=1284</guid>
		<description><![CDATA[This is a guest post I wrote in the Puppetlabs blog for their Module of the Week program about the MaestroDev/maven module we created. Module of the Week: maestrodev/maven – Maven repository artifact downloads Purpose Manage Apache Maven installation and &#8230; <a href="http://blog.csanchez.org/2012/09/25/puppet-module-of-the-week-maestrodevmaven-maven-repository-artifact-downloads/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1284&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png"><img class="alignleft size-thumbnail wp-image-1158" title="Puppet Labs logo" src="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150&#038;h=70" alt="" width="150" height="70" /></a>This is a guest post I wrote in the <a href="http://puppetlabs.com/blog/module-of-the-week-maestrodev-maven/">Puppetlabs blog</a> for their Module of the Week program about the <a href="http://www.maestrodev.com">MaestroDev</a>/maven module we created.</p>
<h2><a title="Permanent Link to Module of the Week: maestrodev/maven – Maven repository artifact downloads" href="http://puppetlabs.com/blog/module-of-the-week-maestrodev-maven/" rel="bookmark">Module of the Week: maestrodev/maven – Maven repository artifact downloads</a></h2>
<table width="664">
<tbody>
<tr>
<td><strong>Purpose</strong></td>
<td>Manage Apache Maven installation and download artifacts from Maven repositories</td>
</tr>
<tr>
<td><strong>Module</strong></td>
<td><a href="http://forge.puppetlabs.com/maestrodev/maven">maestrodev/maven</a></td>
</tr>
<tr>
<td><strong>Puppet Version</strong></td>
<td>2.7+</td>
</tr>
<tr>
<td><strong>Platforms</strong></td>
<td>RHEL5, RHEL6</td>
</tr>
</tbody>
</table>
<p>The maven module allows Puppet users to install and configure <a href="http://maven.apache.org/">Apache Maven</a>, the build and project management tool, as well as easily use dependencies from Maven repositories.</p>
<p>If you use Maven repositories to store the artifacts resulting from your development process, whether you use Maven, Ivy, Gradle or any other tool capable of pushing builds to Maven repositories, this module defines a new maven type that will let you deploy those artifacts into any Puppet managed server. For instance, you can deploy WAR files directly from your Maven repository by just using their groupId, artifactId and version, bridging development and provisioning without any extra steps or packaging like RPMs or debs.</p>
<p>The maven type allows you to easily provision servers during development by using SNAPSHOT versions—using the latest build for provisioning. Together with a CI tool, this enables you to always keep your development servers up to date.</p>
<p>In this first version, this module supports</p>
<ul>
<li>Installing Apache Maven</li>
<li>Configuring Maven settings.xml for repository configuration</li>
<li>Configuring Maven environment variables</li>
<li>Downloading artifacts from Maven repositories</li>
</ul>
<h2>Installing the module</h2>
<table width="664">
<tbody>
<tr>
<td><strong>Complexity</strong></td>
<td>Easy</td>
</tr>
<tr>
<td><strong>Installation Time</strong></td>
<td>2 minutes</td>
</tr>
</tbody>
</table>
<p>Installing the Maven module is as simple as using the Puppet module tool, available in Puppet 2.7.14+ and Puppet Enterprise 2.5+, and also available as a RubyGem:</p>
<div>
<div>
<pre>$ puppet module install maestrodev-maven
Preparing to install into /etc/puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/etc/puppet/modules
└─┬ maestrodev-maven (v0.0.1)
  └── maestrodev-wget (v0.0.1)</pre>
</div>
</div>
<p>Alternatively, you can install the Maven module manually:</p>
<div>
<div>
<pre>$ cd /etc/puppet/modules/

$ wget http://forge.puppetlabs.com/system/releases/m/maestrodev/maestrodev-maven-0.0.1.tar.gz

$ tar zxvf maestrodev-maven-0.0.1.tar.gz &amp;&amp; rm maestrodev-maven-0.0.1.tar.gz
$ mv maestrodev-maven-0.0.1 maven
$ wget http://forge.puppetlabs.com/system/releases/m/maestrodev/maestrodev-wget-0.0.1.tar.gz
$ tar zxvf maestrodev-wget-0.0.1.tar.gz &amp;&amp; rm maestrodev-wget-0.0.1.tar.gz
$ mv maestrodev-wget-0.0.1 wget</pre>
</div>
</div>
<h2>Resource Overview</h2>
<h4>CLASSES</h4>
<p><strong>maven class</strong></p>
<p>This class installs Apache Maven with a default version of 2.2.1</p>
<p><strong>maven::maven class</strong></p>
<p>Installs Apache Maven, allowing you to specify the version of Maven you wish to install</p>
<h4>DEFINITIONS</h4>
<p><strong>maven::environment</strong></p>
<p>The definition allows us to configure Apache Maven environment variables on a per-user basis.</p>
<p><strong>maven::settings</strong></p>
<p>Configures $HOME/.m2/settings.xml per user with repositories, mirrors, credentials and properties.</p>
<h4>TYPES</h4>
<p><strong>maven</strong></p>
<p>This new type lets us download files from remote Maven repositories. Maven must be previously installed.</p>
<h2>Testing the module</h2>
<p>The module includes some Puppet rspec tests that use the puppetlabs_spec_helper, so it’s simple to implement, and all the fixtures will be automatically downloaded and tests run.</p>
<p>There is a Gemfile included to install all the dependent gems, so after running</p>
<div>
<div>
<pre>$ bundle install</pre>
</div>
</div>
<p>The tests can be executed with</p>
<div>
<div>
<pre>$ bundle exec rake spec</pre>
</div>
</div>
<h2>Configuring the module</h2>
<table width="664">
<tbody>
<tr>
<td>Complexity</td>
<td>Easy</td>
</tr>
<tr>
<td>Installation Time</td>
<td>5 minutes</td>
</tr>
</tbody>
</table>
<p>To install Maven there are two options, a simple one to install the default version (2.2.1):</p>
<div>
<div>
<pre>include maven</pre>
</div>
</div>
<p>or a slightly more complex option that customizes the version:</p>
<div>
<div>
<pre>class { "maven::maven":
  version =&gt; "3.0.4"
}</pre>
</div>
</div>
<p>Maven will be downloaded by default from the main Apache archive location. It can be configured to be downloaded from a different repository, like one in the local network, by using this repository syntax used throughout the module.</p>
<div>
<div>
<pre>$repo = {
  id       =&gt; "myrepo",
  username =&gt; "myuser",
  password =&gt; "mypassword",
  url      =&gt; "http://repo.acme.com",
  mirrorof =&gt; "external:*" # if you want to use the repo as a mirror, see maven::settings below
}

class { "maven::maven":
  version =&gt; "3.0.4",
  repo    =&gt; $repo
}</pre>
</div>
</div>
<p>Once you have Maven installed you can configure the <a href="http://maven.apache.org/settings.html">Maven settings.xml</a> for different users, override the mirrors, servers, localRepository, active properties and default repository. It is particularly useful to force Maven to use a repository in the internal network for faster downloads. These settings are used by both command line Maven and the maven puppet type.</p>
<p>We are using hashes to be able to reuse repository definitions, without copy and paste, like the <tt>$repo</tt> definition above.</p>
<div>
<div>
<pre># Create a settings.xml with the repo credentials
maven::settings { 'maven' :
  mirrors             =&gt; [$central], # mirrors entry in settings.xml, uses id, url, mirrorof from the hash passed
  servers             =&gt; [$central], # servers entry in settings.xml, uses id, username, password from the hash passed
  user                =&gt; 'maven',
  default_repo_config =&gt; {
    url       =&gt; $repo['url],
    snapshots =&gt; {
      enabled      =&gt; 'true',
      updatePolicy =&gt; 'always'
    },
    releases  =&gt; {
      enabled      =&gt; 'true',
      updatePolicy =&gt; 'always'
    }
  }
  properties          =&gt; {
    myproperty =&gt; 'myvalue'
  },
  local_repo          =&gt; '/home/maven/.m2/repository'
}</pre>
</div>
</div>
<p>We can override the central repository with <tt>mirrors</tt>, whichb add repositories to the mirrors settings. The servers parameter configures each settings.xml server entry for user and password credentials.</p>
<p>With <tt>default_repo_config</tt>, we can add a repository that will be enabled for all Maven executions, including the aven puppet type. That would be necessary in order to check a remote repository for snapshots, as there is no snapshot repository defined by default in Maven.</p>
<p>The properties parameter is a hash with keys and values for the properties section of the settings, while <tt>local_repo</tt> overrides Maven default local repository location.</p>
<p>Another Maven file that can be configured to alter the Maven environment variables is $HOME/.mavenrc with the maven::environment class. The .mavenrc is sourced by the Apache Maven script for each run.</p>
<div>
<div>
<pre>maven::environment { 'env-maven-user' :
  user                 =&gt; 'maven',
  maven_opts           =&gt; '-XX:MaxPermSize=256m',
  maven_path_additions =&gt; '/usr/local/bin'
}</pre>
</div>
</div>
<p>Probably the module’s most useful functionality is the ability to download artifacts from Maven repositories. This requires having Maven correctly installed and configured, which can be done with the previous classes and definitions, and uses the Maven <a href="http://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html">dependency:get plugin</a> behind the scenes. The title of the maven resource is used as the file destination, and the user to run maven as can be set with the user parameter.</p>
<div>
<div>
<pre>maven { "/tmp/maven-core-2.2.1.jar":
  id    =&gt; "org.apache.maven:maven-core:2.2.1:jar",
  repos =&gt; ["central::default::http://repo.maven.apache.org/maven2","http://mirrors.ibiblio.org/pub/mirrors/maven2"],
  user  =&gt; "maven",
}</pre>
</div>
</div>
<p>With the optional parameter <tt>repos</tt>, we can define what repositories to download the dependencies from if not using the default Maven central. The parameter is in the form <a href="http://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html#remoteRepositories">expected by the Maven dependency plugin</a>, that is <tt>id::[layout]::url</tt> or just <tt>url</tt>, separated by a comma.</p>
<p>Or, a little more verbose:</p>
<div>
<div>
<pre>maven { "/tmp/maven-core-2.2.1-sources.jar":
  groupid    =&gt; "org.apache.maven",
  artifactid =&gt; "maven-core",
  version    =&gt; "2.2.1",
  classifier =&gt; "sources",
  packaging  =&gt; "jar",
  user       =&gt; "maven",
}</pre>
</div>
</div>
<h2>Example usage</h2>
<p>With some simple declarations we can install Maven in a node, downloading the Apache Maven binaries from apache.org and uncompressing them under <tt>/usr/local</tt>, and then download any file from the central Maven repo. An example is <tt>maven-core-2.2.1.jar</tt>, which is located in the repository under <tt>org.apache.maven</tt> groupId and <tt>maven-core</tt> artifactId.</p>
<div>
<div>
<pre># Install Maven
class { "maven::maven": } -&gt;

maven { "/tmp/maven-core-2.2.1.jar":
  id =&gt; "org.apache.maven:maven-core:2.2.1:jar",
}</pre>
</div>
</div>
<p>The usage of the shorter form groupId:artifactId:version:packaging allows us to be more concise, but we could do the same using the groupid, artifactid, version, packaging parameters of the maven type. Note that we are using the <a href="http://docs.puppetlabs.com/puppet/2.7/reference/lang_relationships.html#chaining-arrows">chain arrow (-&gt;)</a> to explicitly install Maven before using it to download the jar file.</p>
<p>You should have a <tt>/tmp/maven-core-2.2.1.jar</tt> file with contents matching those of <a href="http://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.jar"><tt>http://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.jar</tt></a>.</p>
<h2>Conclusion</h2>
<p>If you use Apache Maven this module comes in handy for installing and configuring it on any machine in a consistent and repeatable way. This module also consumes the output artifacts from the development process in later stages of product delivery without extra steps or re-packaging.</p>
<p>Please let us know if you have any issues with the module. We are looking for new ways to improve the module, such as removing the need for wget to be installed. We look forward to your feedback!</p>
<p><em>Learn More:</em></p>
<ul>
<li><a href="http://forge.puppetlabs.com/maestrodev/maven">maestrodev/maven</a></li>
<li><a href="https://github.com/maestrodev/puppet-maven">Contribute to the module on GitHub</a></li>
<li><a href="http://forge.puppetlabs.com/maestrodev/wget">maestrodev/wget</a></li>
<li><a href="http://puppetlabs.com/category/blog/module-of-the-week-blog/">Previous Modules of the Week</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1284&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2012/09/25/puppet-module-of-the-week-maestrodevmaven-maven-repository-artifact-downloads/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/03/puppet-labs-logo.png?w=150" medium="image">
			<media:title type="html">Puppet Labs logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>
	</item>
		<item>
		<title>Puppet for Java developers talk at JavaZone Oslo 2012</title>
		<link>http://blog.csanchez.org/2012/09/12/puppet-for-java-developers-talk-at-javazone-oslo-2012/</link>
		<comments>http://blog.csanchez.org/2012/09/12/puppet-for-java-developers-talk-at-javazone-oslo-2012/#comments</comments>
		<pubDate>Wed, 12 Sep 2012 09:35:19 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[javazone]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blog.carlossanchez.eu/?p=1268</guid>
		<description><![CDATA[I am in Oslo right now speaking at JavaZone about Puppet for Java developers covering some of the basics but then getting into using Vagrant, Puppet and Puppet modules, to manage maven dependencies, postgresql, tomcat, and apache as examples. The sample code showcases how to effectively use &#8230; <a href="http://blog.csanchez.org/2012/09/12/puppet-for-java-developers-talk-at-javazone-oslo-2012/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1268&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-1273" title="javazone" alt="" src="http://carlossanchez.files.wordpress.com/2012/09/javazone.png?w=150&#038;h=150" height="150" width="150" />I am in Oslo right now speaking at <a href="http://javazone.no/">JavaZone</a> about <a href="http://www.slideshare.net/carlossg/puppet-for-java-developers-javazone-no-2012">Puppet for Java developers</a> covering some of the basics but then getting into using Vagrant, Puppet and Puppet modules, to manage <a href="http://forge.puppetlabs.com/maestrodev/maven">maven</a> dependencies, <a href="http://forge.puppetlabs.com/inkling/postgresql">postgresql</a>, <a href="https://github.com/carlossg/puppet-tomcat">tomcat</a>, and <a href="http://forge.puppetlabs.com/puppetlabs/apache">apache</a> as examples.</p>
<p>The <a href="https://github.com/carlossg/puppet-for-java-devs">sample code</a> showcases how to effectively use Puppet and modules, with unit testing and testing with Vagrant.</p>
<ul>
<li><a href="http://vagrantup.com/">Vagrant</a> for VM creation and provisioning</li>
<li><a href="http://librarian-puppet.com/">librarian-puppet</a> for automatic module installation</li>
<li><a href="http://rspec-puppet.com/">puppet-rspec</a> for puppet manifest testing</li>
</ul>
<p><strong>Update</strong>: The video is now up. Run a bit short on time and didn&#8217;t have as much time as I wanted for the demo but hopefully the <a href="https://github.com/carlossg/puppet-for-java-devs">sample code</a> is useful to understand the tools involved.</p>
<div class="embed-vimeo"><iframe src="http://player.vimeo.com/video/49483627" width="584" height="329" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
<iframe src='http://www.slideshare.net/slideshow/embed_code/14260011' width='584' height='479'></iframe>
<blockquote>
<div>Puppet is an infrastructure-as-code tool that allows easy and automated provisioning of servers, defining the packages, configuration, services,&#8230; in code. Enabling DevOps culture, tools like Puppet help drive Agile development all the way to operations and systems administration, and along with continuous integration tools like Jenkins, it is a key piece to accomplish repeatability and continuous delivery, automating the operations side during development, QA or production, and enabling testing of systems configuration.</div>
<div>Traditionally a field for system administrators, Puppet can empower developers, allowing both to collaborate coding the infrastructure needed for their developments, whether it runs in hardware, virtual machines or cloud. Developers and sysadmins can define what JDK version must be installed, application server, version, configuration files, war and jar files,&#8230; and easily make changes that propagate across all nodes.</div>
<div>Using Vagrant, a command line automation layer for VirtualBox, they can also spin off virtual machines in their local box, easily from scratch with the same configuration as production servers, do development or testing and tear them down afterwards.</div>
<div>We’ll show how to install and manage Puppet nodes with JDK, multiple application server instances with installed web applications, database, configuration files and all the supporting services. Including getting up and running with Vagrant and VirtualBox for quickstart and Puppet experiments, as well as setting up automated testing of the Puppet code.</div>
</blockquote>
<p style="text-align:center;"><a href="http://www.flickr.com/photos/carlossg/7945457152/in/set-72157631440787632/"><img class="aligncenter" title="Aurlandsfjellet National Tourist Route" alt="" src="http://farm9.staticflickr.com/8309/7945457152_b15a2ecbec.jpg" height="375" width="500" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1268/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1268&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2012/09/12/puppet-for-java-developers-talk-at-javazone-oslo-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/09/javazone.png?w=150" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/09/javazone.png?w=150" medium="image">
			<media:title type="html">javazone</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8309/7945457152_b15a2ecbec.jpg" medium="image">
			<media:title type="html">Aurlandsfjellet National Tourist Route</media:title>
		</media:content>
	</item>
		<item>
		<title>Cheap backups with Amazon Glacier</title>
		<link>http://blog.csanchez.org/2012/08/27/cheap-backups-with-amazon-glacier/</link>
		<comments>http://blog.csanchez.org/2012/08/27/cheap-backups-with-amazon-glacier/#comments</comments>
		<pubDate>Mon, 27 Aug 2012 10:13:49 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[glacier]]></category>

		<guid isPermaLink="false">http://blog.carlossanchez.eu/?p=1248</guid>
		<description><![CDATA[Last week Amazon announced Amazon Glacier, where you can have files stored at $0.01 per GB / month, quite a good deal, considering that S3 goes for $0.093 GB/month with reduced redundancy, or Dropbox at its best is 0.825/GB committing to 100GB for &#8230; <a href="http://blog.csanchez.org/2012/08/27/cheap-backups-with-amazon-glacier/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1248&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft  wp-image-1256" title="amazon aws" src="http://carlossanchez.files.wordpress.com/2012/08/amazon.png?w=240&#038;h=88" alt="" width="240" height="88" />Last week Amazon announced <a href="http://aws.amazon.com/glacier">Amazon Glacier</a>, where you can have files stored at <a href="http://aws.amazon.com/glacier/pricing/">$0.01 per GB / month</a>, quite a good deal, considering that S3 goes for <a href="http://aws.amazon.com/s3/pricing/">$0.093 GB/month</a> with reduced redundancy, or Dropbox at its best is 0.825/GB committing to 100GB for a full year, although obviously they fill very different use cases.</p>
<p>To get that pricing there are some drawbacks that make it only useful for storing files that don&#8217;t need to be retrieved often, ie. backups for disaster recovery. Downloading or listing files in Glacier take more than 4 hours, so that gives you an idea. Behind the scenes it uses Amazon SQS (Simple Queue Service) and SNS (Simple Notification Service) to handle the download and inventory requests, so you can do extra things like getting emails when your requests are ready.</p>
<p>I have created <a href="http://github.com/carlossg/glacier-cli">glacier-cli</a> using the Java API to upload, download, delete and list files stored in Glacier from the command line, as Amazon only provides the APIs for now and some examples. Make sure you save the output when uploading the files, as you will need the ids of the files later on when you need to download them.</p>
<p>Get the code from <a href="https://github.com/carlossg/glacier-cli">GitHub</a>.</p>
<h1>Glacier-CLI</h1>
<h2>Building</h2>
<p><code>mvn clean package</code></p>
<h2>Configuration</h2>
<p>Create <code>$HOME/AwsCredentials.properties</code> with your AWS keys</p>
<pre><code>secretKey=…
accessKey=…

</code></pre>
<h2><a name="commands" href="https://github.com/carlossg/glacier-cli#commands"></a>Commands</h2>
<ul>
<li><code>upload vault_name file1 file2 …</code></li>
<li><code>download vault_name archiveId output_file</code></li>
<li><code>delete vault_name archiveId</code></li>
<li><code>inventory vault_name</code></li>
</ul>
<h2><a name="command-line-options" href="https://github.com/carlossg/glacier-cli#command-line-options"></a>Command line options</h2>
<pre><code> -output &lt;file_name&gt;   File to save the inventory to. Defaults to 'glacier.json'
 -queue &lt;queue_name&gt;   SQS queue to use for inventory retrieval. Defaults to 'glacier'
 -region &lt;region&gt;      Specify URL as the web service URL to use. Defaults to 'us-east-1'
 -topic &lt;topic_name&gt;   SNS topic to use for inventory retrieval. Defaults to 'glacier'
</code></pre>
<h2><a name="examples" href="https://github.com/carlossg/glacier-cli#examples"></a>Examples</h2>
<p>Upload file1 and file2 to vault <code>pictures</code></p>
<p><code>java -jar glacier-1.0-jar-with-dependencies.jar upload pictures file1 file2</code></p>
<p>Download archive with id xxx from vault <code>pictures</code> to file <code>pic.tar</code> (takes &gt;4 hours)</p>
<p><code>java -jar glacier-1.0-jar-with-dependencies.jar download pictures xxx pic.tar</code></p>
<p>Delete archive with id xxx from vault <code>pictures</code></p>
<p><code>java -jar glacier-1.0-jar-with-dependencies.jar delete pictures xxx</code></p>
<p>Get the inventory for vault <code>pictures</code> (takes &gt;4 hours)</p>
<p><code>java -jar glacier-1.0-jar-with-dependencies.jar inventory pictures</code></p>
<p>Upload file1 and file2 to vault <code>pictures</code> in Europe region</p>
<p><code>java -jar glacier-1.0-jar-with-dependencies.jar -region eu-west-1 upload pictures file1 file2</code></p>
<h2><a name="building" href="https://github.com/carlossg/glacier-cli#building"></a></h2>
<h2><a name="more-info" href="https://github.com/carlossg/glacier-cli#more-info"></a></h2>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1248&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2012/08/27/cheap-backups-with-amazon-glacier/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/08/amazon.png?w=150" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/08/amazon.png?w=150" medium="image">
			<media:title type="html">amazon aws</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>

		<media:content url="http://carlossanchez.files.wordpress.com/2012/08/amazon.png?w=300" medium="image">
			<media:title type="html">amazon aws</media:title>
		</media:content>
	</item>
		<item>
		<title>From Dev to DevOps, videos from the talks</title>
		<link>http://blog.csanchez.org/2012/06/26/from-dev-to-devops-talk-videos/</link>
		<comments>http://blog.csanchez.org/2012/06/26/from-dev-to-devops-talk-videos/#comments</comments>
		<pubDate>Tue, 26 Jun 2012 19:01:19 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blog.carlossanchez.eu/?p=1079</guid>
		<description><![CDATA[Some videos of my From Dev to DevOps talks. The slides are available at slideshare. Español: Codemotion Spain 2012 Español: Conferencia Agile Spain CAS 2011 Français (-glish) (watch me butcher the French language): Paris JUG January 2012 at Parleys<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1079&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://carlossanchez.files.wordpress.com/2012/06/borat_devops.png"><img class="size-medium wp-image-1238 alignright" title="Borat DevOps" src="http://carlossanchez.files.wordpress.com/2012/06/borat_devops.png?w=300&#038;h=114" alt="To make error is human. To propagate error to all server in automatic way is #DevOps" width="300" height="114" /></a>Some videos of my <em>From Dev to DevOps</em> talks. The slides are available at <a href="http://www.slideshare.net/carlossg/presentations">slideshare</a>.</p>
<p>Español: <a href="http://youtu.be/E_OE4l3t5BA">Codemotion Spain 2012</a></p>
<p>Español: <a href="http://www.svideo.uji.es/peli.php?codi=776&amp;lg=">Conferencia Agile Spain CAS 2011</a></p>
<p>Français (-glish) (watch me butcher the French language): <a href="http://www.parleys.com/#st=5&amp;id=2980&amp;sl=9">Paris JUG January 2012 at Parleys</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1079/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1079&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2012/06/26/from-dev-to-devops-talk-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/06/borat_devops.png?w=150" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/06/borat_devops.png?w=150" medium="image">
			<media:title type="html">Borat DevOps</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>

		<media:content url="http://carlossanchez.files.wordpress.com/2012/06/borat_devops.png?w=300" medium="image">
			<media:title type="html">Borat DevOps</media:title>
		</media:content>
	</item>
		<item>
		<title>MaestroDev named DevOps &#8220;Cool Vendor&#8221; by Gartner</title>
		<link>http://blog.csanchez.org/2012/05/23/maestrodev-named-devops-cool-vendor-by-gartner/</link>
		<comments>http://blog.csanchez.org/2012/05/23/maestrodev-named-devops-cool-vendor-by-gartner/#comments</comments>
		<pubDate>Wed, 23 May 2012 09:43:24 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[maestrodev]]></category>
		<category><![CDATA[gartner]]></category>

		<guid isPermaLink="false">http://blog.carlossanchez.eu/?p=1221</guid>
		<description><![CDATA[Warning, some self-promotion ahead! Gartner has published their annual list of Cool Vendors, including a section for DevOps, where we are one of the 5 selected companies. Not a big fan of this analyst things, but quite proud of being &#8230; <a href="http://blog.csanchez.org/2012/05/23/maestrodev-named-devops-cool-vendor-by-gartner/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1221&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://carlossanchez.files.wordpress.com/2012/05/logo.png"><img class="alignleft size-thumbnail wp-image-1222" title="MaestroDev" src="http://carlossanchez.files.wordpress.com/2012/05/logo.png?w=150&#038;h=39" alt="MaestroDev logo" width="150" height="39" /></a></p>
<p>Warning, some self-promotion ahead! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Gartner has published their annual list of <strong><em>Cool Vendors</em></strong>, including a section for DevOps, where <strong>we are one of the 5 selected companies</strong>.</p>
<p>Not a big fan of this analyst things, but quite proud of being included in such a short list, right next to the people from <a href="http://cfengine.com/">CFEngine</a>, <a href="http://www.opscode.com/">Opscode</a> and <a href="http://puppetlabs.com">Puppet Labs</a>, that are very active on the DevOps space and, in the case of PuppetLabs, whose products we use heavily for automation.</p>
<blockquote><p>MaestroDev, an innovation leader in DevOps Orchestration, has been included in the list of “Cool Vendors in DevOps, 2012” report by Gartner, Inc.</p></blockquote>
<p>And thanks to our great customers too!</p>
<blockquote><p>Keith Campbell, CTO, Informatics, said “The Maestro product has automated our build process all the way through packaging. We are using our same toolset, but the Maestro Composition engine gives us consistency and speed that we did not have before. With Maestro, we are planning our development-cloud environment as well — reducing our build cost even further because we can dynamically integrate hybrid resources and external services into our workflows.”</p></blockquote>
<p>You can check out the rest of the <a href="http://www.maestrodev.com/blog/maestrodev-named-devops-cool-vendor-in-2012-by-leading-industry-analyst-firm/">press release at the MaestroDev blog</a>, and the <a href="http://www.gartner.com/technology/research/cool-vendors/">Gartner Cool Vendors report</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1221&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2012/05/23/maestrodev-named-devops-cool-vendor-by-gartner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/05/logo.png?w=150" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/05/logo.png?w=150" medium="image">
			<media:title type="html">MaestroDev</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatically download and install VirtualBox guest additions in Vagrant</title>
		<link>http://blog.csanchez.org/2012/05/03/automatically-download-and-install-virtualbox-guest-additions-in-vagrant/</link>
		<comments>http://blog.csanchez.org/2012/05/03/automatically-download-and-install-virtualbox-guest-additions-in-vagrant/#comments</comments>
		<pubDate>Thu, 03 May 2012 15:22:03 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[maestrodev]]></category>
		<category><![CDATA[vagrant]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://blog.carlossanchez.eu/?p=1209</guid>
		<description><![CDATA[So, are you already using Vagrant to manage your VirtualBox VMs? Then you probably have realized already how annoying is to keep the VBox guest additions up to date in your VMs. Don&#8217;t worry, you can update them with just one command &#8230; <a href="http://blog.csanchez.org/2012/05/03/automatically-download-and-install-virtualbox-guest-additions-in-vagrant/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1209&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://carlossanchez.files.wordpress.com/2012/03/vagrant_logo.png"><img class="alignleft size-thumbnail wp-image-1202" title="Vagrant Logo" src="http://carlossanchez.files.wordpress.com/2012/03/vagrant_logo.png?w=137&#038;h=150" alt="" width="137" height="150" /></a>So, are you already using <strong><a title="Learning Puppet or Chef? Check out Vagrant!" href="http://blog.carlossanchez.eu/2012/03/29/learning-puppet-or-chef-check-out-vagrant/">Vagrant</a></strong> to manage your VirtualBox VMs?</p>
<p>Then you probably have realized already how annoying is to keep the VBox guest additions up to date in your VMs.</p>
<p>Don&#8217;t worry, you can update them with <strong>just one command</strong> or <strong>automatically</strong> on each start using the <a href="https://github.com/dotless-de/vagrant-vbguest">Vagrant-vbguest plugin</a>.</p>
<h1>Installation</h1>
<p>Requires vagrant 0.9.4 or later (including 1.0)</p>
<blockquote><p>Since vagrant v1.0.0 the prefered installation method for vagrant is using the provided packages or installers.</p></blockquote>
<p>Therefore if you installed Vagrant as a package (rpm, deb, dmg,&#8230;)</p>
<pre class="brush: plain; title: ; notranslate">
vagrant gem install vagrant-vbguest
</pre>
<p>Or if you installed vagrant using RubyGems (<em>gem install vagrant</em>):</p>
<pre class="brush: plain; title: ; notranslate">
gem install vagrant-vbguest
</pre>
<h1>Usage</h1>
<p>By default the plugin will check what version of the guest additions is installed in the VM every time it is started with <em>vagrant start</em>. Note that it won&#8217;t be checked when resuming a box.</p>
<p>In any case, it can be disabled in the Vagrantfile</p>
<pre class="brush: ruby; title: ; notranslate">
Vagrant::Config.run do |config|
  # set auto_update to false, if do NOT want to check the correct additions
  # version when booting this machine
  config.vbguest.auto_update = false
end
</pre>
<p>If it detects an outdated version, it will <strong>automatically install</strong> the matching version from the VirtualBox installation, located at</p>
<ul>
<li>linux : <code>/usr/share/virtualbox/VBoxGuestAdditions.iso</code></li>
<li>Mac : /<code>Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso</code></li>
<li>Windows : <code>%PROGRAMFILES%/Oracle/VirtualBox/VBoxGuestAdditions.iso</code></li>
</ul>
<p>The location can be overridden with the <em>iso_path</em> parameter in your Vagrantfile, and can point to a http server</p>
<pre class="brush: ruby; title: ; notranslate">
Vagrant::Config.run do |config|
  config.vbguest.iso_path = &quot;#{ENV['HOME']}/Downloads/VBoxGuestAdditions.iso&quot;
  # or
  config.vbguest.iso_path = &quot;http://company.server/VirtualBox/$VBOX_VERSION/VBoxGuestAdditions.iso&quot;
end
</pre>
<p>If you have disabled the automatic update, it still easy to <strong>manually update</strong> the VirtualBox Guest Additions version, just running from the command line</p>
<pre class="brush: plain; title: ; notranslate">
vagrant vbguest
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1209&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2012/05/03/automatically-download-and-install-virtualbox-guest-additions-in-vagrant/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>

		<media:content url="http://carlossanchez.files.wordpress.com/2012/03/vagrant_logo.png?w=137" medium="image">
			<media:title type="html">Vagrant Logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Learning Puppet or Chef? Check out Vagrant!</title>
		<link>http://blog.csanchez.org/2012/03/29/learning-puppet-or-chef-check-out-vagrant/</link>
		<comments>http://blog.csanchez.org/2012/03/29/learning-puppet-or-chef-check-out-vagrant/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 11:14:51 +0000</pubDate>
		<dc:creator>Carlos Sanchez</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[maestrodev]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[vagrant]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">https://carlossanchez.wordpress.com/?p=1182</guid>
		<description><![CDATA[If you are starting to use Puppet or Chef, you must have Vagrant. Learning Puppet can be a tedious task, getting up the master, agents, writing your first manifests,&#8230; A good way to start is using Vagrant, an Oracle VirtualBox command &#8230; <a href="http://blog.csanchez.org/2012/03/29/learning-puppet-or-chef-check-out-vagrant/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1182&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://carlossanchez.files.wordpress.com/2012/03/vagrant_logo.png"><img class="alignleft size-thumbnail wp-image-1202" title="Vagrant Logo" src="http://carlossanchez.files.wordpress.com/2012/03/vagrant_logo.png?w=137&#038;h=150" alt="" width="137" height="150" /></a>If you are starting to use Puppet or Chef, you must have <a href="http://vagrantup.com/">Vagrant</a>.</p>
<p>Learning Puppet can be a tedious task, getting up the master, agents, writing your first manifests,&#8230; A good way to start is using Vagrant, an Oracle VirtualBox command line automation tool, that allows easy Puppet and Chef provisioning on VirtualBox VMs.</p>
<p>Vagrant projects are composed by <strong>base boxes</strong>, specifically configured for Vagrant with Puppet/Chef, vagrant username and password, and anything else you may want to add, plus the configuration to apply to those base boxes, defined with Puppet or Chef. That way we can have several projects using the same base boxes shared where the only difference are the Puppet/Chef definitions. For instance a database VM and a web server VM can both use the same base box and just have different Puppet manifests, and when Vagrant starts them, it will apply the specific configuration. That also allows to<strong> share boxes and configuration files across teams</strong>, for instance having one base box with the Linux flavor used in a team, we can just have in source control the Puppet manifests to apply for the different configurations that anybody from Operations to Developers can use.</p>
<p>There is a list of available VMs or base boxes ready to use with Vagrant at <a href="http://www.vagrantbox.es">www.vagrantbox.es</a>. But you can build your own and share it anywhere, as they are just (big) VirtualBox VM files, easily using <a href="https://github.com/jedi4ever/veewee">VeeWee</a>, or changing a base box and rebundling it with <a href="http://vagrantup.com/docs/base_boxes.html#package_and_distribute"><em>vagrant package</em></a>.</p>
<h2>Usage</h2>
<p>Once you have <a href="http://vagrantup.com/docs/getting-started/index.html">installed Vagrant</a> and VirtualBox.</p>
<p>Vagrant <em>init</em> will create a sample Vagrantfile, the project definition file that can be customized.</p>
<pre class="brush: plain; title: ; notranslate">
$ vagrant init myproject
</pre>
<p>Then in the <em>Vagrantfile</em> you can change the default box settings, and add basic Puppet provisioning</p>
<pre class="brush: plain; title: ; notranslate">
config.vm.box = &quot;centos-6&quot;
config.vm.box_url = &quot;https://vagrant-centos-6.s3.amazonaws.com/centos-6.box&quot;

config.vm.provision :puppet do |puppet|
  puppet.manifests_path = &quot;manifests&quot;
  puppet.manifest_file = &quot;site.pp&quot;
end
</pre>
<p>In <em>manifests/site.pp</em> you can try any puppet manifest.</p>
<pre class="brush: plain; title: ; notranslate">
file { '/etc/motd':
  content =&gt; 'Welcome to your Vagrant-built virtual machine! Managed by Puppet.\n'
}

</pre>
<p>Vagrant <em>up</em> will download the box the first time, start the VM and apply any configuration defined in Puppet</p>
<pre class="brush: plain; title: ; notranslate">
$ vagrant up
</pre>
<p>vagrant <em>ssh</em> will open a shell into the box. Under the hood vagrant is redirecting the host port 2222 to the vagrant box 22</p>
<pre class="brush: plain; title: ; notranslate">
$ vagrant ssh
</pre>
<p>The vm can be suspended and resumed at any time</p>
<pre class="brush: plain; title: ; notranslate">
$ vagrant suspend
$ vagrant resume
</pre>
<p>and later on destroyed, which will delete all the VM files.</p>
<pre class="brush: plain; title: ; notranslate">
$ vagrant destroy
</pre>
<p>And then we can start again from scratch with vagrant <em>up</em> getting a completely new vm where we can make any mistakes <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/carlossanchez.wordpress.com/1182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/carlossanchez.wordpress.com/1182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.csanchez.org&#038;blog=1255600&#038;post=1182&#038;subd=carlossanchez&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.csanchez.org/2012/03/29/learning-puppet-or-chef-check-out-vagrant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:thumbnail url="http://carlossanchez.files.wordpress.com/2012/03/vagrant_logo.png?w=137" />
		<media:content url="http://carlossanchez.files.wordpress.com/2012/03/vagrant_logo.png?w=137" medium="image">
			<media:title type="html">Vagrant Logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/e388b4e9db67a1cd9544c7d4f0455569?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">carlossanchez</media:title>
		</media:content>
	</item>
	</channel>
</rss>
