Skip to content

Commit

Permalink
Merge pull request scylladb#252 from igorribeiroduarte/revert-250-iss…
Browse files Browse the repository at this point in the history
…ue_249

Revert "Improves 'scylla-node-exporter' related code"
  • Loading branch information
tarzanek authored Jun 20, 2023
2 parents a3b2bf2 + a829807 commit b2249bb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 43 deletions.
37 changes: 5 additions & 32 deletions ansible-scylla-node/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,12 @@
name: scylla-server
state: stopped

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

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

- 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
- name: node_exporter start
become: true
when: ansible_facts.services["scylla-node-exporter.service"] is defined
service:
name: node-exporter
state: started
enabled: yes

- name: Enable and start 'scylla-fstrim.timer' service
ansible.builtin.service:
Expand Down
1 change: 0 additions & 1 deletion ansible-scylla-node/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
- 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: 0 additions & 1 deletion ansible-scylla-node/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
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
18 changes: 13 additions & 5 deletions ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,23 @@
become: true
when: skip_ntp is defined and skip_ntp|bool == false

- name: Run 'node_exporter_install' (legacy)
- name: node exporter setup
shell: |
node_exporter_install --force
when: install_type == 'online'
become: true
notify:
- Enable and start 'node-exporter.service' service (legacy)
when:
- install_type == 'online'
- ansible_facts.services["scylla-node-exporter.service"] is not defined
- 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

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

0 comments on commit b2249bb

Please sign in to comment.