Skip to content

Commit

Permalink
ansible-scylla-monitoring: Always look for the prometheus_rules_file …
Browse files Browse the repository at this point in the history
…in scylla_monitoring_role_config_path

This patch adds a 'scylla_monitoring_role_config_path' var which defaults to "{{ inventory_path }}"
and defines that the monitoring role should always look for the prometheus_rules_file in the path defined
in this var.
  • Loading branch information
igorribeiroduarte authored and vladzcloudius committed Sep 17, 2024
1 parent 844bb63 commit cb6a054
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ansible-scylla-monitoring/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ scylla_manager_ip: '127.0.0.1'
# Download the scylla-monitoring from here
scylla_monitoring_archive_url: 'https://github.com/scylladb/scylla-monitoring/archive/scylla-monitoring-3.10.1.tar.gz'

# The path where the role will look for config files
scylla_monitoring_role_config_path: "{{ inventory_dir }}"

scylla_monitoring_deploy_path: /opt/scylla-monitoring
scylla_monitoring_data_path: "{{ scylla_monitoring_deploy_path }}/data"
scylla_monitoring_config_path: "{{ scylla_monitoring_deploy_path }}/config"
Expand Down Expand Up @@ -49,6 +52,7 @@ use_nodetool_status_with_genconfig: false
# is always installed.
# If below value is different from 'default' a corresponding file is going to be installed as 'userdefined.rules.yml'
# in scylla_monitoring_prom_rules_path folder.
# The value should be a file path relative to 'scylla_monitoring_role_config_path'.
prometheus_rules_file: default

# Reject filter for alerts in the prometheus.rules.yml that comes as part of the Monitoring distribution.
Expand Down
2 changes: 1 addition & 1 deletion ansible-scylla-monitoring/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

- name: set prometheus rules file from preset file
copy:
src: "{{ prometheus_rules_file }}"
src: "{{ scylla_monitoring_role_config_path }}/{{ prometheus_rules_file }}"
dest: "{{ scylla_monitoring_prom_rules_path }}/userdefined.rules.yml"
mode: '0644'
when: prometheus_rules_file is defined and prometheus_rules_file != 'default'
Expand Down

0 comments on commit cb6a054

Please sign in to comment.