zuul-jobs/test-playbooks/intercept-job.yaml
Clark Boylan 8d4f01b74a Cleanup remaining Ansible lint warnings
Make it easier for people to see lint errors by cleaning up the
remaining lint warnings.

Change-Id: I2b614b19f5dccd1aa2ad568ff31acabc9b87c383
2024-09-18 16:46:00 -07:00

43 lines
1.3 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
# noqa args[module] see this bug
# https://github.com/ansible/ansible-lint/issues/2824
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
# noqa args[module] see this bug
# https://github.com/ansible/ansible-lint/issues/2824
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