First cut at migrating openqa-stg to fedmsg-3

This includes some tweaks to the core fedmsg roles to allow a
'generic' way of indicating that a box should use fedmsg-hub-3
not fedmsg-hub, and make the restart notification work for that.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-11-26 10:52:31 -08:00
parent 8f7cc10de5
commit 6c390c669b
9 changed files with 239 additions and 25 deletions

View file

@ -40,25 +40,58 @@
# tags:
# - packages
- name: Install required packages
- name: Install required packages (Python 2)
dnf:
name: ['python2-fedfind', 'python2-fedmsg-consumers', 'python2-openqa_client',
'python2-setuptools', 'python2-six']
state: present
when: "'python34-fedmsg' not in group_names"
tags:
- packages
- name: Install required packages (Python 3)
dnf:
name: ['python2-pip', 'python3-fedfind', 'python3-fedmsg-consumers', 'python3-openqa_client',
'python3-setuptools', 'python3-six']
state: present
when: "'python34-fedmsg' in group_names"
tags:
- packages
- name: Check if Python 2 check-compose is installed
find:
paths: /usr/lib/python2.7/site-packages
patterns: "check_compose*"
register: py2ccinstalled
changed_when: "1 != 1"
failed_when: "1 != 1"
check_mode: no
- name: Check out check-compose
git:
repo: https://pagure.io/fedora-qa/check-compose.git
dest: /root/check-compose
register: gitcc
- name: Install check-compose
command: "python setup.py install"
- name: Install check-compose (Python 2)
command: "python2 setup.py install"
args:
chdir: /root/check-compose
when: "gitcc is changed"
when: "gitcc is changed and 'python34-fedmsg' not in group_names"
notify:
- restart fedmsg-hub
- name: Remove check-compose (Python 2)
command: "pip2 --disable-pip-version-check uninstall check-compose"
when: "py2ccinstalled is defined and py2ccinstalled|length>0 and 'python34-fedmsg' in group_names"
notify:
- restart fedmsg-hub
- name: Install check-compose (Python 3)
command: "python3 setup.py install"
args:
chdir: /root/check-compose
when: "(gitcc is changed or (py2ccinstalled is defined and py2ccinstalled|length>0)) and 'python34-fedmsg' in group_names"
notify:
- restart fedmsg-hub
@ -69,6 +102,15 @@
tags:
- config
- name: Remove Python 2 packages
dnf:
name: ['python2-fedfind', 'python2-fedmsg-consumers', 'python2-openqa_client',
'python2-setuptools', 'python2-six']
state: absent
when: "'python34-fedmsg' in group_names"
tags:
- packages
- name: Install config file
template: src=check-compose.conf.j2 dest=/etc/check-compose.conf mode=0644
tags: