From 02d154387de8446bacd1643953250855fc36d0cf Mon Sep 17 00:00:00 2001 From: Randy Barlow Date: Tue, 21 May 2019 22:37:07 +0000 Subject: [PATCH] bodhi: Run fedora-messaging as apache. Signed-off-by: Randy Barlow --- .../bodhi2/backend/files/fm-consumer@.service | 5 ++++ roles/bodhi2/backend/handlers/main.yml | 5 ++++ roles/bodhi2/backend/tasks/main.yml | 25 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 roles/bodhi2/backend/files/fm-consumer@.service create mode 100644 roles/bodhi2/backend/handlers/main.yml diff --git a/roles/bodhi2/backend/files/fm-consumer@.service b/roles/bodhi2/backend/files/fm-consumer@.service new file mode 100644 index 0000000000..31fa2852a9 --- /dev/null +++ b/roles/bodhi2/backend/files/fm-consumer@.service @@ -0,0 +1,5 @@ +.include /usr/lib/systemd/system/fm-consumer@.service + +[Service] +User = apache +Group = apache diff --git a/roles/bodhi2/backend/handlers/main.yml b/roles/bodhi2/backend/handlers/main.yml new file mode 100644 index 0000000000..75e79e93b8 --- /dev/null +++ b/roles/bodhi2/backend/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart fedora-messaging + service: + name: fm-consumer@config.service + state: restarted diff --git a/roles/bodhi2/backend/tasks/main.yml b/roles/bodhi2/backend/tasks/main.yml index 8534f4c61a..6740b249a2 100644 --- a/roles/bodhi2/backend/tasks/main.yml +++ b/roles/bodhi2/backend/tasks/main.yml @@ -350,6 +350,7 @@ when: inventory_hostname.startswith('bodhi-backend') notify: - reload bodhi httpd + - restart fedora-messaging tags: - config - bodhi @@ -363,6 +364,8 @@ group=apache mode=0600 when: inventory_hostname.startswith('bodhi-backend') and env == "staging" + notify: + - restart fedora-messaging tags: - config - bodhi @@ -396,6 +399,22 @@ - bodhi - config +# We can drop the when condition when we deploy Bodhi 4.0.0 to production +- name: Configure fm-consumer@.service to run as apache + copy: + src: fm-consumer@.service + dest: /etc/systemd/system/fm-consumer@.service + owner: root + group: root + mode: 0644 + when: env == "staging" + notify: + - reload systemd + - restart fedora-messaging + tags: + - bodhi + - config + - name: have the apache own /var/cache/bodhi because of course.. file: > path="/var/cache/bodhi" @@ -469,6 +488,8 @@ owner: apache group: apache when: env == "staging" + notify: + - restart fedora-messaging tags: - bodhi @@ -481,6 +502,8 @@ owner: apache group: apache when: env == "staging" + notify: + - restart fedora-messaging tags: - bodhi @@ -493,6 +516,8 @@ owner: apache group: apache when: env == "staging" + notify: + - restart fedora-messaging tags: - bodhi