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

Implement options as array of hashes so order is preserved #173

Merged
merged 1 commit into from
Apr 6, 2015

Conversation

antaflos
Copy link

@antaflos antaflos commented Apr 6, 2015

Fixes https://tickets.puppetlabs.com/browse/MODULES-1317. See also the
discussion in PR #171.

Frontend, backend and listen options are specified via the
haproxy::frontend::options, haproxy:backend::options and
haproxy::listen::options parameters. Until now this options
parameter was a hash, which means it had to be sorted before processing
it in the _options.erb template fragment (since Ruby 1.8.x has
non-deterministic hash key ordering).

This clashes with the fact that in HAProxy's configuration order matters.

With this change we allow the options parameter to be either a hash,
like before, or an array of hashes, where each hash represents a
frontend, backend or listen option and its value. This way the order in
which options will appear in the final configuration file can be
controlled entirely by the user.

This change is completely backwards compatible and contains updated spec
tests and documentation.

Fixes https://tickets.puppetlabs.com/browse/MODULES-1317. See also the
discussion in PR puppetlabs#171.

Frontend, backend and listen options are specified via the
`haproxy::frontend::options`, `haproxy:backend::options` and
`haproxy::listen::options` parameters. Until now this `options`
parameter was a hash, which means it had to be sorted before processing
it in the `_options.erb` template fragment (since Ruby 1.8.x has
non-deterministic hash key ordering).

This clashes with the fact that in HAProxy's configuration order matters.

With this change we allow the `options` parameter to be either a hash,
like before, or an array of hashes, where each hash represents a
frontend, backend or listen option and its value. This way the order in
which options will appear in the final configuration file can be
controlled entirely by the user.

This change is completely backwards compatible and contains updated spec
tests and documentation.
@antaflos
Copy link
Author

antaflos commented Apr 6, 2015

@jweisner this might interest you, please test if you get the chance.

hunner added a commit that referenced this pull request Apr 6, 2015
Implement `options` as array of hashes so order is preserved
@hunner hunner merged commit ea48e0b into puppetlabs:master Apr 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants