Remove not needed conditions from handlers.

This commit is contained in:
Mikhail Konyakhin 2019-12-21 12:56:19 +03:00
parent 0b50bcc867
commit 56af8c7e9b
5 changed files with 18 additions and 19 deletions

View File

@ -3,9 +3,6 @@
- name: reload systemd
systemd:
daemon_reload: yes
when:
- ansible_service_mgr == "systemd"
- mongodb_manage_service | bool
- name: run disable-transparent-hugepages
systemd:
@ -13,13 +10,6 @@
enabled: true
state: started
daemon_reload: yes
when: ansible_service_mgr == "systemd" and mongodb_disable_transparent_hugepages | bool
- name: mongodb reload
service:
name: "{{ mongodb_daemon_name }}"
state: reloaded
when: mongodb_manage_service | bool
- name: mongodb restart
service:
@ -38,11 +28,6 @@
name: sysfsutils
state: restarted
- name: service started
service:
name: "{{ mongodb_daemon_name }}"
state: started
- name: wait when mongodb is started
wait_for:
host: "{{ item }}"
@ -56,3 +41,4 @@
port: "{{ mongodb_net_port }}"
delay: 5
timeout: 120

View File

@ -81,7 +81,6 @@
mode: 0644
notify:
- mongodb restart
- service started
- wait when mongodb is started
- name: Flush all handlers at this point

View File

@ -10,4 +10,7 @@
- "disable-transparent-hugepages.{{ ansible_distribution | lower }}.service.j2"
- "disable-transparent-hugepages.{{ ansible_os_family | lower }}.service.j2"
notify: "run disable-transparent-hugepages"
when:
- ansible_service_mgr == "systemd"
- mongodb_disable_transparent_hugepages | bool

View File

@ -124,6 +124,12 @@
no_log: false
tags: [mongodb]
- name: service started
service:
name: "{{ mongodb_daemon_name }}"
state: started
enabled: yes
- name: Include MMS Agent configuration
include: mms-agent.yml
when: mongodb_mms_api_key | length > 0

View File

@ -19,9 +19,14 @@
mode: 0755
- name: Configure the MMS agent pt. 2
template: src=monitoring-agent.config.j2 dest=/etc/mongodb-mms/monitoring-agent.config
template:
src: monitoring-agent.config.j2
dest: /etc/mongodb-mms/monitoring-agent.config
notify: mongodb-mms-monitoring-agent restart
- name: Ensure that the MMS agent is started
service: name=mongodb-mms-monitoring-agent state=started enabled=yes
when: mongodb_manage_service
service:
name: mongodb-mms-monitoring-agent
state: started
enabled: yes