From 9a5d5505708cdf41289592205c12d35f2eecb374 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Mon, 14 Jun 2021 17:25:44 +0200 Subject: [PATCH] Koji: prepare for prod deployment of rpmautospec The relevant parts were made conditional and only applied in the staging environment, change that. Alongside, ensure the obsolete hub plugin package and plugin configuration files are removed and don't automatically update any of the involved packages. Signed-off-by: Nils Philippsen --- roles/koji_builder/tasks/main.yml | 19 ++++++++++++------- roles/koji_builder/templates/kojid.conf | 2 -- roles/koji_hub/tasks/main.yml | 19 +++++++++++-------- roles/koji_hub/templates/hub.conf.j2 | 4 ---- roles/koji_hub/templates/rpmautospec.conf | 5 ----- 5 files changed, 23 insertions(+), 26 deletions(-) delete mode 100644 roles/koji_hub/templates/rpmautospec.conf diff --git a/roles/koji_builder/tasks/main.yml b/roles/koji_builder/tasks/main.yml index 8bbe1a7102..44078bfb37 100644 --- a/roles/koji_builder/tasks/main.yml +++ b/roles/koji_builder/tasks/main.yml @@ -132,20 +132,25 @@ # - name: install koji builder rpmautospec plugin - package: name={{ item }} state=latest + package: + name: "{{ item }}" + state: present with_items: - koji-builder-plugin-rpmautospec - when: env == 'staging' tags: - packages - koji_builder - rpmautospec -- name: install the configuration file for rpmautospec - template: - src: "{{ playbook_dir }}/../../roles/koji_hub/templates/rpmautospec.conf" - dest: /etc/kojid/plugins/rpmautospec.conf - when: env == 'staging' +- name: remove obsolete configuration of rpmautospec + file: + path: "/etc/kojid/plugins/{{ item }}" + state: absent + loop: + - rpmautospec.conf + - rpmautospec.conf.rpmnew + - rpmautospec.conf.rpmsave + - rpmautospec.conf.rpmorig tags: - koji_builder - rpmautospec diff --git a/roles/koji_builder/templates/kojid.conf b/roles/koji_builder/templates/kojid.conf index 4e49430c2b..4b26cb6612 100644 --- a/roles/koji_builder/templates/kojid.conf +++ b/roles/koji_builder/templates/kojid.conf @@ -153,9 +153,7 @@ keytab = /etc/kojid/kojid.keytab {{ plugins.append("builder_containerbuild") }} {% endif %} -{% if env == 'staging' %} {{ plugins.append("rpmautospec_builder") }} -{% endif %} ; Config for the runroot plugin lives in /etc/kojid/runroot.conf, if enabled plugins = {{ plugins | join(" ") }} diff --git a/roles/koji_hub/tasks/main.yml b/roles/koji_hub/tasks/main.yml index e33142d1cb..03897f93d5 100644 --- a/roles/koji_hub/tasks/main.yml +++ b/roles/koji_hub/tasks/main.yml @@ -186,21 +186,24 @@ # rpmautospec plugin # -- name: install koji hub rpmautospec plugin - package: name={{ item }} state=latest +- name: uninstall koji hub rpmautospec plugin + package: name={{ item }} state=absent with_items: - koji-hub-plugin-rpmautospec - when: env == 'staging' tags: - packages - koji_hub - rpmautospec -- name: install the configuration file for rpmautospec - template: - src: rpmautospec.conf - dest: /etc/koji-hub/plugins/rpmautospec.conf - when: env == 'staging' +- name: remove obsolete configuration for rpmautospec + file: + path: "/etc/koji-hub/plugins/{{ item }}" + state: absent + loop: + - rpmautospec.conf + - rpmautospec.conf.rpmnew + - rpmautospec.conf.rpmsave + - rpmautospec.conf.rpmorig tags: - koji_hub - rpmautospec diff --git a/roles/koji_hub/templates/hub.conf.j2 b/roles/koji_hub/templates/hub.conf.j2 index b9c719d828..186802f2ae 100644 --- a/roles/koji_hub/templates/hub.conf.j2 +++ b/roles/koji_hub/templates/hub.conf.j2 @@ -84,11 +84,7 @@ MissingPolicyOk = False #Plugins = koji-disable-builds-plugin #Plugins = darkserver-plugin -{% if env == 'staging' %} -Plugins = fedmsg-koji-plugin runroot_hub hub_containerbuild tag2distrepo sidetag_hub save_failed_tree rpmautospec_hub -{% else %} Plugins = fedmsg-koji-plugin runroot_hub hub_containerbuild tag2distrepo sidetag_hub save_failed_tree -{% endif %} [policy] diff --git a/roles/koji_hub/templates/rpmautospec.conf b/roles/koji_hub/templates/rpmautospec.conf deleted file mode 100644 index b341cbd85d..0000000000 --- a/roles/koji_hub/templates/rpmautospec.conf +++ /dev/null @@ -1,5 +0,0 @@ -[pagure] -{% if env == 'staging' %} -url = https://src.stg.fedoraproject.org -token = {{ rpmautospec_pagure_token_stg }} -{% endif %}