Skip to content

Conversation

@mhutter
Copy link
Owner

@mhutter mhutter commented Jul 12, 2018

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

Copy link

@ringods ringods left a 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
Copy link

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

@mhutter
Copy link
Owner Author

mhutter commented Jul 13, 2018

Updated README to reflect new var names and new syntax; I think the usage example was not updated since 1.0

@ringods
Copy link

ringods commented Jul 13, 2018

@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
@mhutter
Copy link
Owner Author

mhutter commented Jul 13, 2018

@ringods I have, I even fixed it but did not commit it before pushing 🤦‍♂️

Fixed now, please check again

@mhutter mhutter merged commit 1e4049b into master Jul 18, 2018
@mhutter mhutter deleted the renamevars branch July 18, 2018 19:48
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.

3 participants