diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..dde6f4a
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,9 @@
+---
+# See https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
+version: 2
+updates:
+
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff --git a/.github/galaxy.svg b/.github/galaxy.svg
deleted file mode 100644
index bdc8e04..0000000
--- a/.github/galaxy.svg
+++ /dev/null
@@ -1,522 +0,0 @@
-
-
diff --git a/.github/license.svg b/.github/license.svg
deleted file mode 100644
index 4ab6d9a..0000000
--- a/.github/license.svg
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml
index 150e908..5c55ca6 100644
--- a/.github/workflows/ansible-linting-check.yml
+++ b/.github/workflows/ansible-linting-check.yml
@@ -2,22 +2,22 @@
name: Ansible Lint check
# yamllint disable-line rule:truthy
-on:
- push:
- branches: '*'
- pull_request:
- branches: '*'
+on: [push, pull_request]
jobs:
build:
-
+ name: Ansible Lint
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
+ with:
+ lfs: true
+ submodules: false
+ fetch-depth: 0
- name: 'Lint Ansible Playbook'
uses: ansible/ansible-lint-action@v6
with:
- targets: "."
+ path: "."
diff --git a/LICENSE b/LICENSE
index 393d97b..6990897 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022 L3D
+Copyright (c) 2022-2023 L3D
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index e5a48d2..9d54789 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
-[![License](https://raw.githubusercontent.com/roles-ansible/ansible_role_prometheus_ping_exporter/main/.github/license.svg)](https://github.com/roles-ansible/ansible_role_prometheus_ping_exporter/blob/main/LICENSE)
-[![Galaxy](https://github.com/roles-ansible/ansible_role_prometheus_ping_exporter/raw/main/.github/galaxy.svg)](https://galaxy.ansible.com/do1jlr/prometheus_ping_exporter)
+[![Ansible Galaxy](https://ansible.l3d.space/svg/l3d.prometheus_ping_exporter.svg)](https://galaxy.ansible.com/l3d/prometheus_ping_exporter)
+[![BSD-3 Clause](https://ansible.l3d.space/svg/l3d.prometheus_ping_exporter_license.svg)](LICENSE)
+[![Maintainance](https://ansible.l3d.space/svg/l3d.prometheus_ping_exporter_maintainance.svg)](https://ansible.l3d.space/#l3d.prometheus_ping_exporter)
# Ansible role prometheus ping exporter
Ansible role to install the prometheus node exporter from [github.com/czerwonk/ping_exporter](https://github.com/czerwonk/ping_exporter.git)
@@ -7,16 +8,20 @@ Ansible role to install the prometheus node exporter from [github.com/czerwonk/p
## Some variables
| value | default |
| --- | --- |
-| ping_exporter__user | ``ping_exporter`` |
-| ping_exporter__group | ``ping_exporter`` |
-| ping_exporter__user_home | ``/var/lib/ping_exporter`` |
-| ping_exporter__shell | ``/bin/false`` |
-| ping_exporter__version | ``latest`` |
-| **ping_exporter__targets** | `` []`` |
-| ping_exporter__nameserver | ``9.9.9.9`` |
-| ping_exporter__web_listen_address | ``:9427`` |
-| ping_exporter__filename | *see defaults/main.yml* |
-| submodules_versioncheck | ``false`` |
+| `ping_exporter__targets` | `` []`` |
+| `ping_exporter__user` | ``ping_exporter`` |
+| `ping_exporter__group` | ``ping_exporter`` |
+| `ping_exporter__user_home` | ``/var/lib/ping_exporter`` |
+| `ping_exporter__shell` | ``/bin/false`` |
+| `ping_exporter__version` | ``latest`` |
+| `ping_exporter__nameserver` | ``9.9.9.9`` |
+| `ping_exporter__web_listen_address` | ``:9427`` |
+| `ping_exporter__filename` | *see defaults/main.yml* |
+| `ping_exporter__dns` | *see defaults/main.yml* |
+| `ping_exporter__ping` | *see defaults/main.yml* |
+| `ping_exporter__options` | *see defaults/main.yml* |
+| `submodules_versioncheck` | ``false`` |
+
Please define all your targets in the ``ping_exporter__targets`` array.
diff --git a/defaults/main.yml b/defaults/main.yml
index b6ff546..a748e12 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -14,6 +14,18 @@ ping_exporter__version: 'latest'
ping_exporter__targets: []
ping_exporter__nameserver: '9.9.9.9'
ping_exporter__web_listen_address: ":9427"
+ping_exporter__dns:
+ refresh: "2m15s"
+ nameserver: "{{ ping_exporter__nameserver }}"
+
+ping_exporter__ping:
+ interval: "2s"
+ timeout: "3s"
+ history-size: 42
+ size: 120
+
+ping_exporter__options:
+ disableIPv6: false
# should we do a version check? (recomended)
submodules_versioncheck: false
diff --git a/meta/main.yml b/meta/main.yml
index c37b5a9..bf92e46 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -1,7 +1,7 @@
---
galaxy_info:
role_name: prometheus_ping_exporter
- author: do1jlr
+ author: l3d
description: Ansible role to install a prometheus ping exporter
license: "MIT"
min_ansible_version: "2.13"
diff --git a/tasks/systemd.yml b/tasks/systemd.yml
index 530cf2b..2c930c0 100644
--- a/tasks/systemd.yml
+++ b/tasks/systemd.yml
@@ -16,3 +16,10 @@
daemon_reload: true
notify:
- "Systemctl restart ping_exporter.service"
+
+- name: Enable ping_exporter.service Service and make sure it started
+ become: true
+ ansible.builtin.systemd:
+ enabled: true
+ name: 'ping_exporter.service'
+ state: 'started'
diff --git a/templates/ping_exporter_config.yml.j2 b/templates/ping_exporter_config.yml.j2
index 77f6d27..e8a6ddf 100644
--- a/templates/ping_exporter_config.yml.j2
+++ b/templates/ping_exporter_config.yml.j2
@@ -1,18 +1,10 @@
---
-#
-# {{ ansible_managed }}
-#
-targets: {{ ping_exporter__targets }}
+{{ ansible_managed | comment }}
-dns:
- refresh: 2m15s
- nameserver: {{ ping_exporter__nameserver }}
+targets: {{ ping_exporter__targets | ansible.builtin.to_yaml(encoding='utf-8') }}
-ping:
- interval: 2s
- timeout: 3s
- history-size: 42
- payload-size: 120
+dns: {{ ping_exporter__dns | ansible.builtin.to_yaml(encoding='utf-8') }}
-options:
- disableIPv6: false
+ping: {{ ping_exporter__ping | ansible.builtin.to_yaml(encoding='utf-8') }}
+
+options: {{ ping_exporter__options | ansible.builtin.to_yaml(encoding='utf-8') }}
diff --git a/vars/main.yml b/vars/main.yml
index b1ad548..1f08252 100644
--- a/vars/main.yml
+++ b/vars/main.yml
@@ -11,5 +11,5 @@ ping_arch_map:
ping_arch: "{{ ping_arch_map[ansible_architecture] | default(ansible_architecture) }}"
# versionscheck
-playbook_version_number: 6 # should be a integer
+playbook_version_number: 8 # should be a integer
playbook_version_path: 'do1jlr.prometheus_ping_exporter.version'