Skip to content
Closed
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[submodule "pmm-admin"]
path = sources/pmm-admin/src/github.com/percona/pmm-admin
url = https://github.com/percona/pmm-admin.git
branch = master
branch = PMM-4145-rds-disable-metric-collection
[submodule "pmm-agent"]
path = sources/pmm-agent/src/github.com/percona/pmm-agent
url = https://github.com/percona/pmm-agent.git
Expand Down Expand Up @@ -53,7 +53,7 @@
[submodule "pmm-managed"]
path = sources/pmm-managed/src/github.com/percona/pmm-managed
url = https://github.com/percona/pmm-managed
branch = PMM-2.0
branch = PMM-4145-rds-disable-metric-collection
[submodule "qan-api2"]
path = sources/qan-api2/src/github.com/percona/qan-api2
url = https://github.com/percona/qan-api2
Expand All @@ -77,7 +77,7 @@
[submodule "grafana-dashboards"]
path = sources/grafana-dashboards
url = https://github.com/percona/grafana-dashboards
branch = PMM-2.0
branch = PMM-4145-rds-disable-metric-collection
[submodule "percona-images"]
path = sources/percona-images
url = https://github.com/Percona-Lab/percona-images
Expand All @@ -87,7 +87,7 @@
[submodule "pmm-api-tests"]
path = sources/pmm-api-tests/src/github.com/Percona-Lab/pmm-api-tests
url = https://github.com/Percona-Lab/pmm-api-tests
branch = master
branch = PMM-4145-rds-disable-metric-collection
[submodule "pmm-qa"]
path = sources/pmm-qa/src/github.com/percona/pmm-qa
url = https://github.com/percona/pmm-qa
Expand Down
1 change: 1 addition & 0 deletions sources/pid-watchdog/src/github.com/percona/pid-watchdog
Submodule pid-watchdog added at 2a86cf
1 change: 1 addition & 0 deletions sources/pmm-client/src/github.com/percona/pmm-client
Submodule pmm-client added at 38b831
1 change: 1 addition & 0 deletions sources/pmm-manage/src/github.com/percona/pmm-manage
Submodule pmm-manage added at a2b084
1 change: 1 addition & 0 deletions sources/pmm-update/.github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @AlekSi @adivinho
1 change: 1 addition & 0 deletions sources/pmm-update/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
661 changes: 661 additions & 0 deletions sources/pmm-update/LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions sources/pmm-update/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# PMM Server Update Tools
[![CLA assistant](https://cla-assistant.percona.com/readme/badge/percona/pmm-update)](https://cla-assistant.percona.com/percona/pmm-update)
* Website: https://www.percona.com/doc/percona-monitoring-and-management/index.html
* Forum: https://www.percona.com/forums/questions-discussions/percona-monitoring-and-management/

PMM Update is a tool for updating packages and OS configuration for Percona Monitoring and Management Server.
28 changes: 28 additions & 0 deletions sources/pmm-update/ansible/v010100/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# v1.1.0
---
- hosts: all
become: yes
gather_facts: yes

tasks:
- name: PMM | Clean YUM cache
command: /usr/bin/yum --enablerepo=pmm clean all
changed_when: False

- name: PMM | Install RPMs
when: ansible_os_family == 'RedHat'
yum: name={{ item }} state=present enablerepo=pmm
with_items:
- nginx
- percona-consul-0.7.3
- percona-grafana-4.1.1
- percona-prometheus-1.5.1
- percona-orchestrator-2.0.1
- percona-node_exporter-0.13.0
- percona-toolkit-2.2.20
- percona-dashboards-1.1.0
- percona-qan-api-1.1.0
- percona-qan-app-1.1.0
- pmm-server-1.1.0
- pmm-manage-1.1.0
- pmm-update
33 changes: 33 additions & 0 deletions sources/pmm-update/ansible/v010101/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# v1.1.1
---
- hosts: all
become: yes
gather_facts: yes

tasks:
- name: PMM | Clean YUM cache
command: /usr/bin/yum --enablerepo=pmm clean all
changed_when: False

- name: PMM | Install RPMs
when: ansible_os_family == 'RedHat'
yum: name={{ item }} state=present enablerepo=pmm
with_items:
- nginx
- percona-consul-0.7.3
- percona-grafana-4.1.1
- percona-prometheus-1.5.1
- percona-orchestrator-2.0.1
- percona-node_exporter-0.13.0
- percona-toolkit-2.2.20
- percona-dashboards-1.1.1
- percona-qan-api-1.1.0
- percona-qan-app-1.1.1
- pmm-server-1.1.1
- pmm-manage-1.1.0
- pmm-update

- name: PMM | Import dashboards
command: /usr/share/percona-dashboards/import-dashboards.py /srv/grafana
register: import_result
changed_when: "'up-to-date' not in import_result.stdout"
58 changes: 58 additions & 0 deletions sources/pmm-update/ansible/v010102/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# v1.1.2-2
---
- hosts: all
become: yes
gather_facts: yes

tasks:
- name: PMM | Clean YUM cache
command: /usr/bin/yum --enablerepo=pmm clean all
changed_when: False

- name: PMM | Install RPMs
when: ansible_os_family == 'RedHat'
yum: name={{ item }} state=present enablerepo=pmm
with_items:
- nginx
- pmm-update
- percona-toolkit-3.0.1
- percona-dashboards-1.1.2
- pmm-server-1.1.2
- percona-orchestrator-2.0.3
- percona-prometheus-1.5.2
- percona-node_exporter-0.13.0
- percona-qan-api-1.1.2
- percona-grafana-4.2.0
- percona-qan-app-1.1.2
- pmm-manage-1.1.2
- percona-consul-0.7.5

- name: PMM | Import dashboards
command: bash -c "/usr/share/percona-dashboards/import-dashboards.py $(dirname $(ls /srv/grafana/grafana.db /var/lib/grafana/grafana.db 2>/dev/null))"
register: import_result
changed_when: "'up-to-date' not in import_result.stdout"

- name: PMM | Stat supervisor
stat: path=/usr/bin/supervisorctl
register: supervisorctl

- name: PMM | Restart services (supervisord)
when: supervisorctl.stat.exists
command: /usr/bin/supervisorctl restart all

- name: PMM | Restart services (systemd)
when: not supervisorctl.stat.exists
service: name={{ item }} state=restarted
with_items:
- orchestrator
- prometheus
- node_exporter
- percona-qan-api
- grafana-server
- consul

- name: Hotfix for 1.1.2 AMI | Remove centos user
user:
name: centos
state: absent
remove: yes
88 changes: 88 additions & 0 deletions sources/pmm-update/ansible/v010103/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# v1.1.3
---
- hosts: all
become: yes
gather_facts: yes

tasks:
- name: PMM | Clean YUM cache
command: /usr/bin/yum --enablerepo=pmm clean all
changed_when: False

- name: PMM-793 temp workaround | Backup configs
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: '/etc/prometheus.yml', dest: '/tmp/prometheus.yml-backup' }
- { src: '/etc/orchestrator.conf.json', dest: '/tmp/orchestrator.conf.json-backup' }
- { src: '/etc/cron.daily/purge-qan-data', dest: '/tmp/purge-qan-data-backup' }

- name: PMM | Install RPMs
when: ansible_os_family == 'RedHat'
yum: name={{ item }} state=present enablerepo=pmm
with_items:
- nginx
- pmm-update
- percona-toolkit-3.0.1
- percona-dashboards-1.1.3
- pmm-server-1.1.3
- percona-orchestrator-2.1.0
- percona-prometheus-1.6.1
- percona-node_exporter-0.13.0
- percona-qan-api-1.1.3
- percona-grafana-4.2.0
- percona-qan-app-1.1.3
- pmm-manage-1.1.3
- percona-consul-0.8.1

- name: PMM-793 temp workaround | Restore configs
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: '/tmp/prometheus.yml-backup', dest: '/etc/prometheus.yml' }
- { src: '/tmp/orchestrator.conf.json-backup', dest: '/etc/orchestrator.conf.json' }
- { src: '/tmp/purge-qan-data-backup', dest: '/etc/cron.daily/purge-qan-data' }

