-
-
Notifications
You must be signed in to change notification settings - Fork 883
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
Sort sub hash keys to have a stable ordering #532
Conversation
@jfryman this is a very annoying bug because nginx service is refreshing on every puppet run :\ |
Which version of Ruby are you using? This is probably because on Ruby 1.8 Hashes aren't ordered. The problem with sorting them all by key/value is that users might want to have directives set in a certain order, especially with custom added code added with these directives. Sorting them might break their configurations as some nginx directives are order dependent. @jfryman might have to make a call whether Ruby 1.8 compatibility (which isn't guaranteed with this module) or sorting directives when a user might not expect that behavior is more important. @mbornoz you can also use raw_append/raw_prepend. This is an array of lines to add to the config and will maintain sort order on Ruby 1.8. |
The problem occurs on a Red Hat 7 with ruby 2.0.0p353 and something like this:
To temporary avoid this problem I will use raw_append, thanks for the tips. |
👍 We have the same issue. Was gonna do a pull request. Lucky I checked first. |
Awesome. Yeah, this certainly is a bit of a pain... let's talk through it. I don't really care about 1.8 support, to be frank. If it happens as a bi-product, then awesome! It is not something I think we should spend tons of effort on though. Puppet doesn't support it anymore, so I think it's unrealistic to try and support it as well. However, since this is affecting 2.x, something else is going on. Let's dig....
Please drop dem comments! |
Sounds good. I believe the latest from Puppet on this issue can be found at https://tickets.puppetlabs.com/browse/PUP-1755, TL;DR is that the module/template should handle hash sorting regardless of Ruby version, and we have As an aside I think we should move away from these methods to insert custom code into the manifests, and promote puppetlabs-concat as the best way to do this since it allows for total customization of any code that will be added to the vhost/location. But that's a discussion/PR for another day... |
Sort sub hash keys to have a stable ordering
The hash sorting was started in voxpupuli#532 and this fixes it for fastcgi as well.
Sort sub hash keys to have a stable ordering
The hash sorting was started in voxpupuli#532 and this fixes it for fastcgi as well.
No description provided.