ansible.openmanage/handlers/main.yml

32 lines
1.1 KiB
YAML
Raw Normal View History

---
# handlers file for openmanage
- name: Restart snmpd service
systemd:
daemon_reload: '{{ (openmanage__snmpd_register_systemd_custom.changed | default(False)) }}'
state: '{{ "restarted" if (openmanage__snmpd_service_enabled)
else "stopped" }}'
name: '{{ openmanage__snmpd_service_name }}'
enabled: '{{ openmanage__snmpd_service_enabled }}'
when:
- openmanage__deploy_state == "present"
- ansible_service_mgr == 'systemd'
- name: restart dataeng service
service:
name: 'dataeng'
state: '{{ "restarted" if (openmanage__deploy_state == "present")
else "stopped" }}'
enabled: '{{ "yes" if (openmanage__deploy_state == "present")
else "no" }}'
- name: restart webgui service
service:
name: '{{ openmanage__webgui_service_name }}'
state: '{{ "restarted" if (openmanage__deploy_state == "present") and
(openmanage__webgui_state == "present")
else "stopped" }}'
enabled: '{{ "yes" if (openmanage__deploy_state == "present") and
(openmanage__webgui_state == "present")
else "no" }}'