Sorry for top-posting, but I found my mistake.  I didn't know we could not 
set 'require' more than once.  It now looks obvious but it wasn't when I 
was working on it.

Ugo


On Monday, November 24, 2014 12:38:33 PM UTC-5, Ugo Bellavance wrote:
>
> Hi,
>
> I've written my own puppet module for apache because I found that the 
> publicly-available ones had many dependencies or were too complex for me. 
>  I'm not a puppet expert and I'm using EPEL's puppet which is 2.7.25.
>
> Here is the relevant part of my code that is used to create the apache 
> .conf file for our environments.  Our environments follow this standard:
>
> for dev:  /var/www/dev/$user/$application/
>
> for other environments stages: /var/www/$envstage/$application/
>
> The logs are located in a directory called "logs" in the $application 
> folder.
>
> My current puppet codes does everything that is needed to create an 
> environment, but it doesn't manage the order, so it may happen that the 
> logs folder is created after the apache refresh and cause a problem.
>
> I have a few (less-related) questions regarding this:
>
>    - Does puppet manage the creation of the parent directories as of now?
>    - I've had unplanned outages (nothing critical, clients/users were 
>    warned on dev and staging environments) because the refresh was done 
> before 
>    the logs directory was created
>       - Should I implement file syntax checking for httpd .conf files? 
>        Should it be on file-level or should it be in the refresh parameter of 
> the 
>       service? (Something similar to restart => '/usr/sbin/apachectl -t 
>       && /etc/init.d/httpd graceful',
>    
>
> When I add a require => File directives, it fails with an error that looks 
> like that:
>
> Duplicate parameter 'require' for on 
> File[/etc/httpd/conf.d/blabla-integration1.conf] at 
> /etc/puppet/modules/apache/manifests/vhost.pp
>
> Here is the relevant part of my code:
>
>
>     $logdir = "$vhost_base/logs"
>
>   if $envstage  != 'dev' {
>     file { [ "$logdir", "/var/www/$envstage", "$vhost_base", ]:
>       ensure => 'directory',
>       owner  => 'deploy',
>       group  => 'deploy',
>       mode   => 0744,
>   }
> }
> # Generate the .conf file for the vhost
>     file {
>         "${vdir}/${name}.conf":
>         content => template($template),
>         owner   => 'root',
>         group   => 'root',
>         mode    => '0644',
>         require => "$logdir",
>         require => Package['httpd'],
>         notify  => Service['httpd'],
>     }
>
> What would be the best way to manage that?  Separate my file resources in 
> 3 separate directives?
>
> Thanks
>
> Ugo
>

-- 
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/be4870e2-f4d5-4f7e-a64b-1c9242800096%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to