summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Moreau Simard <dmsimard@redhat.com>2018-07-06 17:28:46 -0400
committerDavid Moreau Simard <dmsimard@redhat.com>2018-08-28 12:40:14 -0400
commitc51366f72203314a2e970368d1181975918a7ce6 (patch)
treeda57ede28a4ad74891c8204e245d1440f2abf988
parenta296583c1ac7b83ca76409a2af82e1dda30316bd (diff)
Always set up the ARA systemd unit fileHEADmaster
The idea is to make sure that the ARA systemd service is always configured so that the service can be started/stopped/disabled without needing to carry logic for configuring the unit file and reloading systemctl all over the place. Change-Id: Iadfeb0acadbb9803305abde8cface2e4104f0609
Notes
Notes (review): Code-Review+2: David Moreau Simard <dmsimard@redhat.com> Workflow+1: David Moreau Simard <dmsimard@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 28 Aug 2018 16:43:28 +0000 Reviewed-on: https://review.openstack.org/580772 Project: openstack/ansible-role-ara Branch: refs/heads/master
-rw-r--r--tasks/embedded/standalone.yml24
-rw-r--r--tasks/main.yml22
2 files changed, 23 insertions, 23 deletions
diff --git a/tasks/embedded/standalone.yml b/tasks/embedded/standalone.yml
index c3a7168..a598502 100644
--- a/tasks/embedded/standalone.yml
+++ b/tasks/embedded/standalone.yml
@@ -16,31 +16,9 @@
16# You should have received a copy of the GNU General Public License 16# You should have received a copy of the GNU General Public License
17# along with ARA. If not, see <http://www.gnu.org/licenses/>. 17# along with ARA. If not, see <http://www.gnu.org/licenses/>.
18 18
19- name: Get the location of ara-manage
20 command: which ara-manage
21 environment:
22 PATH: "{{ path_with_virtualenv | default(omit) }}"
23 register: ara_manage
24 changed_when: false
25
26- name: Copy systemd service template
27 become: true
28 template:
29 src: templates/ara_service.conf.j2
30 dest: /etc/systemd/system/ara.service
31 owner: root
32 group: root
33 mode: 0644
34 notify:
35 - reload systemctl daemon
36 - restart ara
37
38- name: Flush handlers
39 meta: flush_handlers
40
41- name: Ensure the embedded server service is started and enabled 19- name: Ensure the embedded server service is started and enabled
42 become: true 20 become: true
43 systemd: 21 service:
44 name: ara 22 name: ara
45 state: started 23 state: started
46 enabled: yes 24 enabled: yes
diff --git a/tasks/main.yml b/tasks/main.yml
index f940d57..c827670 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -59,6 +59,28 @@
59 src: logrotate.conf.j2 59 src: logrotate.conf.j2
60 dest: /etc/logrotate.d/ara 60 dest: /etc/logrotate.d/ara
61 61
62- name: Get the location of ara-manage
63 command: which ara-manage
64 environment:
65 PATH: "{{ path_with_virtualenv | default(omit) }}"
66 register: ara_manage
67 changed_when: false
68
69- name: Copy systemd service template
70 become: true
71 template:
72 src: templates/ara_service.conf.j2
73 dest: /etc/systemd/system/ara.service
74 owner: root
75 group: root
76 mode: 0644
77 notify:
78 - reload systemctl daemon
79 - restart ara
80
81- name: Flush handlers
82 meta: flush_handlers
83
62- name: Include web server configuration 84- name: Include web server configuration
63 include_tasks: "{{ ara.deployment.server }}/{{ ara.deployment.type }}.yml" 85 include_tasks: "{{ ara.deployment.server }}/{{ ara.deployment.type }}.yml"
64 86