Closed hostingnuggets closed 8 years ago
This is tricky... https://github.com/jfryman/puppet-nginx/pull/532 introduced the ordering, and it's to work around https://tickets.puppetlabs.com/browse/PUP-1755 where official Puppet policy is that
There will never be any guarantees about the order of elements in a hash from the Puppet Language perspective.
To work around this, ordering by hash key was added to this module, so there would be a consistent, defined order for parameters. However, it does create problems like the above.
We can have a PR that adds raw_append
to the empty.erb
template. It's a hacky workaround but should allow you to do what you need.
A wishlist item for this module is to extend puppetlabs-concat support (see https://github.com/jfryman/puppet-nginx/issues/538) which would allow completely custom code to be added to the config files without having to dance around hiera. That's a much bigger task though.
@3flex thanks for your analysis, I would really be looking forward to a raw_append
parameter where I could pass many nginx parameters in sequential order without any re-ordering. I think this is a reasonable workaround which could be implemented quite fast.
vhost and location now both have $raw_append, so I think this can be closed.
I have some configuration parameters under
location_custom_cfg
which depend on a specific order to work correctly. Unfortunately the module re-orders my parameters alphabetically. Is it possible to avoid this re-ordering and just take the parameters in sequential order as I defined them? or do you see any other alternatives? My example config (taken from hiera) for this specific location is listed below.