mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-03 02:42:12 +08:00
73 lines
2.0 KiB
YAML
73 lines
2.0 KiB
YAML
# Required vars
|
|
# - openqa_workers
|
|
## integer - number of worker instances to create/run
|
|
|
|
# Required vars with defaults
|
|
# - openqa_hostname
|
|
## string - hostname of openQA server to run jobs for
|
|
## default - localhost
|
|
|
|
- name: Install packages
|
|
dnf: name={{ item }} state=present
|
|
with_items:
|
|
- openqa-worker
|
|
- os-autoinst-openvswitch
|
|
- libselinux-python
|
|
- edk2.git-ovmf-x64
|
|
- tunctl
|
|
tags:
|
|
- packages
|
|
|
|
- include: nfs-client.yml
|
|
when: openqa_hostname is defined and openqa_hostname != "localhost"
|
|
|
|
- name: openQA client config
|
|
template: src=client.conf.j2 dest=/etc/openqa/client.conf owner=_openqa-worker group=root mode=0600
|
|
tags:
|
|
- config
|
|
|
|
- name: openQA worker config
|
|
template: src=workers.ini.j2 dest=/etc/openqa/workers.ini owner=_openqa-worker group=root mode=0644
|
|
tags:
|
|
- config
|
|
|
|
- name: Start openvswitch service
|
|
service: name=openvswitch enabled=yes state=started
|
|
with_sequence: "count={{ openqa_workers }}"
|
|
|
|
- name: openvswitch bridge device config
|
|
copy: src=ifcfg-br0 dest=/etc/sysconfig/network-scripts/ifcfg-br0 owner=root group=root mode=0644
|
|
notify:
|
|
- restart NetworkManager
|
|
tags:
|
|
- config
|
|
|
|
- name: Check if bridge is down
|
|
shell: "nmcli con show --active | grep ^br0"
|
|
register: brstatus
|
|
failed_when: "1 != 1"
|
|
changed_when: "1 != 1"
|
|
always_run: true
|
|
|
|
- name: Bring up bridge if necessary
|
|
command: ifup br0
|
|
when: "brstatus.rc > 0"
|
|
|
|
- name: Install ifup-pre-local script to create tap devices
|
|
copy: src=ifup-pre-local dest=/sbin/ifup-pre-local owner=root group=root mode=0755
|
|
|
|
- name: openvswitch tap devices config
|
|
template: src=ifcfg-tap.j2 dest=/etc/sysconfig/network-scripts/ifcfg-tap{{ item }} owner=root group=root mode=0644
|
|
with_sequence: start=0 end={{ openqa_workers | int }}
|
|
notify:
|
|
- restart NetworkManager
|
|
tags:
|
|
- config
|
|
|
|
- name: os-autoinst openvswitch service
|
|
service: name=os-autoinst-openvswitch enabled=yes state=started
|
|
|
|
- name: Worker services
|
|
service: name=openqa-worker@{{ item }} enabled=yes state=started
|
|
with_sequence: "count={{ openqa_workers }}"
|