diff --git a/nas.yml b/nas.yml index b60460f6..0685c85e 100644 --- a/nas.yml +++ b/nas.yml @@ -21,10 +21,17 @@ - skip_ansible_lint - role: geerlingguy.docker + when: ansible_architecture == "x86_64" tags: - docker - skip_ansible_lint + - role: geerlingguy.docker_arm + when: ansible_architecture == "aarch64" + tags: + - docker_arm + - skip_ansible_lint + ### ### Ansible-NAS Roles ### diff --git a/requirements.yml b/requirements.yml index d69a68cb..db3ff458 100644 --- a/requirements.yml +++ b/requirements.yml @@ -2,6 +2,9 @@ - name: geerlingguy.docker version: 6.0.0 +- name: geerlingguy.docker_arm + version: 5.0.0 + - name: bertvv.samba version: v2.7.1 diff --git a/roles/stats/defaults/main.yml b/roles/stats/defaults/main.yml index 202531ca..090f43db 100644 --- a/roles/stats/defaults/main.yml +++ b/roles/stats/defaults/main.yml @@ -49,3 +49,7 @@ stats_grafana_memory: 1g stats_prometheus_retention_time: 365d stats_prometheus_retention_size: 30GB stats_collection_interval: 15s + +# uncomment to scrape more hosts +# stats_prometheus_additional_hosts: +# - 192.168.1.1:9100 diff --git a/roles/stats/tasks/prometheus.yml b/roles/stats/tasks/prometheus.yml index e3ac25ae..daf69078 100644 --- a/roles/stats/tasks/prometheus.yml +++ b/roles/stats/tasks/prometheus.yml @@ -20,7 +20,7 @@ - name: Template Prometheus config ansible.builtin.template: - src: prometheus.yml + src: prometheus.yml.j2 dest: "{{ stats_prometheus_config_directory }}/prometheus.yml" register: prometheus_config diff --git a/roles/stats/templates/prometheus.yml b/roles/stats/templates/prometheus.yml.j2 similarity index 84% rename from roles/stats/templates/prometheus.yml rename to roles/stats/templates/prometheus.yml.j2 index d16bf802..9e7ca1d2 100644 --- a/roles/stats/templates/prometheus.yml +++ b/roles/stats/templates/prometheus.yml.j2 @@ -43,3 +43,16 @@ scrape_configs: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ stats_speedtest_exporter_port }}" ] +{% if stats_prometheus_additional_hosts is defined %} + - job_name: "additional_hosts" + static_configs: + - targets: [ +{% for host in stats_prometheus_additional_hosts %} + {{ host }} + {% if not loop.last %} + , + {% endif %} + ] +{% endfor %} +{% endif %} + diff --git a/roles/traefik/templates/traefik.toml b/roles/traefik/templates/traefik.toml index 51555ba1..c2d44731 100644 --- a/roles/traefik/templates/traefik.toml +++ b/roles/traefik/templates/traefik.toml @@ -44,3 +44,6 @@ [certificatesResolvers.letsencrypt.acme.dnsChallenge] provider = "{{ traefik_dns_provider }}" + +[metrics] + [metrics.prometheus] diff --git a/website/docs/getting-started/installation.md b/website/docs/getting-started/installation.md index 5ace4e90..10e7e20c 100644 --- a/website/docs/getting-started/installation.md +++ b/website/docs/getting-started/installation.md @@ -9,7 +9,7 @@ Ansible-NAS is an Ansible playbook that sets up applications of your choice on y ## Requirements - A Linux environment with Ansible installed (in Ansible terms the "control node"). See the official [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) docs for more info. -- SSH access to an Ubuntu 22.04 server that'll become your Ansible-NAS box. It's recommended to use a fresh Ubutu Server 22.04 installation. Do not use non-LTS releases. +- SSH access to an Ubuntu 22.04 server that'll become your Ansible-NAS box. It's recommended to use a fresh Ubuntu Server 22.04 installation. Do not use non-LTS releases. :::tip