#639 Koji: prepare for prod deployment of rpmautospec
Merged 4 years ago by humaton. Opened 4 years ago by nphilipp.
fedora-infra/ nphilipp/ansible main--rpmautospec-prod  into  main

@@ -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

@@ -153,9 +153,7 @@ 

  {{ 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(" ") }}

file modified
+11 -8
@@ -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

@@ -84,11 +84,7 @@ 

  

  #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]

  

@@ -1,5 +0,0 @@ 

- [pagure]

- {% if env == 'staging' %}

- url = https://src.stg.fedoraproject.org

- token = {{ rpmautospec_pagure_token_stg }}

- {% endif %}

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.

In general we have avoided kojid restarts from the playbook... they are pretty disruptive as every build thats in progress will restart. :(
I suppose we could keep it here since we don't install this plugin very often, but do note that when we run it likely some people will be mad that their many hour build restarted. ;(

Otherwise looks ok to me. ;) I guess we could keep this in for this one-time deploy...

I'm fine with removing the notification and restartd kojids manually, but we will have to restart i.e. disrupt things for this. Maybe we should announce this a day ahead, "we will restart builders, in-flight builds will be restarted, too"? I can do that when we've planned a schedule for fedora-infrastructure#10031.

rebased onto a2f66a90ec3172476cfc8597eb34a50b3be238df

4 years ago

The latest push doesn't restart kojid anymore when the rpmautospec builder plugin is installed. Note that there are a number of other tasks in the same playbook that would (if changing things).

Yeah, a heads up would be nice... even if everyone doesn't read it. :)

Should just be a 'ansible -a 'systemctl restart kojid' builders' when the time comes.

rebased onto 7f46337145a2bcb62c3432ce5dddf94e6d312689

4 years ago

rebased onto 7f46337145a2bcb62c3432ce5dddf94e6d312689

4 years ago

rebased onto 9a5d550

4 years ago

Pull-Request has been merged by humaton

4 years ago