Files
fedora-infra_ansible/roles/openqa/worker/tasks/createhdds.yml
Adam Williamson cc0ae629c5 openqa/worker: more packages for createhdds, set SMT setting
One of the IBM guys helpfully pointed out we need to set this
SMT thing to 'off' for VMs to run properly. I've no idea why,
but this is how we do it!
2017-08-18 08:28:12 -07:00

66 lines
1.9 KiB
YAML

# Required vars
# (none)
- name: Install required packages
dnf: name={{ item }} state=present
with_items:
- libvirt-daemon-kvm
- libvirt-python3
- python3-libguestfs
- python3-fedfind
- qemu-kvm
- virt-install
tags:
- packages
- name: Install PowerPC-specific packages
dnf: name=powerpc-utils state=present
when: ansible_architecture == 'ppc64' or ansible_architecture == 'ppc64le'
tags:
- packages
- name: Allow libvirt to read/write to NFS
seboolean: name=virt_use_nfs state=yes persistent=yes
- name: Check if SMT setting needs changing
command: "ppc64_cpu --smt"
register: smtcheck
failed_when: "1 != 1"
changed_when: "1 != 1"
check_mode: no
when: ansible_architecture == 'ppc64' or ansible_architecture == 'ppc64le'
- name: Change SMT setting if necessary
command: "ppc64_cpu --smt=off"
when: "smtcheck is defined and smtcheck.stdout.find('is off') == -1"
- 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