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

Add stream config when one of the vars is defined #169

Merged
merged 1 commit into from
Mar 19, 2017

Conversation

pieterlexis
Copy link
Contributor

Before, nginx_mainline_repo was used to identify a modern enough nginx.
Unfortunately, distros are catching up (e.g. Debian Stretch) and support
the streams module.

If nginx_stream_params or nginx_stream_configs are not empty, a stream
block is included in nginx.conf.

Closes #160

Before, nginx_mainline_repo was used to identify a modern enough nginx.
Unfortunately, distros are catching up (e.g. Debian Stretch) and support
the streams module.

If nginx_stream_params or nginx_stream_configs are not empty, a `stream`
block is included in `nginx.conf`.

Closes jdauphant#160
@jdauphant
Copy link
Owner

@pieterlexis Does it work with the default values ? (empty list and empty map)

nginx_stream_params: []

nginx_stream_configs: {}

@pieterlexis
Copy link
Contributor Author

pieterlexis commented Mar 17, 2017

As far as I know, empty lists and dicts evaluate to False:

Python 2.7.13 (default, Dec 21 2016, 07:16:46) 
[GCC 6.2.1 20160830] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> bool([])
False
>>> bool({})
False
>>> bool({} or [])
False
>>> bool({} or ['aaa'])
True
>>> bool({'aaa':'bbb'} or [])
True

I'll test this on a machine without streams after the weekend :)

@jdauphant
Copy link
Owner

@pieterlexis I just check, it's evaluate to false with ansible

@jdauphant jdauphant merged commit 0f81fc8 into jdauphant:master Mar 19, 2017
@jdauphant
Copy link
Owner

Thanks for you help :)

@pieterlexis pieterlexis deleted the streams branch March 20, 2017 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants