Installing Mule with Puppet

Puppet modules are a fantastic way to deploy and manage specific applications. The Puppet Forge contains a wealth of third-party modules that allow you to do some awesome stuff with a minimum of work. In this post, we use a module I created to install Mule ESB CE. Also, I would like to take this time to thank all the other contributors that helped imporve and develop this module. If you would like to contirbute, you can find the source on Github.

The first step is to install Puppet, Facter, and RubyGems. Since we’re using Ubuntu, we’ll use apt-get to install these packages. If you decide to use a different OS (or the Learning Puppet VM), use whatever package manager is appropriate for your platform.

  1. Open a terminal window and type the following command: apt-get install puppet puppetmaster facter rubygems

  2. Next, install the puppet-module gem. We’ll need this in order to pull the Mule module from the Forge and install it.

    gem install puppet-module

  3. Switch to your Puppet module directory. This is where you’ll run the puppet-module install command.

    cd /etc/puppet/modules

  4. Now we can install the Mule module:

    puppet-module install ryandcarter/mule

  5. Edit /etc/puppet/manifests/site.pp with your favorite editor. No additional configuration is needed unless you want to use a different JDK. If so edit the java class to point to your required version:

    By default this will install the base container. If you want to deploy an application to the instance use the following site configuration:

  6. Up to this point, you’ve installed Puppet on your system, used puppet-module to download and extract the Mule module, and configured your site.pp such that Puppet will manage Mule on your system. Now, do a Puppet run to kick off the Mule install:

    puppet agent --test

And that's it! You should have a Standalone Mule container up and running with Puppet. If you want to take this further, I have also setup a demo Vagrant setup that uses Librarian Puppet for managing the module dependencies and Heira for environment configuration such as Mule versions etc. here: https://github.com/ryandcarter/vagrant-puppet-mule. I will go into this setup in a future blog.

Written on January 25, 2015