Skip to content

Commit

Permalink
PMM-12529 provide a playbook to install pmm-client
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Nov 17, 2023
1 parent fdfb135 commit c2dc73e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
1 change: 1 addition & 0 deletions build/ansible/pmm2/post-build-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
- ansible_distribution_major_version == '9'

# TODO: move to a version-less directory, e.g. /usr/local/percona/pmm
- name: pmm-agent | Setup pmm-agent
command: >
pmm-agent setup
Expand Down
9 changes: 3 additions & 6 deletions build/ansible/roles/pmm2-images/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,9 @@
- name: PMM | Enable repo for pmm2-client
command: percona-release enable {{ pmm_client_repos }}

- name: Install RPMs | Install pmm2-client rpm
yum:
name:
- pmm2-client
state: installed
enablerepo: "{{ pmm_client_repo_name }}"
- name: Install pmm-client
include_role:
name: pmm-client

- name: Disable pmm-agent service | Disable pmm-agent
when: ansible_virtualization_type != "docker"
Expand Down
1 change: 1 addition & 0 deletions update/ansible/playbook/tasks/files/pmm.ini
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ redirect_stderr = true
[program:pmm-agent]
priority = 15
command = /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml
user = pmm
autorestart = true
autostart = true
startretries = 1000
Expand Down
33 changes: 33 additions & 0 deletions update/ansible/playbook/tasks/roles/pmm-client/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# This role installs pmm-client.
- name: Get the image version
slurp:
src: /usr/share/percona-dashboards/VERSION
register: image_version_file

- name: Set the PMM image version
set_fact:
pmm_image_version: "{{ image_version_file['content'] | b64decode | trim }}"

- name: Download and unpack the tarball
unarchive:
src: "https://www.percona.com/downloads/pmm2/{{ pmm_image_version }}/binary/tarball/pmm2-client-{{ pmm_image_version }}.tar.gz"
dest: /tmp/pmm-client/
copy: no
remote_src: true

- name: Create a directory for pmm-client
file:
path: /usr/local/percona/pmm2
state: directory
owner: pmm
group: pmm
mode: 0755

- name: Install the client
command: env PMM_USER=pmm PMM_GROUP=pmm /tmp/pmm-client/install_tarball

- name: Remove the tarball
file:
path: /tmp/pmm-client
state: absent
1 change: 0 additions & 1 deletion update/ansible/playbook/tasks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
- percona-alertmanager
- pmm-managed
- pmm-update
- pmm2-client
- pmm-dump
- vmproxy
- grafana-db-migrator
Expand Down

0 comments on commit c2dc73e

Please sign in to comment.