Tim Harper
2008-Nov-04 20:38 UTC
[Puppet Users] way to create a parent directory if it doesn''t exist?
Is there any way to create a parent directory for a file if it doesn''t exist? Trying this: file { "/etc/crontabs/$title.crontab": source => "puppet:///crontabs/$title.crontab", ensure => present, owner => $user, recurse => true } but it''s failing because /etc/crontabs doesn''t exist. Thanks :) Tim --~--~---------~--~----~------------~-------~--~----~ 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-Nov-04 20:55 UTC
[Puppet Users] Re: way to create a parent directory if it doesn''t exist?
Hi> Is there any way to create a parent directory for a file if it doesn''t > exist? > > Trying this: > > file { "/etc/crontabs/$title.crontab": > source => "puppet:///crontabs/$title.crontab", > ensure => present, > owner => $user, > recurse => true > } > > but it''s failing because /etc/crontabs doesn''t exist.you have to manage the parent directory as well, as it is something you like to manage with puppet! so: file{''/etc/crontabs'': ensure => directory, } puppet will automagically precede this file definition the one above. 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 -~----------~----~----~----~------~----~------~--~---
Tim Harper
2008-Nov-04 21:28 UTC
[Puppet Users] Re: way to create a parent directory if it doesn''t exist?
On Nov 4, 2008, at 1:55 PM, Peter Meier wrote:> > Hi > >> Is there any way to create a parent directory for a file if it >> doesn''t >> exist? >> >> Trying this: >> >> file { "/etc/crontabs/$title.crontab": >> source => "puppet:///crontabs/$title.crontab", >> ensure => present, >> owner => $user, >> recurse => true >> } >> >> but it''s failing because /etc/crontabs doesn''t exist. > > you have to manage the parent directory as well, as it is something > you > like to manage with puppet! > > so: > > file{''/etc/crontabs'': > ensure => directory, > } > > puppet will automagically precede this file definition the one above. > > greets pete.Excellent! Thanks. I went to update the wiki page (the intruding parenthetical comment distracted me from seeing the 3rd and 4th value for file''s ensure). After my updated, I noticed that page is auto-generated. Patch to follow :) Tim --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---