mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-26 03:23:08 +08:00
98 lines
4.1 KiB
YAML
98 lines
4.1 KiB
YAML
---
|
|
- name: ensure packages required for libtaskotron are installed (yum)
|
|
yum: name={{ item }} state=present enablerepo={{ extra_enablerepos }}
|
|
with_items:
|
|
- PyYAML
|
|
- libtaskotron
|
|
when: deployment_type == 'local'
|
|
|
|
- name: ensure packages required for libtaskotron are installed (dnf)
|
|
dnf: name={{ item }} state=present enablerepo={{ extra_enablerepos }}
|
|
with_items:
|
|
- PyYAML
|
|
- libtaskotron
|
|
- testcloud
|
|
- selinux-policy-devel
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: ensure packages required for taskotron tasks are installed (yum)
|
|
yum: name={{ item }} state=present enablerepo={{ extra_enablerepos }}
|
|
with_items:
|
|
- python-solv
|
|
- python-librepo
|
|
- rpmlint
|
|
when: ansible_distribution_major_version|int < 22
|
|
|
|
- name: ensure packages required for taskotron tasks are installed (dnf)
|
|
dnf: name={{ item }} state=present enablerepo={{ extra_enablerepos }}
|
|
with_items:
|
|
- python-solv
|
|
- python-librepo
|
|
- rpmlint
|
|
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
|
|
|
|
- name: generate taskotron.yaml config file
|
|
template: src=taskotron.yaml.j2 dest=/etc/taskotron/taskotron.yaml owner=root group=root mode=0644
|
|
|
|
- name: generate namespaces.yaml config file
|
|
template: src=namespaces.yaml.j2 dest=/etc/taskotron/namespaces.yaml owner=root group=root mode=0644
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: generate testcloud config file
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
template: src=settings.py.testcloud.j2 dest=/etc/testcloud/settings.py owner=root group=root mode=0644
|
|
|
|
# hotfixing correct yumrepoinfo until libtaskotron is updated
|
|
- name: upload yumrepoinfo.conf
|
|
copy: src=yumrepoinfo.conf dest=/etc/taskotron/yumrepoinfo.conf owner=root group=root mode=0644
|
|
|
|
- name: set baseurl of yumrepoinfo.conf
|
|
replace: dest=/etc/taskotron/yumrepoinfo.conf regexp='baseurl = http://download\.fedoraproject\.org/.*' replace='baseurl = http://infrastructure.fedoraproject.org/pub/fedora/linux'
|
|
|
|
- name: create /var/log/taskotron for task logfiles
|
|
file: path=/var/log/taskotron state=directory owner={{ slave_user }} group={{ slave_user }} mode=1755
|
|
when: deployment_type == 'local'
|
|
|
|
- name: ensure buildslaves group exists
|
|
group: name={{ slaves_group }}
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: create directory for disposable clients images
|
|
file: path={{ imagesdir }} state=directory owner=root group={{ slaves_group }} mode=1755
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: create /var/log/taskotron for task logfiles
|
|
file: path=/var/log/taskotron state=directory owner=root group={{ slaves_group }} mode=1775
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: upload custom selinux policy to allow buildslaves to use qemu-kvm
|
|
copy: src=service-virt-transition.te dest=/root/service-virt-transition.te owner=root group=root mode=0644
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: compile selinux policy
|
|
command: chdir=/root/ creates=/root/service-virt-transition.pp make -f /usr/share/selinux/devel/Makefile
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: load custom selinux policy for qemu-kvm from buildslaves
|
|
command: chdir=/root/ semodule -i /root/service-virt-transition.pp
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: enable libvirtd
|
|
service: name=libvirtd state=started enabled=yes
|
|
when: ansible_distribution_major_version|int < 24
|
|
|
|
- name: start and enable libvirt services
|
|
service: name={{ item }} state=started enabled=yes
|
|
with_items:
|
|
- libvirtd
|
|
- virtlogd
|
|
when: ansible_distribution_major_version|int >= 24
|
|
|
|
- name: copy custom libvirt network config
|
|
copy: src=default.xml dest=/etc/libvirt/qemu/networks/default.xml owner=root group=root mode=0600
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|
|
|
|
- name: hotfix libtaskotron to set longer timeout for testcloud, this should be temporary fix though :/
|
|
replace: dest=/usr/lib/python2.7/site-packages/libtaskotron/ext/disposable/vm.py regexp=', timeout=60\):' replace=', timeout=120):' backup=yes
|
|
when: deployment_type in ['dev', 'stg', 'prod']
|