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
Ansible runner & 'env/' directory #493
Comments
If you are using it as a python interface and pass ansible-runner/ansible_runner/utils.py Lines 199 to 201 in 743793b
Speaking anecdotally, it does not clean up these setting files at the end of the run, and I agree it should. I have gotten an error when I provided non-empty settings but the file existed. Sounds like you got a different result, so I would like to know more specifically what your code looks like when it uses the ansible-runner python interface. |
I encountered a similar result and did not expect the parameters to be persisted especially as these are passed at runtime. Like a standalone ansible-playbook, I was expecting the process to just receive the values, run the playbook and not persist any values. In my case, I ran it with extravars, which created a env/extravars and stored the values there. I ran it a second time without passing extravars and expected an error from Ansible since there was no value passed during the run, but it was successful as it used the value from the previous run. That wasnt the behaviour with ansible-playbook. |
I agree, I'd like Runner to be able to clean these up. |
Behavior described in duplicate issue:
This is what I have seen as well, on the 2nd run or any other subsequent runs. Several tests are now working around this behavior. |
Hi, I also stumbled across this issue while passing envvars parameters to ansible-runner as a python module interface. Is there any update on this? I would expect the runner should always respect whatever envvars/extravars are/if passed from the module call even if the Edit: With regards to envvars I think the order of updating Thanks! |
This PR should fix the issue about The issue about precedence between dict argment and file is here : ansible-runner/ansible_runner/config/_base.py Line 217 in da332d6
and here : ansible-runner/ansible_runner/config/_base.py Line 222 in da332d6
You should swap this two block of code. |
I ran into this issue recently, we use a service to deploy stuff through ansible, and changing data that we pass to Ansible python interface, the env/extravars is merged. But even merging is not OK, because we use the same project with different inventory and env variable, leading to deployment having too much extravars from old execution, not only bad values, too much also. |
An option to not write files in the Perhaps that can be said to resolve this issue? |
@AlanCoding yep it will do for me :). It just felt weird that is was taking up both config (extravars in folder and through python interface), but in my use case I can never it and it will work perfectly. Thanks :). |
Hi, i'm trying to understand how env/ directory works in ansible runner...
First all, i'm using runner as a python module. So i run ansible_runner.interface.run_async() with parameters :
extravars: dictionary parameter
settings: dictionary parameter
envvars: dictionary parameter
When i execute my script for first time it creates the env/ path in my local directory, where each file contain all parameters data.
Altrought i execute again, those files are still existing and not overwriting.
If i run ansible runner script with debug -vvvv, i saw:
extra_vars: ('@/var/ansible-runner/project/XXX/env/extravars' , '{ "my_extra_vars" : nnnnnn }' )
where my dict {"my_extra_vars": nnnn} is a representation.
Which parameters ansible runner interface must to use?
What are the usefulness of env/ directory?
The text was updated successfully, but these errors were encountered: