Last active
August 20, 2018 05:01
-
-
Save dmsimard/3bf38f5b36928dcf45324acd87f3cac1 to your computer and use it in GitHub Desktop.
Example of ARA lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Do something if there are 25 changed tasks across the entire playbook | |
async: 45 | |
poll: 5 | |
debug: | |
msg: do something | |
# My brain can't memorize how to write jinja conditions properly, please accept pseudocode | |
# The "ara" var would probably be automatically populated and kept up to date by the callback. | |
# "ara.playbook" would be a variable referencing the current playbook id running in ARA | |
# Not sure what's the simplest way of querying ARA yet. | |
when: {{ lookup('ara', playbook=ara.playbook, status='changed') }} > 25 | |
# I don't know why you would do this, but it might give you an idea of how it would work | |
- name: Query task results | |
debug: | |
msg: "{{ item.name }}: {{ item.msg }}" | |
with_items: "{{ lookup('ara', playbook=ara.playbook, get='results') }}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment