mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 03:43:09 +00:00
refactor(systemd_exporter): delegate common tasks to _common role
Signed-off-by: gardar <gardar@users.noreply.github.com>
This commit is contained in:
parent
1173d1ada7
commit
5e220e5f40
12 changed files with 55 additions and 249 deletions
|
@ -1,10 +1,8 @@
|
||||||
---
|
---
|
||||||
systemd_exporter_version: 0.6.0
|
systemd_exporter_version: 0.6.0
|
||||||
systemd_exporter_binary_local_dir: ""
|
|
||||||
systemd_exporter_binary_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/\
|
systemd_exporter_binary_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/\
|
||||||
systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
systemd_exporter-{{ systemd_exporter_version }}.{{ ansible_system | lower }}-{{ _systemd_exporter_go_ansible_arch }}.tar.gz"
|
||||||
systemd_exporter_checksums_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt"
|
systemd_exporter_checksums_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt"
|
||||||
systemd_exporter_skip_install: false
|
|
||||||
systemd_exporter_web_listen_address: "0.0.0.0:9558"
|
systemd_exporter_web_listen_address: "0.0.0.0:9558"
|
||||||
|
|
||||||
systemd_exporter_tls_server_config: {}
|
systemd_exporter_tls_server_config: {}
|
||||||
|
@ -19,8 +17,9 @@ systemd_exporter_unit_exclude: ""
|
||||||
systemd_exporter_binary_install_dir: "/usr/local/bin"
|
systemd_exporter_binary_install_dir: "/usr/local/bin"
|
||||||
systemd_exporter_system_group: "systemd-exporter"
|
systemd_exporter_system_group: "systemd-exporter"
|
||||||
systemd_exporter_system_user: "{{ systemd_exporter_system_group }}"
|
systemd_exporter_system_user: "{{ systemd_exporter_system_group }}"
|
||||||
|
systemd_exporter_config_dir: "/etc/systemd_exporter"
|
||||||
|
|
||||||
systemd_exporter_log_level: info
|
systemd_exporter_log_level: info
|
||||||
|
|
||||||
# Local path to stash the archive and its extraction
|
# Local path to stash the archive and its extraction
|
||||||
systemd_exporter_archive_path: /tmp
|
systemd_exporter_local_cache_path: "/tmp/systemd_exporter-{{ ansible_system | lower }}-{{ _systemd_exporter_go_ansible_arch }}/{{ systemd_exporter_version }}"
|
||||||
|
|
|
@ -11,18 +11,9 @@ argument_specs:
|
||||||
systemd_exporter_version:
|
systemd_exporter_version:
|
||||||
description: "SystemD exporter package version. Also accepts latest as parameter."
|
description: "SystemD exporter package version. Also accepts latest as parameter."
|
||||||
default: "0.6.0"
|
default: "0.6.0"
|
||||||
systemd_exporter_skip_install:
|
|
||||||
description: "SystemD exporter installation tasks gets skipped when set to true."
|
|
||||||
type: bool
|
|
||||||
default: false
|
|
||||||
systemd_exporter_binary_local_dir:
|
|
||||||
description:
|
|
||||||
- "Allows to use local packages instead of ones distributed on github."
|
|
||||||
- "As parameter it takes a directory where C(systemd_exporter) binary is stored on host on which ansible is run."
|
|
||||||
- "This overrides I(systemd_exporter_version) parameter"
|
|
||||||
systemd_exporter_binary_url:
|
systemd_exporter_binary_url:
|
||||||
description: URL of the systemd exporter binaries .tar.gz file"
|
description: URL of the systemd exporter binaries .tar.gz file"
|
||||||
default: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
default: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version }}.{{ ansible_system | lower }}-{{ _systemd_exporter_go_ansible_arch }}.tar.gz"
|
||||||
systemd_exporter_checksums_url:
|
systemd_exporter_checksums_url:
|
||||||
description: "URL of the systemd exporter checksums file"
|
description: "URL of the systemd exporter checksums file"
|
||||||
default: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt"
|
default: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt"
|
||||||
|
@ -67,6 +58,9 @@ argument_specs:
|
||||||
default: "systemd-exporter"
|
default: "systemd-exporter"
|
||||||
systemd_exporter_log_level:
|
systemd_exporter_log_level:
|
||||||
description: Only log messages with the given severity or above.
|
description: Only log messages with the given severity or above.
|
||||||
systemd_exporter_archive_path:
|
systemd_exporter_local_cache_path:
|
||||||
description: 'Local path to stash the archive and its extraction'
|
description: "Local path to stash the archive and its extraction"
|
||||||
default: "/tmp"
|
default: "/tmp/systemd_exporter-{{ ansible_system | lower }}-{{ _systemd_exporter_go_ansible_arch }}/{{ systemd_exporter_version }}"
|
||||||
|
systemd_exporter_config_dir:
|
||||||
|
description: "Path to directory with systemd_exporter configuration"
|
||||||
|
default: "/etc/systemd_exporter"
|
||||||
|
|
|
@ -5,9 +5,8 @@ provisioner:
|
||||||
inventory:
|
inventory:
|
||||||
group_vars:
|
group_vars:
|
||||||
all:
|
all:
|
||||||
systemd_exporter_binary_local_dir: "/tmp/systemd_exporter-linux-amd64"
|
systemd_exporter_local_cache_path: "/tmp/systemd_exporter-linux-amd64"
|
||||||
systemd_exporter_web_listen_address: "127.0.0.1:9000"
|
systemd_exporter_web_listen_address: "127.0.0.1:9000"
|
||||||
go_arch: amd64
|
|
||||||
systemd_exporter_version: 0.5.0
|
systemd_exporter_version: 0.5.0
|
||||||
systemd_exporter_tls_server_config:
|
systemd_exporter_tls_server_config:
|
||||||
cert_file: /etc/systemd_exporter/tls.cert
|
cert_file: /etc/systemd_exporter/tls.cert
|
||||||
|
@ -15,4 +14,4 @@ provisioner:
|
||||||
systemd_exporter_enable_file_descriptor_size: true
|
systemd_exporter_enable_file_descriptor_size: true
|
||||||
systemd_exporter_binary_url: "https://github.com/prometheus-community/systemd_exporter/releases/download/v{{\
|
systemd_exporter_binary_url: "https://github.com/prometheus-community/systemd_exporter/releases/download/v{{\
|
||||||
\ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version\
|
\ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version\
|
||||||
\ }}.linux-{{ go_arch }}.tar.gz"
|
\ }}.linux-amd64.tar.gz"
|
||||||
|
|
|
@ -36,7 +36,6 @@ def test_user(host):
|
||||||
assert host.group("systemd-exporter").exists
|
assert host.group("systemd-exporter").exists
|
||||||
assert "systemd-exporter" in host.user("systemd-exporter").groups
|
assert "systemd-exporter" in host.user("systemd-exporter").groups
|
||||||
assert host.user("systemd-exporter").shell == "/usr/sbin/nologin"
|
assert host.user("systemd-exporter").shell == "/usr/sbin/nologin"
|
||||||
assert host.user("systemd-exporter").home == "/"
|
|
||||||
|
|
||||||
|
|
||||||
def test_service(host):
|
def test_service(host):
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
---
|
|
||||||
- name: Copy the systemd_exporter systemd service file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: systemd_exporter.service.j2
|
|
||||||
dest: /etc/systemd/system/systemd_exporter.service
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
notify: restart systemd_exporter
|
|
||||||
|
|
||||||
- name: Create systemd_exporter config directory
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "/etc/systemd_exporter"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: u+rwX,g+rwX,o=rX
|
|
||||||
|
|
||||||
- name: Copy the systemd_exporter config file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: config.yaml.j2
|
|
||||||
dest: /etc/systemd_exporter/config.yaml
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
notify: restart systemd_exporter
|
|
||||||
|
|
||||||
- name: Allow systemd_exporter port in SELinux on RedHat OS family
|
|
||||||
community.general.seport:
|
|
||||||
ports: "{{ systemd_exporter_web_listen_address.split(':')[-1] }}"
|
|
||||||
proto: tcp
|
|
||||||
setype: http_port_t
|
|
||||||
state: present
|
|
||||||
when:
|
|
||||||
- ansible_version.full is version_compare('2.4', '>=')
|
|
||||||
- ansible_selinux.status == "enabled"
|
|
|
@ -1,68 +0,0 @@
|
||||||
---
|
|
||||||
- name: Create the systemd_exporter group
|
|
||||||
ansible.builtin.group:
|
|
||||||
name: "{{ systemd_exporter_system_group }}"
|
|
||||||
state: present
|
|
||||||
system: true
|
|
||||||
when: systemd_exporter_system_group != "root"
|
|
||||||
|
|
||||||
- name: Create the systemd_exporter user
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: "{{ systemd_exporter_system_user }}"
|
|
||||||
groups: "{{ systemd_exporter_system_group }}"
|
|
||||||
append: true
|
|
||||||
shell: /usr/sbin/nologin
|
|
||||||
system: true
|
|
||||||
create_home: false
|
|
||||||
home: /
|
|
||||||
when: systemd_exporter_system_user != "root"
|
|
||||||
|
|
||||||
- name: Get systemd exporter binary
|
|
||||||
when:
|
|
||||||
- systemd_exporter_binary_local_dir | length == 0
|
|
||||||
- not systemd_exporter_skip_install
|
|
||||||
block:
|
|
||||||
- name: Download systemd_exporter binary to local folder
|
|
||||||
become: false
|
|
||||||
ansible.builtin.get_url:
|
|
||||||
url: "{{ systemd_exporter_binary_url }}"
|
|
||||||
dest: "{{ systemd_exporter_archive_path }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
|
||||||
checksum: "sha256:{{ _systemd_exporter_checksum }}"
|
|
||||||
mode: '0644'
|
|
||||||
register: _download_binary
|
|
||||||
until: _download_binary is succeeded
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
delegate_to: localhost
|
|
||||||
check_mode: false
|
|
||||||
|
|
||||||
- name: Unpack systemd_exporter binary
|
|
||||||
become: false
|
|
||||||
ansible.builtin.unarchive:
|
|
||||||
src: "{{ systemd_exporter_archive_path }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
|
||||||
dest: "{{ systemd_exporter_archive_path }}"
|
|
||||||
creates: "{{ systemd_exporter_archive_path }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}/systemd_exporter"
|
|
||||||
delegate_to: localhost
|
|
||||||
check_mode: false
|
|
||||||
|
|
||||||
- name: Propagate systemd_exporter binaries
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: "{{ systemd_exporter_archive_path }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}/systemd_exporter"
|
|
||||||
dest: "{{ systemd_exporter_binary_install_dir }}/systemd_exporter"
|
|
||||||
mode: 0755
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
notify: restart systemd_exporter
|
|
||||||
when: not ansible_check_mode
|
|
||||||
|
|
||||||
- name: Propagate locally distributed systemd_exporter binary
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: "{{ systemd_exporter_binary_local_dir }}/systemd_exporter"
|
|
||||||
dest: "{{ systemd_exporter_binary_install_dir }}/systemd_exporter"
|
|
||||||
mode: 0755
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
when:
|
|
||||||
- systemd_exporter_binary_local_dir | length > 0
|
|
||||||
- not systemd_exporter_skip_install
|
|
||||||
notify: restart systemd_exporter
|
|
|
@ -2,48 +2,47 @@
|
||||||
- name: Preflight
|
- name: Preflight
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: preflight.yml
|
file: preflight.yml
|
||||||
apply:
|
|
||||||
tags:
|
|
||||||
- systemd_exporter_install
|
|
||||||
- systemd_exporter_configure
|
|
||||||
- systemd_exporter_run
|
|
||||||
tags:
|
tags:
|
||||||
- systemd_exporter_install
|
- systemd_exporter_install
|
||||||
- systemd_exporter_configure
|
- systemd_exporter_configure
|
||||||
- systemd_exporter_run
|
- systemd_exporter_run
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_role:
|
||||||
file: install.yml
|
name: prometheus.prometheus._common
|
||||||
apply:
|
tasks_from: install.yml
|
||||||
become: true
|
vars:
|
||||||
tags:
|
_common_local_cache_path: "{{ systemd_exporter_local_cache_path }}"
|
||||||
- systemd_exporter_install
|
_common_binaries: "{{ _systemd_exporter_binaries }}"
|
||||||
when:
|
_common_binary_install_dir: "{{ systemd_exporter_binary_install_dir }}"
|
||||||
( not __systemd_exporter_is_installed.stat.exists ) or
|
_common_binary_url: "{{ systemd_exporter_binary_url }}"
|
||||||
( __systemd_exporter_current_version_output.stderr_lines[0].split(" ")[2] != systemd_exporter_version ) or
|
_common_checksums_url: "{{ systemd_exporter_checksums_url }}"
|
||||||
( systemd_exporter_binary_local_dir | length > 0 )
|
_common_system_group: "{{ systemd_exporter_system_group }}"
|
||||||
|
_common_system_user: "{{ systemd_exporter_system_user }}"
|
||||||
|
_common_config_dir: "{{ systemd_exporter_config_dir }}"
|
||||||
|
_common_binary_unarchive_opts: ['--strip-components=1']
|
||||||
tags:
|
tags:
|
||||||
- systemd_exporter_install
|
- systemd_exporter_install
|
||||||
|
|
||||||
- name: SELinux
|
- name: SELinux
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_role:
|
||||||
file: selinux.yml
|
name: prometheus.prometheus._common
|
||||||
apply:
|
tasks_from: selinux.yml
|
||||||
become: true
|
vars:
|
||||||
tags:
|
_common_selinux_port: "{{ systemd_exporter_web_listen_address | urlsplit('port') }}"
|
||||||
- systemd_exporter_configure
|
|
||||||
when: ansible_selinux.status == "enabled"
|
when: ansible_selinux.status == "enabled"
|
||||||
tags:
|
tags:
|
||||||
- systemd_exporter_configure
|
- systemd_exporter_configure
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_role:
|
||||||
file: configure.yml
|
name: prometheus.prometheus._common
|
||||||
apply:
|
tasks_from: configure.yml
|
||||||
become: true
|
vars:
|
||||||
tags:
|
_common_system_user: "{{ systemd_exporter_system_user }}"
|
||||||
- systemd_exporter_configure
|
_common_system_group: "{{ systemd_exporter_system_group }}"
|
||||||
|
_common_config_dir: "{{ systemd_exporter_config_dir }}"
|
||||||
|
_common_tls_server_config: "{{ systemd_exporter_tls_server_config }}"
|
||||||
tags:
|
tags:
|
||||||
- systemd_exporter_configure
|
- systemd_exporter_configure
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,8 @@
|
||||||
---
|
---
|
||||||
- name: Assert usage of systemd as an init system
|
- name: Common preflight
|
||||||
ansible.builtin.assert:
|
ansible.builtin.include_role:
|
||||||
that: ansible_service_mgr == 'systemd'
|
name: prometheus.prometheus._common
|
||||||
msg: "This role only works with systemd"
|
tasks_from: preflight.yml
|
||||||
|
|
||||||
- name: Install package fact dependencies
|
|
||||||
become: true
|
|
||||||
ansible.builtin.package:
|
|
||||||
name: "{{ _pkg_fact_req }}"
|
|
||||||
state: present
|
|
||||||
when: (_pkg_fact_req)
|
|
||||||
vars:
|
|
||||||
_pkg_fact_req: "{% if (ansible_pkg_mgr == 'apt') %}\
|
|
||||||
{{ ('python-apt' if ansible_python_version is version('3', '<') else 'python3-apt') }}
|
|
||||||
{% else %}\
|
|
||||||
{% endif %}"
|
|
||||||
|
|
||||||
- name: Gather package facts
|
|
||||||
ansible.builtin.package_facts:
|
|
||||||
when: "not 'packages' in ansible_facts"
|
|
||||||
|
|
||||||
- name: Assert that used version supports listen address type
|
- name: Assert that used version supports listen address type
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
@ -78,24 +62,6 @@
|
||||||
systemd_exporter_system_user: "root"
|
systemd_exporter_system_user: "root"
|
||||||
when: systemd_exporter_enable_file_descriptor_size
|
when: systemd_exporter_enable_file_descriptor_size
|
||||||
|
|
||||||
- name: Check if systemd_exporter is installed
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ systemd_exporter_binary_install_dir }}/systemd_exporter"
|
|
||||||
register: __systemd_exporter_is_installed
|
|
||||||
check_mode: false
|
|
||||||
tags:
|
|
||||||
- systemd_exporter_install
|
|
||||||
|
|
||||||
- name: Gather currently installed systemd_exporter version (if any)
|
|
||||||
command: "{{ systemd_exporter_binary_install_dir }}/systemd_exporter --version"
|
|
||||||
changed_when: false
|
|
||||||
register: __systemd_exporter_current_version_output
|
|
||||||
check_mode: false
|
|
||||||
when: __systemd_exporter_is_installed.stat.exists
|
|
||||||
tags:
|
|
||||||
- systemd_exporter_install
|
|
||||||
- skip_ansible_lint
|
|
||||||
|
|
||||||
- name: Discover latest version
|
- name: Discover latest version
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
systemd_exporter_version: "{{ (lookup('url', 'https://api.github.com/repos/{{ _systemd_exporter_repo }}/releases/latest',
|
systemd_exporter_version: "{{ (lookup('url', 'https://api.github.com/repos/{{ _systemd_exporter_repo }}/releases/latest',
|
||||||
|
@ -105,24 +71,9 @@
|
||||||
retries: 10
|
retries: 10
|
||||||
when:
|
when:
|
||||||
- systemd_exporter_version == "latest"
|
- systemd_exporter_version == "latest"
|
||||||
- systemd_exporter_binary_local_dir | length == 0
|
tags:
|
||||||
- not systemd_exporter_skip_install
|
- systemd_exporter
|
||||||
|
- install
|
||||||
- name: Get systemd exporter binary checksum
|
- systemd_exporter_install
|
||||||
when:
|
- download
|
||||||
- systemd_exporter_binary_local_dir | length == 0
|
- systemd_exporter_download
|
||||||
- not systemd_exporter_skip_install
|
|
||||||
block:
|
|
||||||
- name: Get checksum list from github
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
_systemd_exporter_checksums: "{{ lookup('url', systemd_exporter_checksums_url, headers=_github_api_headers, wantlist=True) | list }}"
|
|
||||||
run_once: true
|
|
||||||
until: _systemd_exporter_checksums is search('linux-' + go_arch + '.tar.gz')
|
|
||||||
retries: 10
|
|
||||||
|
|
||||||
- name: "Get checksum for {{ go_arch }}"
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
_systemd_exporter_checksum: "{{ item.split(' ')[0] }}"
|
|
||||||
with_items: "{{ _systemd_exporter_checksums }}"
|
|
||||||
when:
|
|
||||||
- "('linux-' + go_arch + '.tar.gz') in item"
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
---
|
|
||||||
- name: Install selinux python packages [RedHat]
|
|
||||||
ansible.builtin.package:
|
|
||||||
name: "{{ ['libselinux-python', 'policycoreutils-python']
|
|
||||||
if ansible_python_version is version('3', '<') else
|
|
||||||
['python3-libselinux', 'python3-policycoreutils'] }}"
|
|
||||||
state: present
|
|
||||||
register: _install_selinux_packages
|
|
||||||
until: _install_selinux_packages is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
when: ansible_os_family | lower == "redhat"
|
|
||||||
|
|
||||||
- name: Install selinux python packages [clearlinux]
|
|
||||||
ansible.builtin.package:
|
|
||||||
name: sysadmin-basic
|
|
||||||
state: present
|
|
||||||
register: _install_selinux_packages
|
|
||||||
until: _install_selinux_packages is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
when:
|
|
||||||
- ansible_distribution | lower == "clearlinux"
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
{{ ansible_managed | comment }}
|
|
||||||
{% if systemd_exporter_tls_server_config | length > 0 %}
|
|
||||||
tls_server_config:
|
|
||||||
{{ systemd_exporter_tls_server_config | to_nice_yaml | indent(2, true) }}
|
|
||||||
{% endif %}
|
|
|
@ -37,7 +37,7 @@ ExecStart={{ systemd_exporter_binary_install_dir }}/systemd_exporter \
|
||||||
--systemd.collector.unit-exclude={{ systemd_exporter_unit_exclude }} \
|
--systemd.collector.unit-exclude={{ systemd_exporter_unit_exclude }} \
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if systemd_exporter_tls_server_config | length > 0 %}
|
{% if systemd_exporter_tls_server_config | length > 0 %}
|
||||||
--web.config.file=/etc/systemd_exporter/config.yaml \
|
--web.config.file={{ systemd_exporter_config_dir }}/web_config.yml \
|
||||||
{% endif %}
|
{% endif %}
|
||||||
--log.level={{ systemd_exporter_log_level }} \
|
--log.level={{ systemd_exporter_log_level }} \
|
||||||
--web.listen-address={{ systemd_exporter_web_listen_address }}
|
--web.listen-address={{ systemd_exporter_web_listen_address }}
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
---
|
---
|
||||||
go_arch_map:
|
_systemd_exporter_go_ansible_arch: "{{ {'i386': '386',
|
||||||
i386: '386'
|
'x86_64': 'amd64',
|
||||||
x86_64: 'amd64'
|
'aarch64': 'arm64',
|
||||||
aarch64: 'arm64'
|
'armv7l': 'armv7',
|
||||||
armv7l: 'armv7'
|
'armv6l': 'armv6'}.get(ansible_architecture, ansible_architecture) }}"
|
||||||
armv6l: 'armv6'
|
|
||||||
|
|
||||||
go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}"
|
|
||||||
_systemd_exporter_repo: "prometheus-community/systemd_exporter"
|
_systemd_exporter_repo: "prometheus-community/systemd_exporter"
|
||||||
_github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}"
|
_github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}"
|
||||||
|
_systemd_exporter_binaries: ['systemd_exporter']
|
||||||
|
|
Loading…
Reference in a new issue