Hi,

I am trying to convince aptitude update to run only when a file
changes in /etc/apt/sources.list.d:

exec {
<snip>
    "aptitude-update":
      command     => "/usr/bin/aptitude update",
      subscribe     => "$basedir/sources.list.d",
      refreshonly   => true;
  }
  File { owner => 'root', group => 'root', mode => '0644' }
  file {
    "$basedir":
      ensure => directory;
    "$basedir/sources.list.d":
      purge   => true,
      recurse => true,
      ensure  => directory;
<snip>
  }
define apt::source ($deb_type, $url, $dist, $opt, $ensure) {
  include apt
  file {
    "${apt::basedir}/sources.list.d/${name}.list":
      content => "#$name\n$deb_type $url $dist $opt\n\n",
      ensure  => $ensure;
  }
}

and then, from another module:
  apt::source {
    "Debian_backports":
      deb_type => "deb",
      url      => "http://backports.debian.org/debian-backports";,
      dist     => "squeeze-backports",
      opt      => "main",
      ensure   => present;
  }

however, when I run this on a target system, puppet generates
the .list file in /etc/apt/sources.list.d but forgets to schedule a
run of aptitude update.
I tried some different approaches:
remove the subscribe line from the exec and add a notify =>
Exec['aptitude-update']; to the apt::source definition, however, that
results to a depency loop to my surprise (the loop seems to be related
to the package ensure => latest objects, elsewhere...

so, what would be the best way to convince my puppet agents to run a
aptitude update when new files apear in the sources.list.d dir?

thanks for your help!
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to