Looks to me like the template upstream_header.erb is not built to handle this.
I know a template that can handle this sort of input --
Check out 
https://github.com/puppetlabs/puppetlabs-mysql/blob/master/templates/my.cnf.erb
line 9 specifically looks for true or '' in the value of a key/value pair and 
then just outputs the key.

The logic you need is in there, but it will take a bit of tinkering, I think.

“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 Feb 05, 2015, at 05:24 AM, Danny Roberts 
<dannyroberts.perso...@googlemail.com> wrote:

I am trying to configure NGINX entirely within Hiera. For the most part this is 
very easy as the module directly supports setting things up in Hiera.

Where I am having an issue though is when creating an upstream in Hiera I am 
wanting to pass the 'ip_hash' parameter to it. The in source docs show an 
example of doing this from in a manifest but not Hiera. So I came up with this 
Hiera code for the upstream:

nginx :: nginx_upstreams :
  'mycluster' :
    ensure : 'present'
    members : [ '192.168.0.1:80' , '192.168.0.2:80' ]
    upstream_cfg_prepend :
      ip_hash : ''
Though presumably because the value of that hash key/value pair is empty the ip_hash variable does not get added to the resulting config file on the server, you just get a blank line inserted. I've done some searching and cannot find a way to make this work in Hiera so it may simply not be possible, but does anyone know a way around this?


--
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52ff4e6a-e99a-4697-81e9-6d0f0c1ae4cb%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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/50d5b770-4c68-409e-a7c7-d813caafb566%40me.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to