diff --git a/roles/prometheus/tasks/configure.yml b/roles/prometheus/tasks/configure.yml index dbf1b7b92..2a0098ceb 100644 --- a/roles/prometheus/tasks/configure.yml +++ b/roles/prometheus/tasks/configure.yml @@ -70,7 +70,7 @@ owner: "{{ prometheus_system_user }}" group: "{{ prometheus_system_group }}" mode: 0640 - validate: "{{ _prometheus_binary_install_dir }}/promtool check rules %s" + validate: "{{ prometheus_binary_install_dir }}/promtool check rules %s" when: - prometheus_alert_rules != [] - not prometheus_agent_mode @@ -89,7 +89,7 @@ owner: "{{ prometheus_system_user }}" group: "{{ prometheus_system_group }}" mode: 0640 - validate: "{{ _prometheus_binary_install_dir }}/promtool check rules %s" + validate: "{{ prometheus_binary_install_dir }}/promtool check rules %s" loop: "{{ prometheus_alert_rules_files | map('ansible.builtin.fileglob') | flatten }}" when: - not prometheus_agent_mode @@ -109,7 +109,7 @@ owner: "{{ prometheus_system_user }}" group: "{{ prometheus_system_group }}" mode: 0640 - validate: "{{ _prometheus_binary_install_dir }}/promtool check config %s" + validate: "{{ prometheus_binary_install_dir }}/promtool check config %s" no_log: "{{ false if (lookup('env', 'CI')) or (lookup('env', 'MOLECULE_PROVISIONER_NAME')) else true }}" notify: - reload prometheus diff --git a/roles/prometheus/templates/prometheus.service.j2 b/roles/prometheus/templates/prometheus.service.j2 index f7d85e748..a6f35a84e 100644 --- a/roles/prometheus/templates/prometheus.service.j2 +++ b/roles/prometheus/templates/prometheus.service.j2 @@ -12,7 +12,7 @@ Environment="GOMAXPROCS={{ ansible_processor_vcpus|default(ansible_processor_cou User={{ prometheus_system_user }} Group={{ prometheus_system_group }} ExecReload=/bin/kill -HUP $MAINPID -ExecStart={{ _prometheus_binary_install_dir }}/prometheus \ +ExecStart={{ prometheus_binary_install_dir }}/prometheus \ {% if not prometheus_agent_mode %} --storage.tsdb.path={{ prometheus_db_dir }} \ {% if prometheus_version is version('2.7.0', '>=') %} diff --git a/roles/prometheus/vars/main.yml b/roles/prometheus/vars/main.yml index c84efc35f..8ae4feec0 100644 --- a/roles/prometheus/vars/main.yml +++ b/roles/prometheus/vars/main.yml @@ -4,7 +4,6 @@ _prometheus_go_ansible_arch: "{{ {'i386': '386', 'aarch64': 'arm64', 'armv7l': 'armv7', 'armv6l': 'armv6'}.get(ansible_architecture, ansible_architecture) }}" -_prometheus_binary_install_dir: '/usr/local/bin' _prometheus_repo: "prometheus/prometheus" _github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}"