Hi all,
Hi have something like:
file { "/opt/localconf/gLite3.1/yaim":
ensure => directory,
recurse => "true",
owner => "root",
group => "root",
mode => "755",
source =>
"puppet://gridinstall01.pic.es/files/opt/localconf/gLite3.1/yaim",
notify => Exec["yaim_conf"],
}
exec { "yaim_conf":
command => "/opt/glite/yaim/bin/yaim -c -s
/opt/localconf/gLite3.1/yaim/pic/site-info.def -n glite-WN",
subscribe => File["/opt/localconf/gLite3.1/yaim"],
timeout => "-1",
}
And I''m trying to run yaim_conf ONLY if something changes in
files /opt/localconf/gLite3.1/yaim.
In the example I have notify and subscribe, but I''ve been playing with
only one, with only the other and both, and ALWAYS exec "yaim_conf" is
executed.
From ytpe refernce:
subscribe
One or more objects that this object depends on. Changes in the subscribed to
objects result in the dependent objects being refreshed (e.g., a service will
get restarted). For instance:
[...]
Currently the exec, mount and service type support refreshing.
SO exec should work, am I wrong?
notify
This parameter is the opposite of subscribe -- it sends events to the specified
object:
[...]
This will restart the sshd service if the sshd config file changes.
It only talks about services, but is exec also supported?
**When doing something like:
notify => Service[sshd],
it di not work, I had to change to service[sshd] (notice no capital
letter in Services)... which is the correct syntax?
TIA,
Arnau
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Hi> [...] > One or more objects that this object depends on. Changes in the subscribed to objects result in the dependent objects being refreshed (e.g., a service will get restarted). For instance: > [...] > Currently the exec, mount and service type support refreshing. > > SO exec should work, am I wrong?it does. However exec execs every time puppet runs, unless you specify certain conditions. Like unless, onlyif or refreshonly. And the latter is what you want. From: http://reductivelabs.com/trac/puppet/wiki/TypeReference#exec "refreshonly The command should only be run as a refresh mechanism for when a dependent object is changed. It only makes sense to use this option when this command depends on some other object;" and afterwards exactly the example you''d like to do is listed. greets pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Arnau Bria wrote:> In the example I have notify and subscribe, but I''ve been playing with > only one, with only the other and both, and ALWAYS exec "yaim_conf" is > executed.You are missing the refreshonly parameter to the exec type. (Nice to see other LCG sites using Puppet, by the way. :-)> **When doing something like: > notify => Service[sshd], > it di not work, I had to change to service[sshd] (notice no capital > letter in Services)... which is the correct syntax?The correct syntax is with a capital letter. I get a warning message when I try with a lower case letter: warning: Deprecation notice: Resource references should now be capitalized on line 6 in file /home/bellman/puppet/TEST/test.pp What version of Puppet are you using? /Bellman --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, 18 Nov 2008 11:22:40 +0100 Peter Meier wrote:> > Hi[...]> it does. However exec execs every time puppet runs, unless you specify > certain conditions. Like unless, onlyif or refreshonly.Ok, I tried to define a unless condition, but I had no good ideas for that (it''s not as easy as rpm -qa|grep whatever)...> And the latter is what you want. From: > http://reductivelabs.com/trac/puppet/wiki/TypeReference#exec > > "refreshonly > > The command should only be run as a refresh mechanism for when a > dependent object is changed. It only makes sense to use this option > when this command depends on some other object;" > > and afterwards exactly the example you''d like to do is listed.Works fine! Thanks Pete, too much doc in few days, I mix parameters from diff types! :-) Sorry for not seeing that in type ref.> greets peteCheers, Arnau --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, 18 Nov 2008 11:32:32 +0100 Thomas Bellman wrote:> > Arnau Bria wrote: > > > In the example I have notify and subscribe, but I''ve been playing > > with only one, with only the other and both, and ALWAYS exec > > "yaim_conf" is executed. > > You are missing the refreshonly parameter to the exec type. > > (Nice to see other LCG sites using Puppet, by the way. :-)We''re trying. Do you have all your worker nodes under puppet? other services? any wiki I could take a look? Maybe we could contact off-list.> The correct syntax is with a capital letter. I get a warning message > when I try with a lower case letter: > > warning: Deprecation notice: Resource references should now be > capitalized on line 6 in file /home/bellman/puppet/TEST/test.pp > > What version of Puppet are you using?# rpm -qa|grep puppet puppet-0.24.5-1.el4.x86_64 I''ve been playing with ssh and it only worked with "service": I''ll double-check.> > /BellmanArnau --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---