Skip to content

Commit 56af8c7

Browse files
committed
Remove not needed conditions from handlers.
1 parent 0b50bcc commit 56af8c7

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

handlers/main.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,13 @@
33
- name: reload systemd
44
systemd:
55
daemon_reload: yes
6-
when:
7-
- ansible_service_mgr == "systemd"
8-
- mongodb_manage_service | bool
96

107
- name: run disable-transparent-hugepages
118
systemd:
129
name: disable-transparent-hugepages
1310
enabled: true
1411
state: started
1512
daemon_reload: yes
16-
when: ansible_service_mgr == "systemd" and mongodb_disable_transparent_hugepages | bool
17-
18-
- name: mongodb reload
19-
service:
20-
name: "{{ mongodb_daemon_name }}"
21-
state: reloaded
22-
when: mongodb_manage_service | bool
2313

2414
- name: mongodb restart
2515
service:
@@ -38,11 +28,6 @@
3828
name: sysfsutils
3929
state: restarted
4030

41-
- name: service started
42-
service:
43-
name: "{{ mongodb_daemon_name }}"
44-
state: started
45-
4631
- name: wait when mongodb is started
4732
wait_for:
4833
host: "{{ item }}"
@@ -56,3 +41,4 @@
5641
port: "{{ mongodb_net_port }}"
5742
delay: 5
5843
timeout: 120
44+

tasks/configure.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
mode: 0644
8282
notify:
8383
- mongodb restart
84-
- service started
8584
- wait when mongodb is started
8685

8786
- name: Flush all handlers at this point

tasks/disable_transparent_hugepages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@
1010
- "disable-transparent-hugepages.{{ ansible_distribution | lower }}.service.j2"
1111
- "disable-transparent-hugepages.{{ ansible_os_family | lower }}.service.j2"
1212
notify: "run disable-transparent-hugepages"
13+
when:
14+
- ansible_service_mgr == "systemd"
15+
- mongodb_disable_transparent_hugepages | bool
1316

tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@
124124
no_log: false
125125
tags: [mongodb]
126126

127+
- name: service started
128+
service:
129+
name: "{{ mongodb_daemon_name }}"
130+
state: started
131+
enabled: yes
132+
127133
- name: Include MMS Agent configuration
128134
include: mms-agent.yml
129135
when: mongodb_mms_api_key | length > 0

tasks/mms-agent.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919
mode: 0755
2020

2121
- name: Configure the MMS agent pt. 2
22-
template: src=monitoring-agent.config.j2 dest=/etc/mongodb-mms/monitoring-agent.config
22+
template:
23+
src: monitoring-agent.config.j2
24+
dest: /etc/mongodb-mms/monitoring-agent.config
2325
notify: mongodb-mms-monitoring-agent restart
2426

2527
- name: Ensure that the MMS agent is started
26-
service: name=mongodb-mms-monitoring-agent state=started enabled=yes
27-
when: mongodb_manage_service
28+
service:
29+
name: mongodb-mms-monitoring-agent
30+
state: started
31+
enabled: yes
32+

0 commit comments

Comments
 (0)