Skip to content
This repository was archived by the owner on Nov 12, 2023. It is now read-only.

Commit 1e79224

Browse files
committed
docs and molecule
1 parent 8908926 commit 1e79224

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ os: linux
33
dist: xenial
44
language: python
55
python:
6-
- 3.7
6+
- 3.8
77
cache: pip
88
services:
99
- docker
1010
env:
11-
- ANSIBLE=2.7
1211
- ANSIBLE=2.8
1312
- ANSIBLE=2.9
13+
- ANSIBLE=2.10
1414
install:
1515
- pip3 install tox-travis git-semver
1616
script:

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Deploy prometheus [systemd exporter](https://github.com/povilasv/systemd_exporte
1313

1414
## Requirements
1515

16-
- Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)
16+
- Ansible >= 2.8 (It might work on previous versions, but we cannot guarantee it)
1717
- gnu-tar on Mac deployer host (`brew install gnu-tar`)
1818

1919
## Role Variables
@@ -25,6 +25,11 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
2525
| `systemd_exporter_version` | 0.4.0 | SystemD exporter package version. Also accepts latest as parameter. |
2626
| `systemd_exporter_binary_local_dir` | "" | Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where `systemd_exporter` binary is stored on host on which ansible is ran. This overrides `systemd_exporter_version` parameter |
2727
| `systemd_exporter_web_listen_address` | "0.0.0.0:9558" | Address on which systemd exporter will listen |
28+
| `systemd_exporter_enable_restart_count` | false | Enables service restart count metrics. This feature only works with systemd 235 and above |
29+
| `systemd_exporter_enable_ip_accounting` | false | Enables service ip accounting metrics. This feature only works with systemd 235 and above |
30+
| `systemd_exporter_enable_file_descriptor_size` | false | Enables file descriptor size metrics. This feature will cause exporter to run as root as it needs access to /proc/X/fd |
31+
| `systemd_exporter_unit_allowlist` | "" | Include some systemd units. Expects a regex. More in https://github.com/povilasv/systemd_exporter#configuration |
32+
| `systemd_exporter_unit_denylist` | "" | Exclude some systemd units. Expects a regex. More in https://github.com/povilasv/systemd_exporter#configuration |
2833

2934
## Example
3035

defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ systemd_exporter_version: 0.4.0
33
systemd_exporter_binary_local_dir: ""
44
systemd_exporter_web_listen_address: "0.0.0.0:9558"
55

6-
systemd_exporter_enable_restart_count: true
7-
systemd_exporter_enable_ip_accounting: true
6+
systemd_exporter_enable_restart_count: false
7+
systemd_exporter_enable_ip_accounting: false
88
systemd_exporter_enable_file_descriptor_size: false
99

1010
systemd_exporter_unit_allowlist: ""

molecule/alternative/prepare.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@
44
gather_facts: false
55
vars:
66
go_arch: amd64
7-
node_exporter_version: 1.0.0
7+
systemd_exporter_version: 0.4.0
88
tasks:
9-
- name: Download node_exporter binary to local folder
9+
- name: Download systemd_exporter binary to local folder
1010
become: false
1111
get_url:
12-
url: "https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
13-
dest: "/tmp/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
12+
url: "https://github.com/povilasv/systemd_exporter/releases/download/v{{ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
13+
dest: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
1414
register: _download_binary
1515
until: _download_binary is succeeded
1616
retries: 5
1717
delay: 2
1818
run_once: true
1919
check_mode: false
2020

21-
- name: Unpack node_exporter binary
21+
- name: Unpack systemd_exporter binary
2222
become: false
2323
unarchive:
24-
src: "/tmp/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
24+
src: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
2525
dest: "/tmp"
26-
creates: "/tmp/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}/node_exporter"
26+
creates: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}/systemd_exporter"
2727
run_once: true
2828
check_mode: false
2929

30-
- name: link to node_exporter binaries directory
30+
- name: link to systemd_exporter binaries directory
3131
become: false
3232
file:
33-
src: "/tmp/node_exporter-{{ node_exporter_version }}.linux-amd64"
34-
dest: "/tmp/node_exporter-linux-amd64"
33+
src: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-amd64"
34+
dest: "/tmp/systemd_exporter-linux-amd64"
3535
state: link
3636
run_once: true
3737
check_mode: false

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[tox]
22
minversion = 1.8
33
basepython = python3.7
4-
envlist = py37-ansible{27,28,29}
4+
envlist = py37-ansible{28,29,210}
55
skipsdist = true
66

77
[travis:env]
88
ANSIBLE=
9-
2.7: ansible27
109
2.8: ansible28
1110
2.9: ansible29
11+
2.10: ansible210
1212

1313
[testenv]
1414
passenv = GH_* DOCKER_HOST MOLECULE_*
1515
deps =
1616
-rtest-requirements.txt
17-
ansible27: ansible<2.8
1817
ansible28: ansible<2.9
1918
ansible29: ansible<2.10
19+
ansible210: ansible<2.11
2020
commands =
2121
{posargs:molecule test --all --destroy always}

0 commit comments

Comments
 (0)