diff --git a/docs/services/telegraf.md b/docs/services/telegraf.md new file mode 100644 index 0000000..cf33adc --- /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-telegraf](https://github.com/mother-of-all-self-hosting/ansible-role-telegraf) Ansible role. It heavily depends on [InfluxDB](influxdb.md) + +## Prerequisits + +* 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 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 +telegraf_influx_token: SUPERSECRETTOKEN +telegraf_config_link: https://influxdb.example.org/api/v2/telegrafs/0123456789 +``` + +## Usage + +In your InfluxDB instance, configure the Telegraf plugins as you like. + diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 70d3b2c..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 []) + @@ -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 b9af159..be04d9b 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