Previous posthave covered basic Puppet install. Now it is time to move to first module.
I created very basic module which will use appdmg provider. This is good to remember as on OS X this is standard packaging method of software distribution. To be honest, it is not very elegant nor efficient as Linux RPM or DEB packaging methods – but it is all I have. :)
Unfortunately as there are no repositories (yes, I know about ports, homebrew) and so on but there are not used to distribute software like VMWare, Firefox etc. Enough bullshit, let’s see some code!
class osx-firefox { package { 'Firefox': provider => appdmg, source => "http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/latest/mac/en-US/Firefox%2019.0.dmg", ensure => installed, } }
You can see I named module osx-firefox as I have every app as separate module. Why is this useful? If I want to include for example package osx-vmware to node “hack-pro” but not to “macbook-air” node I can with simple:
include osx-vmware
This code is stored in file init.pp which is in $module_path/osx-firefox/manifests/init.pp
You can do test run by removing Firefox and running (this, with –noop option is simple method to test modules):
puppet apply path_to_init.pp
Hooray, my first module works like a charm and installed Firefox for me.