Separate the client base directory resource from the application directory resource.
When declaring each application directory, add a “require” parameter with a value of the client base directory. "Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us." Bill Waterson (Calvin & Hobbes) > On Sep 7, 2018, at 5:05 PM, Ugo Bellavance <[email protected]> wrote: > > Hi, > > I have made a module, a long time ago, that allows me to create directories > and httpd config files. > > My pattern is /var/www/dev/$devuser/$clientname/$appname/ > > It worked perfectly until I ended up having more than one $appname for the > same $clientname. Here's the error message I get: > > Error: Could not retrieve catalog from remote server: Error 400 on SERVER: > Duplicate declaration: File[/var/www/dev/user1/client1] is already declared > in file /etc/puppet/modules/atqapache/manifests/vhost.pp:146; cannot > redeclare at /etc/puppet/modules/myapache/manifests/vhost.pp:146 on node > server1.example.com > > The directive responsible for the creation of the folder is this one: > > file { [ "$client_base", ]: > ensure => 'directory', > owner => "$owner", > group => "$group", > mode => 0744, > } > > This line defines the variable: > > $vhost_base = > "${atqapache::params::home}/$envstage/$client-${application}" > > Here's my declaration: > > atqapache::vhost { 'client1-user1app1dev1' : > client => 'client1', > envstage => 'dev', > application => 'app1', > devuser => 'user1', > } > > atqapache::vhost { 'client1-user1app2dev11' : > client => 'clien1', > envstage => 'dev', > application => 'app2', > devuser => 'user1', > } > > Does anyone know how I could modify my code so that I can have more than one > app per client? > > Thanks, > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/6a2b9af3-0fb9-4c38-b0a1-7245b2762d38%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4F07EDE9-211A-4D02-855D-4FDE3E731732%40icloud.com. For more options, visit https://groups.google.com/d/optout.
