-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Issue with the success/succeeded filter #25027
Comments
success is currently defined as 'not failed' |
@jainnikhil30 adding |
Possible MisunderstandingHi! Thanks very much for your submission to Ansible. It sincerely means a lot to us. We believe the ticket you have filed is being somewhat misunderstood, as one thing works a little differently than stated. The filter is working as designed, In the future, this might be a topic more well suited for the user list, which you can also post here if you'd like some more help with the above. Thank you once again for this and your interest in Ansible! |
The "success" test code is defined in https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/test/core.py#L37-L39 def success(result):
''' Test if task result yields success '''
return not failed(result) |
What about a |
This is not what have been stated back in 2015 in #13161 |
ISSUE TYPE
COMPONENT NAME
Success filter
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
Success filter not working as expected. So if there is a task1 which is skipped and if we have a task2 which has a filter as when: result|success after the skipped task1, task2 still runs. Although theoretically task1 was skipped so result should have "skipped" value and hence task2 should either error out or should be skipped. Attaching the playbook for better understanding.
STEPS TO REPRODUCE
EXPECTED RESULTS
If the first task1 " Run a ps command" is skipped
task2 "if rc zero then run this task" and task3 "if success then run this task" should error out or should be skipped because of the when condition.
ACTUAL RESULTS
task3 "if success then run this task" run successfully.
The text was updated successfully, but these errors were encountered: