-
Notifications
You must be signed in to change notification settings - Fork 30
Prefix role variable names #3
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
Conversation
ringods
left a comment
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.
After renaming all my vars, I got this error at execution:
fatal: [10.130.20.211]: FAILED! => {"msg": "The conditional check 'docker_pull' failed. The error was: error while evaluating conditional (docker_pull): 'docker_pull' is undefined\n\nThe error appears to have been in '/Users/ringods/.ansible/roles/ansible-docker-systemd-service/tasks/install.yml': line 12, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# use `command` instead of `docker_image` so we don't have to install docker-py\n- name: Pull image {{ container_image }}\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - \"{{ foo }}\"\n"}
| * `link` (default: _[]_) - List of `--link` arguments | ||
| * `labels` (default: _[]_) - List of `-l` arguments | ||
| * `docker_pull` (default: _yes_) - whether the docker image should be pulled | ||
| * `container_env` - key/value pairs of ENV vars that need to be present |
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.
In the template env.j2, you don't check whether container_env is set. I noticed this because I forgot to rename env to container_env.
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.
Thanks, fixed
|
Updated README to reflect new var names and new syntax; I think the usage example was not updated since 1.0 |
|
@mhutter have you also seen the error I reported? See above. |
The current implementation uses some quite generic variable names, such as `state`. As role defaults have the lowest priority when it comes to variable precedence, they are easily overwritten. This is a breaking change! Fixes #2
|
@ringods I have, I even fixed it but did not commit it before pushing 🤦♂️ Fixed now, please check again |
The current implementation uses some quite generic variable names, such
as
state. As role defaults have the lowest priority when it comes tovariable precedence, they are easily overwritten.
This is a breaking change!
Fixes #2