Skip to content

Commit

Permalink
ansible-scylla-node: Improves "legacy" support for 'node-exporter'
Browse files Browse the repository at this point in the history
This patch improves how 'node_exporter_install' is called and how 'node-exporter' service is started.

Fixes: scylladb#249

Signed-off-by: Eduardo Benzecri <[email protected]>
  • Loading branch information
ebenzecri committed Jun 21, 2023
1 parent b2249bb commit 7452615
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
25 changes: 11 additions & 14 deletions ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,20 @@
become: true
when: skip_ntp is defined and skip_ntp|bool == false

- name: node exporter setup
shell: |
- name: Check if 'node_exporter_install' exists (legacy)
ansible.builtin.stat:
path: /usr/sbin/node_exporter_install
register: node_exporter_install

- name: Run 'node_exporter_install' (legacy)
ansible.builtin.shell: |
node_exporter_install --force
when: install_type == 'online'
become: true
notify:
- node_exporter start
ignore_errors: true
#TODO: stop ignoring errors when the node_exporter_install script fix is available in all actual versions, resp. use only for < 5.0 / 2022

- name: node exporter setup from 5.0/2022
service:
name: scylla-node-exporter
state: started
become: true
ignore_errors: true
#TODO: stop ignoring errors when a version check is added
- Enable and start 'node-exporter.service' service (legacy)
when:
- install_type == 'online'
- node_exporter_install.stat.exists

- name: configure Scylla
shell: |
Expand Down
6 changes: 4 additions & 2 deletions ansible-scylla-node/tasks/upgrade/post_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
ansible.builtin.service:
name: scylla-server
state: started
notify: scylla-manager-agent restart
notify:
- scylla-manager-agent restart
- Enable and start 'node-exporter.service' service (legacy)
- Enable and start 'scylla-node-exporter.service' service
become: true

0 comments on commit 7452615

Please sign in to comment.