Hi I try to do some things on the system, only if a directory exists. The only way I see right now to achieve this is to create a custom fact which returns true and fals. Is there a better solution? BR Rene --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Trevor Vaughan
2009-Jun-08 13:19 UTC
[Puppet Users] Re: only deploy files, when directory exists
That''s probably the cleanest way to do it. A more hacky version would be to use an exec: exec { "isithere": command => "echo true", onlyif => "test -d /some/path" } (I won''t back the exact syntax there since I just pulled it out of thin air). Trevor On Mon, Jun 8, 2009 at 09:08, Rene<rene.zbinden@gmail.com> wrote:> > Hi > > I try to do some things on the system, only if a directory exists. The > only way I see right now to achieve this is to create a custom fact > which returns true and fals. Is there a better solution? > > BR > Rene > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Schmitt
2009-Jun-08 13:20 UTC
[Puppet Users] Re: only deploy files, when directory exists
Rene schrieb:> Hi > > I try to do some things on the system, only if a directory exists. The > only way I see right now to achieve this is to create a custom fact > which returns true and fals. Is there a better solution?Better solutions mostly revolve around getting the directory under control too. That really depends on the purpose and genesis of said directory. Another hack would be to create an Exec that fails when the directory doesn''t exist and depend on that: | exec { "[ -d ${the_directory} ]": before => Class[''stuff''] } | | class stuff { ... } Of course, that''ll clutter your output with many failures due to failed dependencies. Regards, DavidS -- dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at Klosterneuburg UID: ATU64260999 FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Good idea, I try that.... Thanks a lot On Jun 8, 3:19 pm, Trevor Vaughan <peiriann...@gmail.com> wrote:> That''s probably the cleanest way to do it. > > A more hacky version would be to use an exec: > > exec { "isithere": > command => "echo true", > onlyif => "test -d /some/path" > > } > > (I won''t back the exact syntax there since I just pulled it out of thin air). > > Trevor > > On Mon, Jun 8, 2009 at 09:08, Rene<rene.zbin...@gmail.com> wrote: > > > Hi > > > I try to do some things on the system, only if a directory exists. The > > only way I see right now to achieve this is to create a custom fact > > which returns true and fals. Is there a better solution? > > > BR > > Rene--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yeah I know, that would be the best solution, but this directory is a san device and is not there after kickstart and I want to be sure that puppet runs without errors even the device is not there. Thanks a lot for you help BR Rene On Jun 8, 3:20 pm, David Schmitt <da...@dasz.at> wrote:> Rene schrieb: > > > Hi > > > I try to do some things on the system, only if a directory exists. The > > only way I see right now to achieve this is to create a custom fact > > which returns true and fals. Is there a better solution? > > Better solutions mostly revolve around getting the directory under > control too. That really depends on the purpose and genesis of said > directory. > > Another hack would be to create an Exec that fails when the directory > doesn''t exist and depend on that: > > | exec { "[ -d ${the_directory} ]": before => Class[''stuff''] } > | > | class stuff { ... } > > Of course, that''ll clutter your output with many failures due to failed > dependencies. > > Regards, DavidS > > -- > dasz.at OG Tel: +43 (0)664 2602670 Web:http://dasz.at > Klosterneuburg UID: ATU64260999 > > FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Schmitt
2009-Jun-08 13:34 UTC
[Puppet Users] Re: only deploy files, when directory exists
Rene schrieb:> Yeah I know, that would be the best solution, but this directory is a > san device and is not there after kickstart and I want to be sure that > puppet runs without errors even the device is not there.If you are managing configuration of the device with puppet too, you might want to look into environments and/or tags and run the initial bootstrapping with puppetd --environment=bootstrap puppetd --tags=bootstrap or by dropping an equivalent configuration into puppet.conf on kickstart and only later replacing it (e.g. through puppet itself). Regards, DavidS -- dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at Klosterneuburg UID: ATU64260999 FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thats a good point. Right now I want to migrate our satellite configuration to puppet. If that works well, I will try to move even the device configuration to puppet. Thanks for your help. BR. Rene On Jun 8, 3:34 pm, David Schmitt <da...@dasz.at> wrote:> Rene schrieb: > > > Yeah I know, that would be the best solution, but this directory is a > > san device and is not there after kickstart and I want to be sure that > > puppet runs without errors even the device is not there. > > If you are managing configuration of the device with puppet too, you > might want to look into environments and/or tags and run the initial > bootstrapping with > > puppetd --environment=bootstrap > puppetd --tags=bootstrap > > or by dropping an equivalent configuration into puppet.conf on kickstart > and only later replacing it (e.g. through puppet itself). > > Regards, DavidS > -- > dasz.at OG Tel: +43 (0)664 2602670 Web:http://dasz.at > Klosterneuburg UID: ATU64260999 > > FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---