On 9/29/16 9:52 AM, Ugo Bellavance wrote:
>
>
> On Wednesday, September 28, 2016 at 8:07:26 PM UTC-4, Ugo Bellavance wrote:
>
>
>
> On Wednesday, September 28, 2016 at 4:35:50 PM UTC-4, Garrett
> Honeycutt wrote:
>
> On 9/28/16 3:54 PM, Ugo Bellavance wrote:
> > Hi,
> >
> > I am working with this module
>
https://github.com/voxpupuli/puppet-nginx
> <
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 <
http://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 <
http://website1.domain.com>':
Hi Ugo,
Suggest creating a profile class that includes nginx as well as ensuring
that all those directories exist first.
An alternative would be to send a pull request to the nginx module that
runs `mkdir -p` for you when specifying a custom access_log.