Hi all, I''ve come quite far with my puppet setup, but a few times I got this problem: I want to execute a few things if a file isn''t present on the puppet client. For example: I want puppet to check if the mod_passenger apache module exists. If not: installl passenger from gem. Execute the installer, copy the config file and enable the module with a2enmod. What would be the right/appropriate way to do this? At this moment I don''t have a clue. Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Scott Smith
2008-Jul-14 20:50 UTC
[Puppet Users] Re: Execute some steps if a file isn''t present
LeonB wrote:> Hi all, > > I''ve come quite far with my puppet setup, but a few times I got this > problem: > > I want to execute a few things if a file isn''t present on the puppet > client. > > For example: I want puppet to check if the mod_passenger apache module > exists. If not: installl passenger from gem. Execute the installer, > copy the config file and enable the module with a2enmod. > > What would be the right/appropriate way to do this? At this moment I > don''t have a clue.dunno about a2enmod since i don''t run apache on debian, but: exec { "whatever": command => "/usr/bin/fred barney", unless => "/bin/test -f /path/to/touchfile", ... } that will execute "/usr/bin/fred barney" unless /path/to/touchfile exists and is a file --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter Meier
2008-Jul-14 21:02 UTC
[Puppet Users] Re: Execute some steps if a file isn''t present
Hi>> I''ve come quite far with my puppet setup, but a few times I got this >> problem: >> >> I want to execute a few things if a file isn''t present on the puppet >> client. >> >> For example: I want puppet to check if the mod_passenger apache module >> exists. If not: installl passenger from gem. Execute the installer, >> copy the config file and enable the module with a2enmod. >> >> What would be the right/appropriate way to do this? At this moment I >> don''t have a clue. > > dunno about a2enmod since i don''t run apache on debian, but: > > exec { "whatever": > command => "/usr/bin/fred barney", > unless => "/bin/test -f /path/to/touchfile", > ... > } > > that will execute "/usr/bin/fred barney" unless /path/to/touchfile > exists and is a filehow about the creates param of the exec type? however often if you have to do something hackish like this, you often have the wrong approach to solve your problem. 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 -~----------~----~----~----~------~----~------~--~---
LeonB
2008-Jul-17 12:23 UTC
[Puppet Users] Re: Execute some steps if a file isn''t present
Thanks Peter, I already thought I was walking the wrong path. But I didn''t know of any other :) Wat does the "creates" param do exactly? Thanks! On Jul 14, 11:02 pm, Peter Meier <peter.me...@immerda.ch> wrote:> Hi > > > > >> I''ve come quite far with my puppet setup, but a few times I got this > >> problem: > > >> I want to execute a few things if a file isn''t present on the puppet > >> client. > > >> For example: I want puppet to check if the mod_passenger apache module > >> exists. If not: installl passenger from gem. Execute the installer, > >> copy the config file and enable the module with a2enmod. > > >> What would be the right/appropriate way to do this? At this moment I > >> don''t have a clue. > > > dunno about a2enmod since i don''t run apache on debian, but: > > > exec { "whatever": > > command => "/usr/bin/fred barney", > > unless => "/bin/test -f /path/to/touchfile", > > ... > > } > > > that will execute "/usr/bin/fred barney" unless /path/to/touchfile > > exists and is a file > > how about the creates param of the exec type? > > however often if you have to do something hackish like this, you often > have the wrong approach to solve your problem. > > 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 -~----------~----~----~----~------~----~------~--~---
LeonB
2008-Jul-17 12:25 UTC
[Puppet Users] Re: Execute some steps if a file isn''t present
Looked it up: A file that this command creates. If this parameter is provided, then the command will only be run if the specified file does not exist. I think that would be very helpful. Thanks again! On Jul 14, 11:02 pm, Peter Meier <peter.me...@immerda.ch> wrote:> Hi > > > > >> I''ve come quite far with my puppet setup, but a few times I got this > >> problem: > > >> I want to execute a few things if a file isn''t present on the puppet > >> client. > > >> For example: I want puppet to check if the mod_passenger apache module > >> exists. If not: installl passenger from gem. Execute the installer, > >> copy the config file and enable the module with a2enmod. > > >> What would be the right/appropriate way to do this? At this moment I > >> don''t have a clue. > > > dunno about a2enmod since i don''t run apache on debian, but: > > > exec { "whatever": > > command => "/usr/bin/fred barney", > > unless => "/bin/test -f /path/to/touchfile", > > ... > > } > > > that will execute "/usr/bin/fred barney" unless /path/to/touchfile > > exists and is a file > > how about the creates param of the exec type? > > however often if you have to do something hackish like this, you often > have the wrong approach to solve your problem. > > 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 -~----------~----~----~----~------~----~------~--~---