Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Last active August 20, 2018 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmsimard/3bf38f5b36928dcf45324acd87f3cac1 to your computer and use it in GitHub Desktop.
Save dmsimard/3bf38f5b36928dcf45324acd87f3cac1 to your computer and use it in GitHub Desktop.
Example of ARA lookup
- 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