Recent Ansible versions do not treat deprecation warnings as errors, so there is no obvious way to make a CI pipeline fail if there are deprecation warnings. One solution I can think of is to collect output from ansible-playbook --check
to a file and analyze it using grep
, but maybe there are better approaches. A grep
-based solution should work but it will not provide enough information on the context of a failure like line numbers, etc. What other possible approaches do you propose?
Asked
Active
Viewed 156 times
0

Alex
- 907
- 2
- 8
- 22
-
I think ansible-lint does this the best in terms of diagnostics. – Matthew Schuchard Mar 04 '19 at 15:18
-
@MattSchuchard Unfortunately, ansible-lint is not aware of ansible deprecations, it checks other things. – Alex Mar 04 '19 at 22:59
-
you are probably aware of this, it does not help in general, but in case of a play you could write it accordingly using [failed_when](https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#controlling-what-defines-failure). – hchandad Mar 05 '19 at 10:01