Skip to content

Commit

Permalink
ansible-scylla-node: Enables and start 'scylla-node-exporter.service'…
Browse files Browse the repository at this point in the history
… service

This patch enables and start 'scylla-node-exporter.service' service and disables and stop (if exists) 'node-exporter.service'.

Fixes: scylladb#249

Signed-off-by: Eduardo Benzecri <[email protected]>
  • Loading branch information
ebenzecri committed Jun 16, 2023
1 parent fdac60f commit 681cb1d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
17 changes: 17 additions & 0 deletions ansible-scylla-node/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@
state: started
enabled: yes

- name: Enable and start 'scylla-node-exporter.service' service
block:
- name: Disable and stop 'node-exporter.service' service (legacy)
ansible.builtin.service:
name: node-exporter.service
state: stopped
enabled: no
when: ansible_facts.services["node-exporter.service"] is defined

- name: Enable and start 'scylla-node-exporter.service' service
ansible.builtin.service:
name: scylla-node-exporter.service
state: started
enabled: yes
become: true
when: ansible_facts.services["scylla-node-exporter.service"] is defined

- name: Enable and start 'scylla-fstrim.timer' service
ansible.builtin.service:
name: scylla-fstrim.timer
Expand Down
1 change: 1 addition & 0 deletions ansible-scylla-node/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- name: Install Scylla packages
include_tasks: Debian_install.yml
become: true
notify: Enable and start 'scylla-node-exporter.service' service

# TODO: Implement this for the debian based distros
# - name: install prerequisite python-yaml
Expand Down
1 change: 1 addition & 0 deletions ansible-scylla-node/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
lock_timeout: 60
when: scylla_version != 'latest' and scylla_edition == 'enterprise'
become: true
notify: Enable and start 'scylla-node-exporter.service' service

- name: Configure SELinux
shell: |
Expand Down
8 changes: 0 additions & 8 deletions ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,6 @@
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

- name: configure Scylla
shell: |
scylla_setup --no-raid-setup --nic {{ scylla_nic }} --setup-nic-and-disks --no-ec2-check --no-kernel-check --no-ntp-setup --no-io-setup --no-node-exporter --no-coredump-setup --no-sysconfig-setup --no-swap-setup
Expand Down

0 comments on commit 681cb1d

Please sign in to comment.