On 9/28/16 3:54 PM, Ugo Bellavance wrote:
> Hi,
> 
> I am working with this module https://github.com/voxpupuli/puppet-nginx
> to get some nginx servers up.  Here is my hiera config for a vhost:
> 
> nginx::nginx_vhosts:
>   'website1.domain.com':
>     proxy: 'http://website1.internal'
> 
> I would like to have my logs in one directory per vhost.
> 
> Here is what I have for now:
> 
> nginx::http_access_log: "%{hiera('nginx::config::log_dir')}/access_log"
> 
> 
> In the template, it looks like that:
> 
> "${::nginx::config::log_dir}/${name_sanitized}.access.log ${format_log}",
> 
> Would there be a way to set it in hiera so that it is the equivalent of
> this:
> 
> "${::nginx::config::log_dir}/${name_sanitized}/access.log ${format_log}",
> 
> Of course, I would like to avoid having to edit the template.
> 
> Thanks,
> 

Hi Ugo,

nginx_vhosts has a parameter named access_log. You could use that as
follows.

nginx::nginx_vhosts:
  'website1.domain.com':
    proxy: 'http://website1.internal'
    access_log: '/whatever/access.log'

https://github.com/voxpupuli/puppet-nginx/blob/master/manifests/resource/vhost.pp#L145

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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/82aad790-59dd-f1b8-8cb3-c7c013fa983f%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to