Tom Boland
2011-Mar-08 12:30 UTC
[Puppet Users] template file changed, but no notify being sent
Hi guys, I have the following which I use to set up /etc/sysconfing/spamassassin. One of the options in this file sets the listening interface to the IP address on eth0, and using a template seemed like a perfect way to achieve this, and it does work very well for the initial setup. It would also be nice for me to be able to change the template, and have the file automatically update on the clients, and for the service to be notified, but unfortunately, it doesn''t seem to work like that. This is the relevant snippet from my module: #sysconfig/spamassassin file - needs to use a template as spamassassin #is configured to listen on it''s own IP (uses ipaddress_eth0 from facter) file { "/etc/sysconfig/spamassassin": path => "/etc/sysconfig/spamassassin", owner => root, group => root, mode => 644, content => template("/etc/puppet/conf/development/modules/fh_spam_server/templates/etc_sysconfig_spamassassin.erb"), require => Package["spamassassin"], notify => Service["spamassassin"], } this is the contents of the template: SPAMDOPTIONS="-d -L -i <%= ipaddress_eth0 -%> -A 10.44.217.0/20 -A 10.216.15.242/32 -A 10.216.1.14/32 -A 10.216.15.0/24 -A 213.171.193.103/32 -m 40 -q -x -u spamd --min-children=40" When changing the template at, puppet doesn''t seem to notice. I take it that this file isn''t md5sum''d in the same way as static files because in a way the content is non-deterministic? My question is, how could I achieve what I want, which is to edit this file, and have it updated on the clients, and the spamassassin service notified. Many thanks. Tom. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nan Liu
2011-Mar-08 21:26 UTC
Re: [Puppet Users] template file changed, but no notify being sent
On Tue, Mar 8, 2011 at 12:30 PM, Tom Boland <tom@t0mb.net> wrote:> Hi guys, > > I have the following which I use to set up /etc/sysconfing/spamassassin. > One of the options in this file sets the listening interface to the IP > address on eth0, and using a template seemed like a perfect way to achieve > this, and it does work very well for the initial setup. It would also be > nice for me to be able to change the template, and have the file > automatically update on the clients, and for the service to be notified, but > unfortunately, it doesn''t seem to work like that. > > This is the relevant snippet from my module: > > #sysconfig/spamassassin file - needs to use a template as spamassassin > #is configured to listen on it''s own IP (uses ipaddress_eth0 from facter) > file { "/etc/sysconfig/spamassassin": > path => "/etc/sysconfig/spamassassin", > owner => root, > group => root, > mode => 644, > content => > template("/etc/puppet/conf/development/modules/fh_spam_server/templates/etc_sysconfig_spamassassin.erb"), > require => Package["spamassassin"], > notify => Service["spamassassin"], > } > > this is the contents of the template: > > SPAMDOPTIONS="-d -L -i <%= ipaddress_eth0 -%> -A 10.44.217.0/20 -A > 10.216.15.242/32 -A 10.216.1.14/32 -A 10.216.15.0/24 -A 213.171.193.103/32 > -m 40 -q -x -u spamd --min-children=40" > > When changing the template at, puppet doesn''t seem to notice. I take it > that this file isn''t md5sum''d in the same way as static files because in a > way the content is non-deterministic? > > My question is, how could I achieve what I want, which is to edit this file, > and have it updated on the clients, and the spamassassin service notified.This should trigger the refresh. If changing the template doesn''t cause the config file to change and trigger the service refresh, please provide more details about your puppet version and debug output. If it''s a reproducible problem, we should file a bug for this issue, Thanks, Nan -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ben Hughes
2011-Mar-08 23:15 UTC
Re: [Puppet Users] template file changed, but no notify being sent
On Tue, Mar 08, 2011 at 12:30:05PM +0000, Tom Boland wrote:> this is the contents of the template: > > SPAMDOPTIONS="-d -L -i <%= ipaddress_eth0 -%> -A 10.44.217.0/20 -A > 10.216.15.242/32 -A 10.216.1.14/32 -A 10.216.15.0/24 -A > 213.171.193.103/32 -m 40 -q -x -u spamd --min-children=40"Change that to be: SPAMDOPTIONS="-d -L -i <%= ipaddress_eth0 %> -A 10.44.217.0/20 -A 10.216.15.242/32 -A 10.216.1.14/32 -A 10.216.15.0/24 -A 213.171.193.103/32 -m 40 -q -x -u spamd --min-children=40" You had a -% in the template. Which wouldn''t have helped. -- Ben Hughes || http://www.puppetlabs.com/ -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Tom Boland
2011-Mar-09 09:12 UTC
Re: [Puppet Users] template file changed, but no notify being sent
Guys, I''m sorry. I was a bit confused over how to reference template paths relatively (I''m managing someone elses puppet deployment you see!). I fully qualified the path to the template in the development tree, and then copied to production. You can see below that my path is still pointing at the development tree, although I''ve been editing the production version of the template! Fixed now, I''ve got a relative path that will work wherever the template is! Thanks for the help. Tom. On 03/08/2011 09:26 PM, Nan Liu wrote:> On Tue, Mar 8, 2011 at 12:30 PM, Tom Boland<tom@t0mb.net> wrote: >> Hi guys, >> >> I have the following which I use to set up /etc/sysconfing/spamassassin. >> One of the options in this file sets the listening interface to the IP >> address on eth0, and using a template seemed like a perfect way to achieve >> this, and it does work very well for the initial setup. It would also be >> nice for me to be able to change the template, and have the file >> automatically update on the clients, and for the service to be notified, but >> unfortunately, it doesn''t seem to work like that. >> >> This is the relevant snippet from my module: >> >> #sysconfig/spamassassin file - needs to use a template as spamassassin >> #is configured to listen on it''s own IP (uses ipaddress_eth0 from facter) >> file { "/etc/sysconfig/spamassassin": >> path => "/etc/sysconfig/spamassassin", >> owner => root, >> group => root, >> mode => 644, >> content => >> template("/etc/puppet/conf/development/modules/fh_spam_server/templates/etc_sysconfig_spamassassin.erb"), >> require => Package["spamassassin"], >> notify => Service["spamassassin"], >> } >> >> this is the contents of the template: >> >> SPAMDOPTIONS="-d -L -i<%= ipaddress_eth0 -%> -A 10.44.217.0/20 -A >> 10.216.15.242/32 -A 10.216.1.14/32 -A 10.216.15.0/24 -A 213.171.193.103/32 >> -m 40 -q -x -u spamd --min-children=40" >> >> When changing the template at, puppet doesn''t seem to notice. I take it >> that this file isn''t md5sum''d in the same way as static files because in a >> way the content is non-deterministic? >> >> My question is, how could I achieve what I want, which is to edit this file, >> and have it updated on the clients, and the spamassassin service notified. > This should trigger the refresh. If changing the template doesn''t > cause the config file to change and trigger the service refresh, > please provide more details about your puppet version and debug > output. If it''s a reproducible problem, we should file a bug for this > issue, > > Thanks, > > Nan-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.