Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not re-order parameters in location_custom_cfg alphabetically #828

Closed
hostingnuggets opened this issue Jul 4, 2016 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@hostingnuggets
Copy link

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.

nginx::nginx_locations:
 'php_files':
    priority: 503
    location: '~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/)'
    vhost: 'myvhost.com'
    ssl: true
    ssl_only: true
    location_custom_cfg:
      include: 'fastcgi_params'
      fastcgi_split_path_info: '^(.+\.php)(/.+)$'
      fastcgi_param:
        SCRIPT_FILENAME: '$document_root$fastcgi_script_name'
        PATH_INFO: '$fastcgi_path_info'
        HTTPS: 'on'
        modHeadersAvailable: 'true'
        front_controller_active: 'true'
      fastcgi_pass: 'phpfpm'
      fastcgi_intercept_errors: 'on'
      fastcgi_request_buffering: 'off'
@3flex
Copy link
Contributor

3flex commented Jul 4, 2016

This is tricky... #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 #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 3flex added the enhancement New feature or request label Jul 4, 2016
@hostingnuggets
Copy link
Author

@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.

@wyardley
Copy link
Collaborator

wyardley commented Oct 7, 2016

vhost and location now both have $raw_append, so I think this can be closed.

@wyardley wyardley closed this as completed Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants