Trying again, less typos:

http://docs.puppetlabs.com/references/latest/type.html#exec
scroll down to the "refreshonly" parameter and compare it to your code.

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

----- Original Message -----
From: "Phil Gardner" <phil.gardne...@gmail.com>
To: puppet-users@googlegroups.com
Sent: Thursday, June 20, 2013 1:22:44 PM
Subject: Re: [Puppet Users] Templates modified on puppetmaster but clients not 
seeing changes

nodes.pp:

node /^testserver-.*/ {
  $centos_version = '6.4'
  $updates_enabled = '1'
  include yum
}

--

modules/yum/manifests/init.pp:

class yum {
  file { 'CentOS-Base.repo':
    mode    => '0644',
    owner   => 'root',
    group   => 'root',
    path    => '/etc/yum.repos.d/CentOS-Base.repo',
    content => template('yum/CentOS-Base.repo.erb'),
    notify  => Exec['clean'],
  }
  exec { 'clean':
    command     => 'yum clean all',
    path        => '/usr/bin/',
--> subscribe   => File["/etc/yum.repos.d/CentOS-Base.repo"],   <--- You need 
to tell it what file to watch !
    refreshonly => true,
  }
}

--

modules/yum/templates/CentOS-Base.repo.erb:

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://yumrepo.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://yumrepo2.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/updates/$basearch/
enabled=<%= updates_enabled -%>
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to