openqa/worker: don't force createhdds off non-standard branch

Using the same approach as we do for the tests and fedora_openqa.
I wish I'd done this *before* I ran the playbook on lab and it
wiped every...single...goddamn...disk image.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2024-03-26 15:35:33 -07:00
parent 7cfe3d61e6
commit 826fd32330

View file

@ -32,11 +32,30 @@
command: "ppc64_cpu --smt=off"
when: "smtcheck.stdout is defined and smtcheck.stdout.find('is off') == -1"
- name: Check createhdds directory exists with correct ownership
file: path=/root/createhdds state=directory owner=root group=root
# we don't want to run the checkout if createhdds is on a non-standard
# branch, as that usually means we're messing around on staging and
# don't want the checkout reset to HEAD.
- name: Check if tests are checked out and on a non-standard branch
command: "git status" # noqa 303
args:
chdir: /root/createhdds
register: createhddsbranch
failed_when: "1 != 1"
changed_when: "1 != 1"
check_mode: no
- name: Check out createhdds
git:
repo: https://pagure.io/fedora-qa/createhdds.git
dest: /root/createhdds
version: "{{ openqa_createhdds_branch }}"
when: >
(createhddsbranch.stderr.find('ot a git repository') != -1) or
(createhddsbranch.stdout.find('On branch main') != -1 and
createhddsbranch.stdout.find('Changes not staged') == -1)
- name: Set up createhdds cron job
copy: src=createhdds dest=/etc/cron.daily/createhdds owner=root group=root mode=0755