diff --git a/docs/services/prometheus-node-exporter.md b/docs/services/prometheus-node-exporter.md new file mode 100644 index 0000000..2b2550a --- /dev/null +++ b/docs/services/prometheus-node-exporter.md @@ -0,0 +1,25 @@ +# Prometheus Node Expoter + +This playbook can configure [Prometheus Node Exporter](https://github.com/prometheus/node_exporter). + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# prometheus-node-expoter # +# # +######################################################################## + +prometheus_node_exporter_enabled: true +prometheus_node_exporter_basicauth_user: your_username +prometheus_node_exporter_basicauth_password: your password + +######################################################################## +# # +# /prometheus-node-expoter # +# # +######################################################################## +``` diff --git a/docs/supported-services.md b/docs/supported-services.md index a6673a4..73f1318 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -8,6 +8,7 @@ | [Miniflux](https://miniflux.app/) | Minimalist and opinionated feed reader. | [Link](services/miniflux.md) | | [Nextcloud](https://nextcloud.com/) | The most popular self-hosted collaboration solution for tens of millions of users at thousands of organizations across the globe. | [Link](services/nextcloud.md) | | [PeerTube](https://joinpeertube.org/) | A tool for sharing online videos | [Link](services/peertube.md) | +| [Prometheus Node Exporter](https://github.com/prometheus/node_exporter) | Exporter for machine metrics | [Link](services/prometheus-node-exporter.md) | | [Postgres](https://www.postgresql.org) | A powerful, open source object-relational database system | [Link](services/postgres.md) | | [Postgres Backup](https://github.com/prodrigestivill/docker-postgres-backup-local) | A solution for backing up PostgresSQL to local filesystem with periodic backups. | [Link](services/postgres-backup.md) | | [Radicale](https://radicale.org/) | A Free and Open-Source CalDAV and CardDAV Server (solution for hosting contacts and calendars) | [Link](services/radicale.md) | diff --git a/group_vars/mash_servers b/group_vars/mash_servers index f6097b8..d761f62 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -12,6 +12,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (devture_postgres_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'postgres']}] if devture_postgres_enabled else []) + + ([{'name': (prometheus_node_exporter_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'metrics', 'prometheus-node-exporter']}] if prometheus_node_exporter_enabled else []) + + ([{'name': (devture_postgres_backup_identifier + '.service'), 'priority': 5000, 'groups': ['mash', 'backup', 'postgres-backup']}] if devture_postgres_backup_enabled else []) + ([{'name': (devture_container_socket_proxy_identifier + '.service'), 'priority': 2900, 'groups': ['mash', 'reverse-proxies', 'container-socket-proxy']}] if devture_container_socket_proxy_enabled else []) @@ -517,6 +519,53 @@ peertube_systemd_required_services_list: | ######################################################################## +######################################################################## +# # +# prometheus_node_exporter # +# # +######################################################################## + +prometheus_node_exporter_enabled: false + +prometheus_node_exporter_identifier: "{{ mash_playbook_service_identifier_prefix }}prometheus-node-exporter" + +prometheus_node_exporter_base_path: "{{ mash_playbook_base_path }}/prometheus-node-exporter" + +prometheus_node_exporter_uid: "{{ mash_playbook_uid }}" +prometheus_node_exporter_gid: "{{ mash_playbook_gid }}" + +prometheus_node_exporter_basicauth_enabled: true +prometheus_node_exporter_basicauth_user: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'node.user', rounds=655555) | to_uuid }}" +prometheus_node_exporter_basicauth_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'node.password', rounds=655555) | to_uuid }}" + +prometheus_node_exporter_container_additional_networks: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + }} + +prometheus_node_exporter_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +prometheus_node_exporter_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +prometheus_node_exporter_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +prometheus_node_exporter_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + +prometheus_node_exporter_process_extra_arguments: + - "--collector.disable-defaults" + - "--collector.cpu" + - "--collector.filesystem" + - "--collector.meminfo" + - "--collector.systemd" + - "--collector.uname" +prometheus_node_exporter_container_extra_arguments: + - "--security-opt apparmor=unconfined" + - "--mount type=bind,src=/var/run/dbus/system_bus_socket,dst=/var/run/dbus/system_bus_socket,ro,bind-propagation=rslave" + +######################################################################## +# # +# /prometheus_node_exporter # +# # +######################################################################## + + ######################################################################## # # diff --git a/requirements.yml b/requirements.yml index afd276f..537e5d1 100644 --- a/requirements.yml +++ b/requirements.yml @@ -54,6 +54,9 @@ - src: git+https://gitlab.com/etke.cc/roles/redis.git version: v7.0.9-0 +- src: git+https://gitlab.com/etke.cc/roles/prometheus_node_exporter.git + version: v1.5.0-3 + - src: git+https://gitlab.com/etke.cc/roles/redmine.git version: v5.0.5-0 diff --git a/setup.yml b/setup.yml index 5ab8b4e..5b74e6e 100644 --- a/setup.yml +++ b/setup.yml @@ -56,6 +56,8 @@ - role: galaxy/peertube + - role: galaxy/prometheus_node_exporter + - role: galaxy/radicale - role: galaxy/redmine