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

Change variable name to snake_case #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hhandoko
Copy link

@hhandoko hhandoko commented Nov 22, 2017

Summary

An error is thrown when running this role in Vagrant v2.0.0 and Ansible v2.4.1.0. The main reason is that an existing variable, oracle-xe-test is using kebab-case convention.

I've renamed the variable to oracle_xe_test (i.e. snake_case), and it works as expected now.

Full error message below:

TASK [ansible-oraclexe : file] *************************************************
fatal: [oraclexe]: FAILED! => {"failed": true, "msg": "The conditional check 'oracle-xe-test' failed. The error was: error while evaluating conditional (oracle-xe-test): Unable to look up a name or access an attribute in template string ({% if oracle-xe-test %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': unsupported operand type(s) for -: 'dict' and 'StrictUndefined'\n\nThe error appears to have been in '/vagrant/scripts/ansible/roles/ansible-oraclexe/tasks/oracle-xe-test.yml': line 3, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - file: path=/tmp/test state=directory owner=oracle group=dba\n    ^ here\n"}
        to retry, use: --limit @/vagrant/scripts/ansible/playbook.retry

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.

1 participant