-
Notifications
You must be signed in to change notification settings - Fork 114
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
configurable zookeeper environment vars … #39
configurable zookeeper environment vars … #39
Conversation
@@ -0,0 +1,5 @@ | |||
{% if zookeeper_env is defined %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zookeeper_env will always be defined unless you don't assign anything. Instead check for length, of course loop will not work but lets prevent from entering it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! (and better solution to just uncommenting the variable altogether in the defaults (aka making it 'undefined')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually adding the check only in the template (only avoiding 'entering the loop') doesn't bring much (except saving <1ms).
IMO the proper fix is to add the check in the task, avoid to write an empty zookeeper-env.sh (if it's not used). (With this change, one has to be aware that it will be more complicate to move from a file with settings to an emptied env file!)
- name: Configure zookeeper-env.sh
...
when: zookeeper_env is defined and zookeeper_env|length > 0
@ernestas-poskus ok for you (to only add that 'when' line ) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when: zookeeper_env is defined and zookeeper_env|length > 0
even better 👍
fixed above comment @ernestas-poskus plz notice however another oddity is that this addition does not apply to the 'old' debian (deb pkg) setup. IMO it would be nicer to also add it there. |
but maybe better merge this one first, and I open a separate PR for that change |
@lhoss maybe just extract this new logic into common.yml (leave conditionals inside of it) and include it in main.yml. In later PR if you want you can extract further common logic into common.yml |
OK then, will do your proposal (but naming the new include common-config.yml) |
committed review-fix |
neat ! thank you for contribution |
(useful p.eg to configure logging to file)
@ernestas-poskus this is the new feature that helps to fix the logging (to file) (ref: #34 (comment) )
Finally I added no settings in the defaults (though this would be useful, also for the purpose of a working example )
To enable for ex. file based logging, you would define following var: