diff --git a/roles/openqa/dispatcher/handlers/main.yml b/roles/openqa/dispatcher/handlers/main.yml new file mode 100644 index 0000000000..89917b1478 --- /dev/null +++ b/roles/openqa/dispatcher/handlers/main.yml @@ -0,0 +1,18 @@ +# Restart handler for our fedora-messaging consumers +- name: Conditionally restart openQA scheduler consumer + command: /usr/local/bin/conditional-restart.sh fm-consumer@fedora_openqa_scheduler + listen: + - restart openqa consumers + - restart openqa scheduler consumer + +- name: Conditionally restart openQA ResultsDB reporter consumer + command: /usr/local/bin/conditional-restart.sh fm-consumer@fedora_openqa_resultsdb_reporter + listen: + - restart openqa consumers + - restart openqa resultsdb consumer + +- name: Conditionally restart openQA wiki reporter consumer + command: /usr/local/bin/conditional-restart.sh fm-consumer@fedora_openqa_wiki_reporter + listen: + - restart openqa consumers + - restart openqa wiki consumer diff --git a/roles/openqa/dispatcher/tasks/main.yml b/roles/openqa/dispatcher/tasks/main.yml index 0e71bcf4c6..621b3925d5 100644 --- a/roles/openqa/dispatcher/tasks/main.yml +++ b/roles/openqa/dispatcher/tasks/main.yml @@ -216,8 +216,8 @@ args: chdir: /root/fedora_openqa when: "gittools is changed or not insttools.stat.exists" -# notify: -# - restart fedmsg-hub + notify: + - restart openqa consumers # For now, we only have enough ppc64/aarch64 workers for one instance, # so we have a variant WANTED file that we deploy based on a config @@ -225,8 +225,8 @@ - name: Install extra arch WANTED images config if enabled copy: src=images.json.extraarches dest=/etc/fedora-openqa/images.json when: openqa_extraarches -# notify: -# - restart fedmsg-hub + notify: + - restart openqa scheduler consumer - name: openQA client config template: src=client.conf.j2 dest=/etc/openqa/client.conf owner=root group=fedmsg mode=0640 @@ -238,8 +238,8 @@ - name: Write schedule.conf template: src=schedule.conf.j2 dest=/etc/fedora-openqa/schedule.conf owner=root group=root mode=0644 -# notify: -# - restart fedmsg-hub + notify: + - restart openqa consumers tags: - config @@ -324,21 +324,24 @@ - name: Configure fedora-messaging scheduler template: src=fedora_openqa_scheduler.toml.j2 dest=/etc/fedora-messaging/fedora_openqa_scheduler.toml owner=root group=root mode=0640 - register: fmscheduler + notify: + - restart openqa scheduler consumer when: "openqa_amqp_scheduler_queue is defined" tags: - config - name: Configure fedora-messaging wiki reporter template: src=fedora_openqa_wiki_reporter.toml.j2 dest=/etc/fedora-messaging/fedora_openqa_wiki_reporter.toml owner=root group=root mode=0640 - register: fmwiki + notify: + - restart openqa wiki consumer when: "openqa_amqp_wiki_reporter_queue is defined" tags: - config - name: Configure fedora-messaging ResultsDB reporter template: src=fedora_openqa_resultsdb_reporter.toml.j2 dest=/etc/fedora-messaging/fedora_openqa_resultsdb_reporter.toml owner=root group=root mode=0640 - register: fmresultsdb + notify: + - restart openqa resultsdb consumer when: "openqa_amqp_resultsdb_reporter_queue is defined" tags: - config @@ -355,18 +358,6 @@ service: name=fm-consumer@fedora_openqa_resultsdb_reporter enabled=yes state=started when: "openqa_amqp_resultsdb_reporter_queue is defined" -- name: Restart fedora-messaging scheduler service - command: /usr/local/bin/conditional-restart.sh fm-consumer@fedora_openqa_scheduler - when: "fmscheduler is changed" - -- name: Restart fedora-messaging wiki reporter service - command: /usr/local/bin/conditional-restart.sh fm-consumer@fedora_openqa_wiki_reporter - when: "fmwiki is changed" - -- name: Restart fedora-messaging ResultsDB reporter service - command: /usr/local/bin/conditional-restart.sh fm-consumer@fedora_openqa_resultsdb_reporter - when: "fmresultsdb is changed" - - name: Set up cron job to schedule live-respins jobs copy: src=schedule-live-respins.cron dest=/etc/cron.hourly/schedule-live-respins owner=root group=root mode=0755 tags: