From 3393986f348899a20105d99d0d27d637e99a784b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 29 Jun 2023 10:46:34 +0200 Subject: [PATCH 1/4] Add Telegraf --- docs/services/telegraf.md | 26 ++++++++++++++++++++++++++ group_vars/mash_servers | 30 ++++++++++++++++++++++++++++++ requirements.yml | 3 +++ setup.yml | 2 ++ 4 files changed, 61 insertions(+) create mode 100644 docs/services/telegraf.md diff --git a/docs/services/telegraf.md b/docs/services/telegraf.md new file mode 100644 index 0000000..8583d25 --- /dev/null +++ b/docs/services/telegraf.md @@ -0,0 +1,26 @@ +# Telegraf + +[Telegraf](https://www.influxdata.com/) is a plugin-driven server agent for collecting & reporting metric, that this playbook can install, powered by the [mother-of-all-self-hosting/ansible-role-influxdb](https://github.com/mother-of-all-self-hosting/ansible-role-influxdb) Ansible role. It heavily depends on [InfluxDB](influxdb.md) + +## Prerequisits + +* A installed and running [infuxdb](influxdb.md). + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +This role depends on a influxdb configuring telegraf. You need to obtain the influx token and config link in the influxdb. +In your browser, visit the influxdb and go to Load Data -> Telegraf. +There you need to add a telegraf configuraion. You can now obtain these values from the setup instructions and oaste them here. + +```yaml +telegraf_enabled: true +telegraf_influx_token: SUPERSECRETTOKEN +telegraf_config_link: https://influxdb.example.org/api/v2/telegrafs/0123456789 +``` + +## Usage + +In your influxdb configure the telegraf plugins as you like. + diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 70d3b2c..3589835 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -191,6 +191,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (syncthing_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'syncthing']}] if syncthing_enabled else []) + + ([{'name': (telegraf_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'telegraf']}] if telegraf_enabled else []) + + ([{'name': (vaultwarden_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'vaultwarden', 'vaultwarden-server']}] if vaultwarden_enabled else []) + ([{'name': (uptime_kuma_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'uptime-kuma']}] if uptime_kuma_enabled else []) @@ -2397,6 +2399,34 @@ syncthing_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certRes # # ######################################################################## +######################################################################## +# # +# telegraf # +# # +######################################################################## + +telegraf_enabled: false + +telegraf_identifier: "{{ mash_playbook_service_identifier_prefix }}telegraf" + +telegraf_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}telegraf" + +telegraf_uid: "{{ mash_playbook_uid }}" +telegraf_gid: "{{ mash_playbook_gid }}" + +telegraf_systemd_required_services_list: | + {{ + (['docker.service']) + + + ([(influxdb_identifier + '.service')] if influxdb_enabled else []) + }} + + +######################################################################## +# # +# /telegraf # +# # +######################################################################## ######################################################################## diff --git a/requirements.yml b/requirements.yml index a9ab821..e9acb73 100644 --- a/requirements.yml +++ b/requirements.yml @@ -152,6 +152,9 @@ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-syncthing.git version: v1.23.5-0 name: syncthing +- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-telegraf.git + version: v1.27.1-1 + name: telegraf - src: git+https://gitlab.com/etke.cc/roles/uptime_kuma.git version: v1.22.0-0 - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-vaultwarden.git diff --git a/setup.yml b/setup.yml index c5f64e6..4915aa7 100644 --- a/setup.yml +++ b/setup.yml @@ -131,6 +131,8 @@ - role: galaxy/syncthing + - role: galaxy/telegraf + - role: galaxy/vaultwarden - role: galaxy/uptime_kuma From ed88c4712f12c40211d4b858dd8eb892124b2005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 29 Jun 2023 14:12:06 +0200 Subject: [PATCH 2/4] Fix identiefier --- group_vars/mash_servers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 3589835..9f9e945 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -123,7 +123,7 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (infisical_identifier + '-frontend.service'), 'priority': 2000, 'groups': ['mash', 'infisical', 'infisical-frontend']}] if infisical_enabled else []) + - ([{'name': (influxdb + '.service'), 'priority': 2000, 'groups': ['mash', 'influxdb']}] if influxdb_enabled else []) + ([{'name': (influxdb_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'influxdb']}] if influxdb_enabled else []) + ([{'name': (jitsi_identifier + '-web.service'), 'priority': 4200, 'groups': ['mash', 'jitsi', 'jitsi-web']}] if jitsi_enabled else []) + From 2c72ac02081d7f9a0627a18d96458d0095135752 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 30 Jun 2023 10:01:57 +0300 Subject: [PATCH 3/4] Update telegraf.md --- docs/services/telegraf.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/services/telegraf.md b/docs/services/telegraf.md index 8583d25..7140463 100644 --- a/docs/services/telegraf.md +++ b/docs/services/telegraf.md @@ -4,15 +4,15 @@ ## Prerequisits -* A installed and running [infuxdb](influxdb.md). +* A functioning [InfluxDB](influxdb.md) instance. ## Configuration To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: -This role depends on a influxdb configuring telegraf. You need to obtain the influx token and config link in the influxdb. -In your browser, visit the influxdb and go to Load Data -> Telegraf. -There you need to add a telegraf configuraion. You can now obtain these values from the setup instructions and oaste them here. +This role depends on InfluxDB. You need to obtain the influx token and config link in from InfluxDB. +In your browser, visit the InfluxDB instance and go to **Load Data** -> **Telegraf**. +There you need to add a Telegraf configuration. You can now obtain these values from the setup instructions and paste them here. ```yaml telegraf_enabled: true @@ -22,5 +22,5 @@ telegraf_config_link: https://influxdb.example.org/api/v2/telegrafs/0123456789 ## Usage -In your influxdb configure the telegraf plugins as you like. +In your InfluxDB instance, configure the Telegraf plugins as you like. From 4dca6c9e1dedf40a418330cf4338a145245a4648 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 30 Jun 2023 10:02:37 +0300 Subject: [PATCH 4/4] Update telegraf.md --- docs/services/telegraf.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/services/telegraf.md b/docs/services/telegraf.md index 7140463..cf33adc 100644 --- a/docs/services/telegraf.md +++ b/docs/services/telegraf.md @@ -1,6 +1,6 @@ # Telegraf -[Telegraf](https://www.influxdata.com/) is a plugin-driven server agent for collecting & reporting metric, that this playbook can install, powered by the [mother-of-all-self-hosting/ansible-role-influxdb](https://github.com/mother-of-all-self-hosting/ansible-role-influxdb) Ansible role. It heavily depends on [InfluxDB](influxdb.md) +[Telegraf](https://www.influxdata.com/) is a plugin-driven server agent for collecting & reporting metric, that this playbook can install, powered by the [mother-of-all-self-hosting/ansible-role-telegraf](https://github.com/mother-of-all-self-hosting/ansible-role-telegraf) Ansible role. It heavily depends on [InfluxDB](influxdb.md) ## Prerequisits