Skip to content

Commit

Permalink
Merge branch 'main' into PMM-7-update-skywalking-eyes
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov authored Sep 20, 2023
2 parents 2d3d6bf + 744ed52 commit c66efbf
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions update/ansible/playbook/tasks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,6 @@
enabled: no
when: not is_docker

- name: Remove old or redundant packages
yum:
state: absent
name:
- percona-qan-app # https://jira.percona.com/browse/PMM-6766
- mariadb-libs # https://jira.percona.com/browse/PMM-5215
- logrotate # https://jira.percona.com/browse/PMM-7627
- pmm-server # https://jira.percona.com/browse/PMM-11239
- screen
- yum-cron

# https://jira.percona.com/browse/PMM-9298
- name: Copy rezise-xfs file for lvm
copy:
Expand Down Expand Up @@ -420,7 +409,19 @@
- ALTER TABLE api_key ALTER COLUMN name TYPE text;
when: not ansible_check_mode

# Regenerating to enable pmm-update-perform-init
# we need to put this step as one of the last steps, because it removes pmm.ini and /etc/alertmanager.yml
- name: Remove old or redundant packages
yum:
state: absent
name:
- percona-qan-app # https://jira.percona.com/browse/PMM-6766
- mariadb-libs # https://jira.percona.com/browse/PMM-5215
- logrotate # https://jira.percona.com/browse/PMM-7627
- pmm-server # https://jira.percona.com/browse/PMM-11239
- screen
- yum-cron

# Regenerating pmm.ini and enabling pmm-update-perform-init
- name: Generate new supervisor config
command: pmm-managed-init
register: managed_init_result
Expand All @@ -438,6 +439,21 @@
register: reread_init__result
changed_when: "'No config updates to processes' not in reread_init__result.stdout"

# restarting pmm-managed to regenerate /etc/alertmanager.yml
- name: Restart pmm-managed EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
command: supervisorctl {{ item }} pmm-managed
become: true
changed_when: true
with_items: ["stop", "remove", "add"]

- name: Restart pmm-managed EL9
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
command: /usr/local/bin/supervisorctl {{ item }} pmm-managed
become: true
changed_when: true
with_items: ["stop", "remove", "add"]

- name: Update/restart other services EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
command: supervisorctl update
Expand Down

0 comments on commit c66efbf

Please sign in to comment.