This appears to be working for me, but suggestions on improvements are
welcome:
master/manifests/definitions/stowedpackage.pp:
> define stowedpackage ( $basepackage, $version,
> $rsyncserver=''gold.cae.tntech.edu'',
> $rsyncmodule=''metastow'',
> $stowdestdir=''/usr/local/stow'' ) {
>
> file { stow_initiator:
> source =>
"puppet:///files/stow-initiator_${basepackage}-${version}",
> path =>
"/etc/puppet/stow-initiator_${basepackage}-${version}",
> alias => "stow-initiator_${basepackage}-${version}"
> }
>
> exec { download:
> command => "/usr/bin/rsync -a --delete
${rsyncserver}::${rsyncmodule}/${hardwaremodel}/${basepackage}-${version}
${stowdestdir}",
> refreshonly => true,
> subscribe =>
file["stow-initiator_${basepackage}-${version}"],
> alias => "download_${basepackage}-${version}"
> }
>
> exec { unstow-others:
> command => "cd ${stowdestdir} && stow --delete
${basepackage}-*",
> refreshonly => true,
> subscribe =>
exec["download_${basepackage}-${version}"],
> alias =>
"unstow-others_${basepackage}-${version}"
> }
>
> exec { stow:
> command => "cd ${stowdestdir} ; stow
${basepackage}-${version}",
> refreshonly => true,
> subscribe =>
exec["unstow-others_${basepackage}-${version}"]
> }
>
> }
manifests/site.pp:
> # For stowedpackage definitions, don''t forget to run
"date >
> # /etc/puppet/files/stow-initator_${basepackage}-${version}" on
> # the puppetmaster
>
> stowedpackage {
> "hello-2.2":
> basepackage=>"hello",
> version=>"2.2";
> }
--
Mike Renfro / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- renfro@tntech.edu