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

Undefined variable ansible_env #49

Open
kikearciniegas opened this issue Nov 23, 2021 · 1 comment
Open

Undefined variable ansible_env #49

kikearciniegas opened this issue Nov 23, 2021 · 1 comment

Comments

@kikearciniegas
Copy link

Running/testing with default options from the README.md, the playbook fails with the following message:

fatal: [hostname-redacted]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}: 'ansible_env' is undefined\n\nThe error appears to be in '/Users/username-redacted/.ansible/roles/gantsign.antigen/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\n- name: create download directory\n ^ here\n"}

Where and how should this variable be defined?

Running antigen_version: '2.0.2' | ansible [core 2.11.6] | python version = 3.10.0

Thanks

@freemanjp
Copy link
Member

@kikearciniegas thanks for reporting this issue.

This role uses ansible_env.HOME to determine where to download Antigen to.

ansible_env depends on fact-gathering being run on the remote host.

Your playbook probably has:

gather_facts: no

Changing it to yes should fix the issue.

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

No branches or pull requests

2 participants