Scenario ansible-playbook is called with passed in extra var:
-e my_var=init_value
Then in a role code the value is supposed to change via set_fact call (variable other_var value is "new_value"):
set_fact: my_var: {{ other_var }}
This results in a nice output supposedly confirming alteration:
{"ansible facts": {"my_var": "new_value"}}
However echoing the variable after changing it shows the old value:
echo {{ my_var }}
-> "echo init_value"
To add to that, when I set two variables in the above example:
set_fact: my_var: {{ other_var }}
set_fact: new_var: {{ other_var }}
The new_var is set properly.
Is the variable in some way immutable? How to use the set_fact to update the variable's value?