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

Use an array as listen attribute instead of a hash #409

Merged
merged 1 commit into from
Mar 1, 2016

Conversation

jharbott
Copy link

This PR amends the logic introduced in #378 to use an array as attribute instead of a hash, as this will simplify using this cookbook in other recipes.

E.g., if a recipe wants httpd to listen on addr:port, it is much easier to
just set

node.set['apache2']['listen'] += ['addr:port']

instead of first having to check whether the listen hash does have the
key addr already and then either add it or update the port list.

This PR amends the logic introduced in
sous-chefs#378 to use an array
as attribute instead of a hash, as this will simplify using this
cookbook in other recipes.

E.g., if a recipe wants httpd to listen on `addr:port`, it is much easier to
just set

    node.set['apache2']['listen'] += ['addr:port']

instead of first having to check whether the listen hash does have the
key `addr` already and then either add it or update the port list.
@jklare
Copy link

jklare commented Mar 1, 2016

Any chance we could merge this? The current implementation in master makes it nearly impossible to override the default setting for *:80 and *:443 without using drop on the Mash itself. Additionally the implementation as a Hash leads to chef handling this as a Mash and auto merging all precedences -> meaning you can only override *:80 by setting some other value for the key * (which will always lead to apache listening on * and some port) or dropping it as mentioned above (which is quite ugly).

@drpebcak
Copy link
Contributor

drpebcak commented Mar 1, 2016

Yeah, I kind of like this.

drpebcak added a commit that referenced this pull request Mar 1, 2016
Use an array as listen attribute instead of a hash
@drpebcak drpebcak merged commit 1884c91 into sous-chefs:master Mar 1, 2016
legal90 added a commit to legal90/chef-stash that referenced this pull request Apr 19, 2016
In cookbook apache2 v3.2.0 the attribute was changed and renamed:
`node.default['apache']['listen_ports']` -> `node.default['apache']['listen']`

sous-chefs/apache2#409
@lock
Copy link

lock bot commented Jul 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants