- 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