- name: PMM-793 temp workaround | Remove tmp files with credetials
command: /usr/bin/shred --remove /tmp/prometheus.yml-backup /tmp/orchestrator.conf.json-backup /tmp/purge-qan-data-backup

- name: PMM | Stat supervisor
stat: path=/usr/bin/supervisorctl
register: supervisorctl

- name: NGINX | Disable daemon
when: supervisorctl.stat.exists
lineinfile:
dest: /etc/nginx/nginx.conf
line: 'daemon off;'

- name: NGINX | Disable password-page
when: supervisorctl.stat.exists
replace:
dest: /etc/nginx/conf.d/pmm.conf
regexp: '/usr/share/pmm-server/password-page'
replace: '/usr/share/pmm-server/landing-page'

- name: NGINX | Fix nginx config
replace:
dest: /etc/nginx/nginx.conf
regexp: '^(\s*)listen'
replace: '\1#listen'

- name: PMM | Import dashboards
command: bash -c "/usr/share/percona-dashboards/import-dashboards.py $(dirname $(ls /srv/grafana/grafana.db /var/lib/grafana/grafana.db 2>/dev/null))"
register: import_result
changed_when: "'up-to-date' not in import_result.stdout"

- name: PMM | Restart services (supervisord)
when: supervisorctl.stat.exists
command: /usr/bin/supervisorctl restart all

- name: PMM | Restart services (systemd)
when: not supervisorctl.stat.exists
service: name={{ item }} state=restarted
with_items:
- orchestrator
- prometheus
- node_exporter
- percona-qan-api
- grafana-server
- consul
Loading