I’m using action plugins to collect data from an internal API. We’ve been setting the “ansible_facts” key of the results dictionary to return values. Most of the time, this seems to work as if we had called set_fact. But if we use set_fact on the same variable, ansible_facts doesn’t overwrite the value. Is this expected behavior?
https://pastebin.com/553q7PNH – playbook example
https://pastebin.com/aeAWyZhp – set_contact_id.py action_plugin
https://pastebin.com/zrh2MLKZ - ansible results
From the results, you can see that the contact_id is initially unset, so the display is 0.
Then the action_plugin uses ansible_facts to set it to 15731, which is displayed.
Then I call set_fact, which changes the value to 22124.
Finally, I try to update the value by calling the action_plugin again. This time, I see ansible_facts has the contact_id value set to 11131, but when I display it, I still see 22124. The ansible_facts from the action plugin did not overwrite the value. Is this expected behavior, or am I doing something wrong?
Thanks.
–John