-
Notifications
You must be signed in to change notification settings - Fork 78
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
update_fact will prevent variable replacement under certain conditions #135
Comments
@ipc-zpg Thanks for this, it took a few minutes to remember the subtleties of vars vs. facts in this case. This is not entirely unexpected, at the time the
The workaround for this is to resolve all the references in
In your example, ansible passes the unresolved var to the task, so that is what is being returned. Let me know if this helps -Brad |
@ipc-zpg Just checking in to see if ^^^ helped explain the behaviour |
So I have another example. It seems that if the path includes a variable representing a number, it also will not work. This works fine:
This works fine:
This fails:
|
I'm hitting this bug, any workaround? |
I also have the issue of not being able to use a variable that is set to equal an index number, but in my case, the error seems to indicate that update_fact interprets all variables as strings. This works
These both fail with the same error
The error
|
SUMMARY
under certain conditions, update_facts will prevent variables being substituted within variables it manipulates
ISSUE TYPE
COMPONENT NAME
ansible.utils.update_fact
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Tested on OSX and Linux
STEPS TO REPRODUCE
EXPECTED RESULTS
the second debug should print 'moo.moo', in the same way the first debug does.
ACTUAL RESULTS
I get
{{ env_name }}.moo
as the output.The text was updated successfully, but these errors were encountered: