openqa/worker: do createhdds on ppc worker
This is needed to create the ppc virt-install images (has to be done on a machine of compatible arch).
This commit is contained in:
parent
cd13c1f7ed
commit
e0dba51352
2 changed files with 44 additions and 0 deletions
41
roles/openqa/worker/tasks/createhdds.yml
Normal file
41
roles/openqa/worker/tasks/createhdds.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Required vars
|
||||
# (none)
|
||||
|
||||
- name: Install required packages
|
||||
dnf: name={{ item }} state=present
|
||||
with_items:
|
||||
- libvirt-python3
|
||||
- python3-libguestfs
|
||||
- python3-fedfind
|
||||
tags:
|
||||
- packages
|
||||
|
||||
- name: Check out createhdds
|
||||
git:
|
||||
repo: https://pagure.io/fedora-qa/createhdds.git
|
||||
dest: /root/createhdds
|
||||
|
||||
- name: Set up createhdds cron job
|
||||
copy: src=createhdds dest=/etc/cron.daily/createhdds owner=root group=root mode=0755
|
||||
|
||||
- name: Check if any hard disk images need (re)building
|
||||
command: "/root/createhdds/createhdds.py check"
|
||||
args:
|
||||
chdir: /var/lib/openqa/share/factory/hdd/fixed
|
||||
register: diskcheck
|
||||
failed_when: "1 != 1"
|
||||
changed_when: "1 != 1"
|
||||
check_mode: no
|
||||
|
||||
- name: Ensure libvirt is running if needed to create images
|
||||
service: name=libvirtd enabled=yes state=started
|
||||
when: "diskcheck.rc > 1"
|
||||
|
||||
# > 1 is not a typo; check exits with 1 if all images are present but some
|
||||
# are outdated, and 2 if any images are missing. We only want to handle
|
||||
# outright *missing* images here in the playbook (to handle the case of
|
||||
# first deployment). Outdated images are handled by the daily cron run.
|
||||
- name: Create hard disk images (this may take a long time!)
|
||||
command: "/etc/cron.daily/createhdds"
|
||||
when: "diskcheck.rc > 1"
|
||||
ignore_errors: yes
|
|
@ -49,6 +49,9 @@
|
|||
tags:
|
||||
- config
|
||||
|
||||
- include: createhdds.yml
|
||||
when: "inventory_hostname in groups['openqa-hdds-workers']"
|
||||
|
||||
- name: Enable and start worker services
|
||||
service: name=openqa-worker@{{ item }} enabled=yes state=started
|
||||
with_sequence: "count={{ openqa_workers }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue