using the results of a task include in a until loop

752 views
Skip to first unread message

H Kim

unread,
Mar 8, 2016, 5:41:38 PM3/8/16
to Ansible Project
Is it possible to use a fact that was set in a include task file in the until condition of the loop?
When I try to run the following- the driver_status is never set until after this entire task has completed.

- name: Loop until status returns successful
include: tasks/check_xxx_status.yml
until: driver_status == 'RUNNING'
retries: 10
delay: 10


Any help appreciated. Thanks!

Alexey Vazhnov

unread,
Mar 9, 2016, 5:28:33 AM3/9/16
to Ansible Project
Try to use:

- name: Loop until status returns successful
  include
: tasks/check_xxx_status.yml
 
until: driver_status == 'RUNNING'
  retries
: 10
  delay
: 10

 
register: driver_reg


- debug: var=driver_reg


- name: Next task
 

 
when: driver_reg.changed
Reply all
Reply to author
Forward
0 new messages