2014-12-19 14:39:09 +00:00
|
|
|
---
|
|
|
|
|
2017-09-18 10:36:33 +00:00
|
|
|
- name: Download MMS Agent (Debian)
|
2016-04-17 13:43:00 +00:00
|
|
|
get_url: url={{mongodb_mms_agent_pkg}} dest={{mongodb_storage_dbpath}}/mms-agent.deb
|
2014-12-19 14:39:09 +00:00
|
|
|
register: mongodb_mms_agent_loaded
|
2017-09-18 10:36:33 +00:00
|
|
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
2014-12-19 14:39:09 +00:00
|
|
|
|
2018-07-05 08:53:11 +00:00
|
|
|
- name: Install MMS agent (Debian)
|
|
|
|
apt:
|
|
|
|
deb: "{{mongodb_storage_dbpath}}/mms-agent.deb"
|
|
|
|
when: mongodb_mms_agent_loaded.changed #and (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu')
|
|
|
|
|
2017-09-18 10:36:33 +00:00
|
|
|
- name: Download MMS Agent (RHEL)
|
|
|
|
get_url: url={{mongodb_mms_agent_pkg}} dest={{mongodb_storage_dbpath}}/mms-agent.rpm
|
|
|
|
register: mongodb_mms_agent_loaded
|
2018-02-26 11:46:28 +00:00
|
|
|
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'
|
2017-09-18 10:36:33 +00:00
|
|
|
|
|
|
|
- name: Install MMS agent (RHEL)
|
|
|
|
yum:
|
|
|
|
name: "{{mongodb_storage_dbpath}}/mms-agent.rpm"
|
|
|
|
state: present
|
2018-02-26 11:46:28 +00:00
|
|
|
when: mongodb_mms_agent_loaded.changed and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat')
|
2014-12-19 14:39:09 +00:00
|
|
|
|
|
|
|
- name: Configure the MMS agent pt. 1
|
|
|
|
file: state=directory path=/etc/mongodb-mms owner={{mongodb_user}} group={{mongodb_user}} mode=0755
|
|
|
|
|
|
|
|
- name: Configure the MMS agent pt. 2
|
2019-04-25 13:33:47 +00:00
|
|
|
template: src=monitoring-agent.config.j2 dest=/etc/mongodb-mms/monitoring-agent.config
|
|
|
|
notify: mongodb-mms-monitoring-agent restart
|
2014-12-19 14:39:09 +00:00
|
|
|
|
|
|
|
- name: Ensure that the MMS agent is started
|
2019-04-25 13:33:47 +00:00
|
|
|
service: name=mongodb-mms-monitoring-agent state=started enabled=yes
|
2015-04-06 21:37:34 +00:00
|
|
|
when: mongodb_manage_service
|