diff --git a/roles/blackbox_exporter/defaults/main.yml b/roles/blackbox_exporter/defaults/main.yml index 6a8d1073a..46e4d8c20 100644 --- a/roles/blackbox_exporter/defaults/main.yml +++ b/roles/blackbox_exporter/defaults/main.yml @@ -75,5 +75,6 @@ blackbox_exporter_configuration_modules: blackbox_exporter_config_dir: /etc/prometheus blackbox_exporter_binary_install_dir: "/usr/local/bin" +blackbox_exporter_binary_name: "blackbox_exporter" blackbox_exporter_service_name: blackbox_exporter diff --git a/roles/blackbox_exporter/tasks/install.yml b/roles/blackbox_exporter/tasks/install.yml index dc293dcf9..68567acdd 100644 --- a/roles/blackbox_exporter/tasks/install.yml +++ b/roles/blackbox_exporter/tasks/install.yml @@ -47,7 +47,7 @@ - name: Propagate blackbox_exporter binaries ansible.builtin.copy: src: "/tmp/blackbox_exporter-{{ blackbox_exporter_version }}.linux-{{ go_arch }}/blackbox_exporter" - dest: "{{ blackbox_exporter_binary_install_dir }}/blackbox_exporter" + dest: "{{ blackbox_exporter_binary_install_dir }}/{{ blackbox_exporter_binary_name }}" mode: 0755 owner: root group: root @@ -57,7 +57,7 @@ - name: Propagate locally distributed blackbox_exporter binary ansible.builtin.copy: src: "{{ blackbox_exporter_binary_local_dir }}/blackbox_exporter" - dest: "{{ blackbox_exporter_binary_install_dir }}/blackbox_exporter" + dest: "{{ blackbox_exporter_binary_install_dir }}/{{ blackbox_exporter_binary_name }}" mode: '0755' owner: root group: root @@ -78,7 +78,7 @@ - name: Ensure blackbox exporter binary has cap_net_raw capability community.general.capabilities: - path: '{{ blackbox_exporter_binary_install_dir }}/blackbox_exporter' + path: '{{ blackbox_exporter_binary_install_dir }}/{{ blackbox_exporter_binary_name }}' capability: cap_net_raw+ep state: present when: not ansible_check_mode diff --git a/roles/blackbox_exporter/templates/blackbox_exporter.service.j2 b/roles/blackbox_exporter/templates/blackbox_exporter.service.j2 index 9c603e0cf..6ebb2ebbc 100644 --- a/roles/blackbox_exporter/templates/blackbox_exporter.service.j2 +++ b/roles/blackbox_exporter/templates/blackbox_exporter.service.j2 @@ -11,7 +11,7 @@ User={{ blackbox_exporter_user }} Group={{ blackbox_exporter_group }} PermissionsStartOnly=true ExecReload=/bin/kill -HUP $MAINPID -ExecStart={{ blackbox_exporter_binary_install_dir }}/blackbox_exporter \ +ExecStart={{ blackbox_exporter_binary_install_dir }}/{{ blackbox_exporter_binary_name }} \ --config.file={{ blackbox_exporter_config_dir }}/blackbox.yml \ {% for flag, flag_value in blackbox_exporter_cli_flags.items() -%} --{{ flag }}={{ flag_value }} \