Commit dd3e3b34 by Nadeem Shahzad Committed by GitHub

Merge pull request #4077 from edx/nadeem/OPS-2253

Upgrade mongo agent
parents f1dc0ca8 597c2e25
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
base_url: "https://cloud.mongodb.com/download/agent" base_url: "https://cloud.mongodb.com/download/agent"
pkg_arch: "amd64" pkg_arch: "amd64"
pkg_format: "deb" pkg_format: "deb"
os_version: "ubuntu1604"
agents: agents:
- agent: mongodb-mms-monitoring-agent - agent: mongodb-mms-monitoring-agent
version: "5.7.0.368-1" version: "6.0.0.381-1"
config: "/etc/mongodb-mms/monitoring-agent.config" config: "/etc/mongodb-mms/monitoring-agent.config"
dir: "monitoring" dir: "monitoring"
- agent: mongodb-mms-backup-agent - agent: mongodb-mms-backup-agent
version: "5.4.0.493-1" version: "5.8.0.655-1"
config: "/etc/mongodb-mms/backup-agent.config" config: "/etc/mongodb-mms/backup-agent.config"
dir: "backup" dir: "backup"
...@@ -10,18 +10,33 @@ ...@@ -10,18 +10,33 @@
msg: "MMSAPIKEY is required" msg: "MMSAPIKEY is required"
when: MMSAPIKEY is not defined when: MMSAPIKEY is not defined
- name: download mongo mms agent - name: download trusty mongo mms agent
get_url: get_url:
url: "{{ base_url }}/{{ item.dir }}/{{ item.agent }}_{{ item.version }}_{{ pkg_arch }}.{{ pkg_format }}" url: "{{ base_url }}/{{ item.dir }}/{{ item.agent }}_{{ item.version }}_{{ pkg_arch }}.{{ pkg_format }}"
dest: "/tmp/{{ item.agent }}-{{ item.version }}.{{ pkg_format }}" dest: "/tmp/{{ item.agent }}-{{ item.version }}.{{ pkg_format }}"
register: download_mms_deb register: download_mms_deb
with_items: "{{ agents }}" with_items: "{{ agents }}"
when: ansible_distribution_release == 'trusty'
- name: download xenial mongo mms agent
get_url:
url: "{{ base_url }}/{{ item.dir }}/{{ item.agent }}_{{ item.version }}_{{ pkg_arch }}.{{ os_version }}.{{ pkg_format }}"
dest: "/tmp/{{ item.agent }}-{{ item.version }}.{{ pkg_format }}"
register: download_mms_deb
with_items: "{{ agents }}"
when: ansible_distribution_release == 'xenial'
- name: install mongo mms agent - name: install mongo mms agent
apt: apt:
deb: "/tmp/{{ item.agent }}-{{ item.version }}.deb" deb: "/tmp/{{ item.agent }}-{{ item.version }}.deb"
when: download_mms_deb.changed when: download_mms_deb.changed
notify: restart mms with_items: "{{ agents }}"
- name: add group ID to monitoring-agent.config
lineinfile:
dest: "{{ item.config }}"
regexp: "^mmsGroupId="
line: "mmsGroupId={{ MMSGROUPID }}"
with_items: "{{ agents }}" with_items: "{{ agents }}"
- name: add key to monitoring-agent.config - name: add key to monitoring-agent.config
...@@ -29,10 +44,9 @@ ...@@ -29,10 +44,9 @@
dest: "{{ item.config }}" dest: "{{ item.config }}"
regexp: "^mmsApiKey=" regexp: "^mmsApiKey="
line: "mmsApiKey={{ MMSAPIKEY }}" line: "mmsApiKey={{ MMSAPIKEY }}"
notify: restart mms
with_items: "{{ agents }}" with_items: "{{ agents }}"
- name: start mms service - name: start mms service
service: service:
name: "{{ item.agent }}" name: "{{ item.agent }}"
state: started state: started
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment