diff --git a/roles/autocloudreporter/tasks/main.yml b/roles/autocloudreporter/tasks/main.yml index 6a9273c932..7fda38ede4 100644 --- a/roles/autocloudreporter/tasks/main.yml +++ b/roles/autocloudreporter/tasks/main.yml @@ -11,66 +11,25 @@ ## EVER BE TRUE ON ONE SYSTEM IN THE WORLD** ## default - False -- name: Install required packages (Python 2) - dnf: - name: ['python2-fedfind', 'python2-fedmsg', 'python2-resultsdb_api', - 'python2-resultsdb_conventions-fedora', 'python2-setuptools'] - state: present - when: "'python34-fedmsg' not in group_names" - tags: - - packages - -- name: Install required packages (Python 3) +- name: Install required packages dnf: name: ['python3-fedfind', 'python3-fedmsg', 'python3-resultsdb_api', 'python3-resultsdb_conventions-fedora', 'python3-setuptools'] state: present - when: "'python34-fedmsg' in group_names" tags: - packages -- name: Check if Python 2 autocloudreporter is installed - find: - paths: /usr/lib/python2.7/site-packages - patterns: "autocloudreporter*" - register: py2acrinstalled - changed_when: "1 != 1" - failed_when: "1 != 1" - check_mode: no - - name: Check out autocloudreporter git: repo: https://pagure.io/fedora-qa/autocloudreporter.git dest: /root/autocloudreporter register: gitacr -- name: Install autocloudreporter (Python 2) - command: "python2 setup.py install --nodeps" - args: - chdir: /root/autocloudreporter - when: "gitacr is changed and 'python34-fedmsg' not in group_names" - notify: - - restart fedmsg-hub - -- name: Install python2-pip if needed to remove py2 autocloudreporter - dnf: - name: python2-pip - state: present - when: "py2acrinstalled is defined and py2acrinstalled.files and 'python34-fedmsg' in group_names" - tags: - - packages - -- name: Remove autocloudreporter (Python 2) - command: "pip2 uninstall --disable-pip-version-check --yes autocloudreporter" - when: "py2acrinstalled is defined and py2acrinstalled.files and 'python34-fedmsg' in group_names" - notify: - - restart fedmsg-hub - -- name: Install autocloudreporter (Python 3) +- name: Install autocloudreporter command: "python3 setup.py install --nodeps" args: chdir: /root/autocloudreporter - when: "(gitacr is changed or (py2acrinstalled is defined and py2acrinstalled.files)) and 'python34-fedmsg' in group_names" + when: "gitacr is changed" notify: - restart fedmsg-hub @@ -80,11 +39,3 @@ - restart fedmsg-hub tags: - config - -- name: Remove Python 2 packages - dnf: - name: ['python2-fedfind', 'python2-resultsdb_api', 'python2-resultsdb_conventions-fedora'] - state: absent - when: "'python34-fedmsg' in group_names" - tags: - - packages diff --git a/roles/check-compose/tasks/main.yml b/roles/check-compose/tasks/main.yml index b92fd79486..99b5d66657 100644 --- a/roles/check-compose/tasks/main.yml +++ b/roles/check-compose/tasks/main.yml @@ -36,70 +36,29 @@ #- name: Install required packages (testing) # dnf: name={{ item }} state=present enablerepo="updates-testing" # with_items: -# - python2-fedfind +# - python3-fedfind # tags: # - packages -- name: Install required packages (Python 2) - dnf: - name: ['python2-fedfind', 'python2-fedmsg', 'python2-openqa_client', - 'python2-setuptools', 'python2-six'] - state: present - when: "'python34-fedmsg' not in group_names" - tags: - - packages - -- name: Install required packages (Python 3) +- name: Install required packages dnf: name: ['python3-fedfind', 'python3-fedmsg', '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 (Python 2) - command: "python2 setup.py install --nodeps" - args: - chdir: /root/check-compose - when: "gitcc is changed and 'python34-fedmsg' not in group_names" - notify: - - restart fedmsg-hub - -- name: Install python2-pip if needed to remove py2 check-compose - dnf: - name: python2-pip - state: present - when: "py2ccinstalled is defined and py2ccinstalled.files and 'python34-fedmsg' in group_names" - tags: - - packages - -- name: Remove check-compose (Python 2) - command: "pip2 uninstall --disable-pip-version-check --yes check-compose" - when: "py2ccinstalled is defined and py2ccinstalled.files and 'python34-fedmsg' in group_names" - notify: - - restart fedmsg-hub - -- name: Install check-compose (Python 3) +- name: Install check-compose command: "python3 setup.py install --nodeps" args: chdir: /root/check-compose - when: "(gitcc is changed or (py2ccinstalled is defined and py2ccinstalled.files)) and 'python34-fedmsg' in group_names" + when: "gitcc is changed" notify: - restart fedmsg-hub @@ -110,14 +69,6 @@ tags: - config -- name: Remove Python 2 packages - dnf: - name: ['python2-fedfind', 'python2-openqa_client'] - 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: diff --git a/roles/openqa/dispatcher/tasks/main.yml b/roles/openqa/dispatcher/tasks/main.yml index 72f9256bdf..de61e653a3 100644 --- a/roles/openqa/dispatcher/tasks/main.yml +++ b/roles/openqa/dispatcher/tasks/main.yml @@ -49,39 +49,20 @@ # tags: # - packages -- name: Install required packages (Python 2) - dnf: - name: ['python2-fedfind', 'python2-wikitcms', 'python2-fedmsg', - 'python2-openqa_client', 'python2-requests', 'python2-resultsdb_api', - 'python2-resultsdb_conventions-fedora', 'python2-setuptools', 'python-six'] - state: present - when: "'python34-fedmsg' not in group_names" - tags: - - packages - -- name: Install required packages (wiki oidc auth) (Python 2) - dnf: - name: python2-openidc-client - state: present - when: "wikitcms_token is defined and 'python34-fedmsg' not in group_names" - tags: - - packages - -- name: Install required packages (Python 3) +- name: Install required packages dnf: name: ['python3-fedfind', 'python3-wikitcms', 'python3-fedmsg', 'python3-openqa_client', 'python3-requests', 'python3-resultsdb_api', 'python3-resultsdb_conventions-fedora', 'python3-setuptools', 'python3-six'] state: present - when: "'python34-fedmsg' in group_names" tags: - packages -- name: Install required packages (wiki oidc auth) (Python 3) +- name: Install required packages (wiki oidc auth) dnf: name: python3-openidc-client state: present - when: "wikitcms_token is defined and 'python34-fedmsg' in group_names" + when: "wikitcms_token is defined" tags: - packages @@ -107,70 +88,21 @@ register: gittools when: "(toolsbranch.stderr.find('Not a git repository') != -1) or (toolsbranch.stdout.find('On branch master') != -1)" -- name: Check if fedora_openqa has ever been installed (Python 2) - stat: path=/usr/bin/fedora-openqa - register: insttools - when: "'python34-fedmsg' not in group_names" - changed_when: "1 != 1" - failed_when: "1 != 1" - check_mode: no - -- name: Check if fedora_openqa has ever been installed (Python 3) +- name: Check if fedora_openqa has ever been installed stat: path=/usr/local/bin/fedora-openqa register: insttools - when: "'python34-fedmsg' in group_names" changed_when: "1 != 1" failed_when: "1 != 1" check_mode: no -- name: Check if Python 2 fedora_openqa is installed - find: - paths: /usr/lib/python2.7/site-packages - patterns: "fedora_openqa*" - register: py2oqainstalled - changed_when: "1 != 1" - failed_when: "1 != 1" - check_mode: no - -- name: Install fedora_openqa (Python 2) - command: "python2 setup.py install --nodeps" - args: - chdir: /root/fedora_openqa - when: "'python34-fedmsg' not in group_names and (gittools is changed or not insttools.stat.exists)" - notify: - - restart fedmsg-hub - -- name: Install python2-pip if needed to remove py2 fedora_openqa - dnf: - name: python2-pip - state: present - when: "py2oqainstalled is defined and py2oqainstalled.files and 'python34-fedmsg' in group_names" - tags: - - packages - -- name: Remove fedora_openqa (Python 2) - command: "pip2 uninstall --disable-pip-version-check --yes fedora-openqa" - when: "py2oqainstalled is defined and py2oqainstalled.files and 'python34-fedmsg' in group_names" - notify: - - restart fedmsg-hub - -- name: Install fedora_openqa (Python 3) +- name: Install fedora_openqa command: "python3 setup.py install --nodeps" args: chdir: /root/fedora_openqa - when: "'python34-fedmsg' in group_names and (gittools is changed or not insttools.stat.exists or (py2oqainstalled is defined and py2oqainstalled.files))" + when: "gittools is changed or not insttools.stat.exists" notify: - restart fedmsg-hub -- name: Remove Python 2 packages - dnf: - name: ['python2-fedfind', 'python2-wikitcms', 'python2-openqa_client', 'python2-resultsdb_api', - 'python2-resultsdb_conventions-fedora'] - state: absent - when: "'python34-fedmsg' in group_names" - tags: - - packages - # For now, we want ppc64 jobs generated on staging but not prod (as we # have ppc64 workers for stg but not prod). So we have a WANTED file # for staging. diff --git a/roles/openqa/server/tasks/main.yml b/roles/openqa/server/tasks/main.yml index 4b9eb3fa4f..5d8982c16a 100644 --- a/roles/openqa/server/tasks/main.yml +++ b/roles/openqa/server/tasks/main.yml @@ -67,23 +67,12 @@ # this is separate from the step below so we can easily flip it between # stable and testing -- name: Install openQA packages (Python 2) - dnf: - name: ['openqa', 'openqa-httpd', 'openqa-plugin-fedmsg', 'openqa-plugin-fedoraupdaterestart', - 'python2-fedfind', 'python3-fedfind'] - state: present - enablerepo: "updates-testing" - when: "'python34-fedmsg' not in group_names" - tags: - - packages - -- name: Install openQA packages (Python 3) +- name: Install openQA packages dnf: name: ['openqa', 'openqa-httpd', 'openqa-plugin-fedmsg', 'openqa-plugin-fedoraupdaterestart', 'python3-fedfind'] state: present - enablerepo: "updates-testing" - when: "'python34-fedmsg' in group_names" +# enablerepo: "updates-testing" tags: - packages diff --git a/roles/relvalconsumer/tasks/main.yml b/roles/relvalconsumer/tasks/main.yml index 17ad87b806..8dda7eb654 100644 --- a/roles/relvalconsumer/tasks/main.yml +++ b/roles/relvalconsumer/tasks/main.yml @@ -17,51 +17,25 @@ # note: kept around for when we need packages from u-t #- name: Install required packages (testing) # dnf: -# name: ['python2-fedfind', 'python2-wikitcms'] +# name: ['python3-fedfind', 'python3-wikitcms'] # state: present # enablerepo: "updates-testing" # tags: # - packages - -- name: Install required packages (Python 2) - dnf: - name: ['python2-fedfind', 'python2-wikitcms', 'python2-fedmsg', 'python2-mwclient', - 'python2-setuptools', 'relval'] - state: present - when: "'python34-fedmsg' not in group_names" - tags: - - packages - -- name: Install required packages (wiki oidc auth) (Python 2) - dnf: name=python2-openidc-client state=present enablerepo="updates" - when: "wikitcms_token is defined and 'python34-fedmsg' not in group_names" - tags: - - packages - -- name: Install required packages (Python 3) +- name: Install required packages dnf: name: ['python3-fedfind', 'python3-wikitcms', 'python3-fedmsg', 'python3-mwclient', 'python3-setuptools', 'relval'] state: present - when: "'python34-fedmsg' in group_names" tags: - packages -- name: Install required packages (wiki oidc auth) (Python 3) +- name: Install required packages (wiki oidc auth) dnf: name=python3-openidc-client state=present enablerepo="updates" - when: "wikitcms_token is defined and 'python34-fedmsg' in group_names" + when: "wikitcms_token is defined" tags: - packages -- name: Check if Python 2 relvalconsumer is installed - find: - paths: /usr/lib/python2.7/site-packages - patterns: "relvalconsumer*" - register: py2rvinstalled - changed_when: "1 != 1" - failed_when: "1 != 1" - check_mode: no - # next two duplicated with openqa/dispatcher, but I kinda don't want to # move them up somewhere shared, I like the roles to be somewhat usable # outside of Fedora infra... @@ -103,33 +77,11 @@ dest: /root/relvalconsumer register: gitrvc -- name: Install relvalconsumer (Python 2) - command: "python2 setup.py install --nodeps" - args: - chdir: /root/relvalconsumer - when: "gitrvc is changed and 'python34-fedmsg' not in group_names" - notify: - - restart fedmsg-hub - -- name: Install python2-pip if needed to remove py2 relvalconsumer - dnf: - name: python2-pip - state: present - when: "py2rvinstalled is defined and py2rvinstalled.files and 'python34-fedmsg' in group_names" - tags: - - packages - -- name: Remove relvalconsumer (Python 2) - command: "pip2 uninstall --disable-pip-version-check --yes relvalconsumer" - when: "py2rvinstalled is defined and py2rvinstalled.files and 'python34-fedmsg' in group_names" - notify: - - restart fedmsg-hub - -- name: Install relvalconsumer (Python 3) +- name: Install relvalconsumer command: "python3 setup.py install --nodeps" args: chdir: /root/relvalconsumer - when: "(gitrvc is changed or (py2rvinstalled is defined and py2rvinstalled.files)) and 'python34-fedmsg' in group_names" + when: "gitrvc is changed" notify: - restart fedmsg-hub @@ -140,11 +92,3 @@ - restart fedmsg-hub tags: - config - -- name: Remove Python 2 packages - dnf: - name: ['python2-fedfind', 'python2-wikitcms', 'python2-mwclient'] - state: absent - when: "'python34-fedmsg' in group_names" - tags: - - packages