pkgdmg Provider for Deploying pkgs with OS X

185 views
Skip to first unread message

Gary Larizza

unread,
Dec 9, 2009, 1:15:42 PM12/9/09
to Puppet Users
Hi All,

I'm looking to clean up the way I deploy packages to OS X clients. I
have a puppetmaster and a webserver that hosts installation .pkg files
at every site in our district. I've been using variations of the
pkg_deploy.pp file that utilizes the pkgdmg provider: Here's the
file:

define pkg_deploy($sourcedir = false)
{
$sourcedir_real = $sourcedir ? {
false => "http://testing.huronhs.com/pkgs/general_image",
default => $sourcedir
}
package { $name:
ensure => installed,
provider => pkgdmg,
source => "$sourcedir_real/$name"
}
}

Every building has a general classfile which utilizes pkg_deploy to
install packages - here's a sample file at one of our buildings:

class wes_general_image {

include staff

# Custom Installers First
pkg_deploy_wes {"Office2004.dmg":
alias => office2004wes,
before => Package[officeupdateswes],
}
Package
}
pkg_deploy {"iLife09.dmg":
alias => ilife09wes,
}
pkg_deploy {"iWork09.dmg":
alias => iwork09wes,
}
pkg_deploy {"OfficeUpdates.dmg":
alias => officeupdateswes,
require => Package[office2004wes],
}
pkg_deploy {"Firstclass.dmg": alias => firstclasswes}
pkg_deploy {"Textwrangler23.dmg": alias => textwrangler23wes}
pkg_deploy {"ServerAdmin1057.dmg": alias => serveradmin1057wes}
pkg_deploy {"Timezone.dmg": alias => timezonewes}

} # End of Class


CURRENTLY, I've created separate pkg_deploy classfiles which change
$sourcedir to point back to the local server hosting the package
file. This meant I was creating a "pkg_deploy_buildingname.pp"
classfile for every building, and then every general classfile would
have to make a pkg_deploy_buildingname {} call. It's ugly and
improper, and I need to fix it.

My question is - would I create a single class file for the district
that defines all the packages ala: pkg_deploy{"Package.pkg": alias =>
pkgalias} and then have separate building-level files that include
this file but somehow modify the $sourcedir variable? What would that
call look like? Thanks for any help/pointers you guys can give me!

-Gary

Nigel Kersten

unread,
Dec 9, 2009, 1:49:38 PM12/9/09
to puppet...@googlegroups.com
On Wed, Dec 9, 2009 at 10:15 AM, Gary Larizza <glar...@me.com> wrote:
> Hi All,
>
> I'm looking to clean up the way I deploy packages to OS X clients.  I
> have a puppetmaster and a webserver that hosts installation .pkg files
> at every site in our district.  I've been using variations of the
> pkg_deploy.pp file that utilizes the pkgdmg provider:  Here's the
> file:
>
> define pkg_deploy($sourcedir = false)
> {
>  $sourcedir_real = $sourcedir ? {
>    false => "http://testing.huronhs.com/pkgs/general_image",
>    default => $sourcedir
>  }
>  package { $name:
>    ensure => installed,
>    provider => pkgdmg,
>    source => "$sourcedir_real/$name"
>  }
> }

Are you really committed to this definition? I don't quite see the
advantage of it myself.

We do it like this.

# Package resource defaults for OS X clients
Package { ensure => installed, provider => pkgdmg }

Then we have a fact called "pkgbase" that sets the http server the
packages are delivered from for various locations with a fallback to
the default location. We also make use of variables so it is simpler
to increment a given package like:

$office_2004_pkg = "Office2004-20091209.dmg"
package { "$office_2004_pkg": source => "$pkgbase/$office_2004_pkg", }

Doesn't that let you achieve the same thing in a simpler manner?
> --
>
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
>
>



--
nigel
Reply all
Reply to author
Forward
0 new messages