Hi The below is from a colleague who is trying to get puppet to create some config dir''s and then within those dir''s put some files. He expereinces issues where sometimes this works but mostly it does not. Is this the correct way to be trying to achieve this? thanks -------- file { "/var/app/$serviceName/$env.env": ensure => ''directory'' } file { "/var/app/$serviceName/$env.env/conf": ensure => ''directory'' } file { "/var/app/$serviceName/$env.env/etc": ensure => ''directory'' } file { "/var/app/$serviceName/current.env": ensure => "/var/ app/$serviceName/$env.env" } package { "$serviceName": ensure => latest } file { "/var/app/$serviceName/current.env/conf/lus- discovery.properties": content => template("$serviceName/lus- discovery.properties"), mode => 644, owner => $uid, group => $gid, replace => true, } file { "/var/app/$serviceName/current.env/etc/ component.properties": source => "puppet:///$serviceName/ component.properties", mode => 644, owner => $uid, group => $gid, replace => true, } file { "/var/app/$serviceName/current.env/etc/tomcat.sysprops": content => template("$serviceName/tomcat.sysprops"), mode => 644, owner => $uid, group => $gid, replace => true, } -------- when directories (links) do not exist it may or may not deploy the files (usually fails on the second one). dirs are always created on the first run, so if it fails and i re-run puppet, all files would be deployed. --~--~---------~--~----~------------~-------~--~----~ 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 Brown wrote:> Hi > > The below is from a colleague who is trying to get puppet to create some > config dir''s and then within those dir''s put some files. > He expereinces issues where sometimes this works but mostly it does not. > Is this the correct way to be trying to achieve this? > > thanks > > -------- > file { "/var/app/$serviceName/$env.env": ensure => ''directory'' } > file { "/var/app/$serviceName/$env.env/conf": ensure => > ''directory'' } > file { "/var/app/$serviceName/$env.env/etc": ensure => > ''directory'' } > file { "/var/app/$serviceName/current.env": ensure => "/var/ > app/$serviceName/$env.env" } > > package { "$serviceName": ensure => latest } > > file { "/var/app/$serviceName/current.env/conf/lus- > discovery.properties": > content => template("$serviceName/lus- > discovery.properties"), > mode => 644, owner => $uid, group => $gid, > replace => true, > } > > file { "/var/app/$serviceName/current.env/etc/ > component.properties": > source => "puppet:///$serviceName/ component.properties", > mode => 644, owner => $uid, group => $gid, > replace => true, > } > > file { "/var/app/$serviceName/current.env/etc/tomcat.sysprops": > content => template("$serviceName/tomcat.sysprops"), > mode => 644, owner => $uid, group => $gid, > replace => true, > } > -------- > > when directories (links) do not exist it may or may not deploy the files > (usually fails on the second one). > > dirs are always created on the first run, so if it fails and i re-run > puppet, all files would be deployed.I don''t see anything obviously responsible for creating /var/app/$serviceName there. Assuming that the package installation creates it, you need to use before/requires statements to tell puppet to always install the package before attempting to create the various config files in locations that otherwise wouldn''t exist. -- Frank Sweetser fs at wpi.edu | For every problem, there is a solution that WPI Senior Network Engineer | is simple, elegant, and wrong. - HL Mencken GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I don''t see anything obviously responsible for creating /var/app/$serviceName > there. Assuming that the package installation creates it, you need to use > before/requires statements to tell puppet to always install the package before > attempting to create the various config files in locations that otherwise > wouldn''t exist. >thanks for the reply - i can confirm that /var/app/$serviceName is created by a package but this package is installed as puppet is not handling this at the moment. if you run puppet once it fails as it tries to create files within the directory that is mentioned below within the symlink. When puppet once is run again it succeeds as the symlink has been created so this seems to be an ordering issue. file { "/var/app/$serviceName/$env.env": ensure => ''directory'' } file { "/var/app/$serviceName/$env.env/conf": ensure => ''directory'' } file { "/var/app/$serviceName/$env.env/etc": ensure => ''directory'' } file { "/var/app/$serviceName/current.env": ensure => "/var/ app/$serviceName/$env.env" } even though in the configuration files are being copied into the symlinked directory after the symlink creation in practice the first thing puppet seems to try to do before anything else is put some files into current.env which of course fails as thats not created yet. Reading that back it sounds confused but is there anyway in puppet to say make sure this step is done before doing this other step as it seems the sequence is getting messed up. thanks for any help as i am not actually the one doing this but i am the one on the mailing list hence my ''problem by proxy'' --~--~---------~--~----~------------~-------~--~----~ 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 Brown wrote:> even though in the configuration files are being copied into the > symlinked directory after the symlink creation in practice the first > thing puppet seems to try to do before anything else is put some files > into current.env which of course fails as thats not created yet. Reading > that back it sounds confused but is there anyway in puppet to say make > sure this step is done before doing this other step as it seems the > sequence is getting messed up.Yep - the requires/before statements I already mentioned. Read through the language tutorial page on the puppet website, it''s got complete docs on what you''re looking for. -- Frank Sweetser fs at wpi.edu | For every problem, there is a solution that WPI Senior Network Engineer | is simple, elegant, and wrong. - HL Mencken GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > Yep - the requires/before statements I already mentioned. Read through the > language tutorial page on the puppet website, it''s got complete docs on what > you''re looking for. >thanks i will pass this on --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---