zuul-jobs/test-playbooks/intercept-job.yaml
Ian Wienand 58a8d1a119
ansible-lint: add names to blocks/includes, etc.
This adds names to blocks and includes for consistency.  We've done
this before (e.g. Ia7e490aaba99da9694a6f3fdb1bca9838221b30a) but I
guess 6.12.0 is finding more...

Change-Id: Ib451f6d3c5a18047873e63aa0a1aa2b425846fec
2023-02-03 15:06:03 +11:00

39 lines
1.1 KiB
YAML

- name: Set up async task that will add intercept key
hosts: all
tasks:
- name: Start keygen
command: ssh-keygen -N '' -t ed25519 -f {{ zuul.project.src_dir }}/intercept_job
async: 300
poll: 0
register: keygen
- name: Start background script to stop the waiting
shell: |
sleep 60
touch "{{ zuul.project.src_dir }}/intercept_job.stop"
async: 120
poll: 0
register: touched_file
- name: Set async status
async_status:
jid: "{{ keygen.ansible_job_id }}"
register: keygen_check
until: keygen_check.finished == 1
retries: 2
- name: Run intercept-job
include_role:
name: intercept-job
- name: Set async status
async_status:
jid: "{{ touched_file.ansible_job_id }}"
register: touched_file_check
until: touched_file_check.finished == 1
retries: 3
- name: Stat job stop
stat:
path: "{{ zuul.project.src_dir }}/intercept_job.stop"
register: stop_waiting
- name: Look for failures
assert:
that:
- stop_waiting.stat.exists