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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to