From 7d403e880f88aa97d84a6ba7586598400c7fcb29 Mon Sep 17 00:00:00 2001 From: Anarion Date: Sat, 7 Jan 2023 15:26:28 +0100 Subject: [PATCH 1/7] Fix Drone-CI test error --- roles/drone-ci/handlers/main.yml | 8 +++++++ roles/drone-ci/molecule/default/molecule.yml | 3 +++ roles/drone-ci/molecule/default/prepare.yml | 25 ++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 roles/drone-ci/handlers/main.yml create mode 100644 roles/drone-ci/molecule/default/prepare.yml diff --git a/roles/drone-ci/handlers/main.yml b/roles/drone-ci/handlers/main.yml new file mode 100644 index 00000000..f96a6c2b --- /dev/null +++ b/roles/drone-ci/handlers/main.yml @@ -0,0 +1,8 @@ +--- +- name: restart gitea + community.docker.docker_container: + name: gitea + image: gitea/gitea:latest + state: started + restart: true + listen: "restart gitea" \ No newline at end of file diff --git a/roles/drone-ci/molecule/default/molecule.yml b/roles/drone-ci/molecule/default/molecule.yml index 0671311d..6e293974 100644 --- a/roles/drone-ci/molecule/default/molecule.yml +++ b/roles/drone-ci/molecule/default/molecule.yml @@ -8,3 +8,6 @@ provisioner: drone_ci_gitea_client_secret: asdfasd12341234 gitea_port_http: 3001 ansible_nas_hostname: ansible-nas-ci + gitea_data_directory: "/tmp" + playbooks: + prepare: prepare.yml diff --git a/roles/drone-ci/molecule/default/prepare.yml b/roles/drone-ci/molecule/default/prepare.yml new file mode 100644 index 00000000..144e6621 --- /dev/null +++ b/roles/drone-ci/molecule/default/prepare.yml @@ -0,0 +1,25 @@ +--- +- name: Prepare + hosts: all + tasks: + - name: Install docker python module + pip: + name: docker + + - name: Create a dummy gitea config directory + file: + path: "{{ item }}" + state: directory + recurse: yes + with_items: + - "{{ gitea_data_directory }}/gitea/gitea/conf" + + - name: Create a dummy gitea config file + file: + path: "{{ gitea_data_directory }}/gitea/gitea/conf/app.ini" + state: touch + + handlers: + - name: restart gitea + command: echo "this task will restart gitea" + listen: "restart gitea" \ No newline at end of file From 98cd41f9fcad5764d70f92800df7e99e7f7dd949 Mon Sep 17 00:00:00 2001 From: Anarion Date: Sat, 7 Jan 2023 15:29:54 +0100 Subject: [PATCH 2/7] Remove unnecessary handler --- roles/drone-ci/molecule/default/prepare.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/roles/drone-ci/molecule/default/prepare.yml b/roles/drone-ci/molecule/default/prepare.yml index 144e6621..343f1e6f 100644 --- a/roles/drone-ci/molecule/default/prepare.yml +++ b/roles/drone-ci/molecule/default/prepare.yml @@ -18,8 +18,3 @@ file: path: "{{ gitea_data_directory }}/gitea/gitea/conf/app.ini" state: touch - - handlers: - - name: restart gitea - command: echo "this task will restart gitea" - listen: "restart gitea" \ No newline at end of file From 934e3a4307a5060925fb0cece213e9cce5fbef16 Mon Sep 17 00:00:00 2001 From: Anarion Date: Sat, 7 Jan 2023 15:59:14 +0100 Subject: [PATCH 3/7] Fix lint --- roles/drone-ci/handlers/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/drone-ci/handlers/main.yml b/roles/drone-ci/handlers/main.yml index f96a6c2b..991c4bcc 100644 --- a/roles/drone-ci/handlers/main.yml +++ b/roles/drone-ci/handlers/main.yml @@ -1,8 +1,8 @@ --- -- name: restart gitea +- name: Restart gitea community.docker.docker_container: name: gitea image: gitea/gitea:latest state: started restart: true - listen: "restart gitea" \ No newline at end of file + listen: "restart gitea" From bab7d34afef1f91f14332a857832e9c62bbc41f0 Mon Sep 17 00:00:00 2001 From: Shawn Treichel Date: Sat, 18 Mar 2023 17:06:49 -0500 Subject: [PATCH 4/7] Update installation.md Fix Ubutu typo --- website/docs/getting-started/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 2a1d7fc718e8c1d38eb0858944fd053208b2b4a0 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sun, 2 Apr 2023 23:24:51 +0100 Subject: [PATCH 5/7] Enable scraping of additional hosts from Prometheus --- roles/stats/defaults/main.yml | 4 ++++ roles/stats/tasks/prometheus.yml | 2 +- .../templates/{prometheus.yml => prometheus.yml.j2} | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) rename roles/stats/templates/{prometheus.yml => prometheus.yml.j2} (84%) diff --git a/roles/stats/defaults/main.yml b/roles/stats/defaults/main.yml index a0bd81f9..a1d0dde1 100644 --- a/roles/stats/defaults/main.yml +++ b/roles/stats/defaults/main.yml @@ -32,3 +32,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 f4a8c062..fa2779be 100644 --- a/roles/stats/tasks/prometheus.yml +++ b/roles/stats/tasks/prometheus.yml @@ -18,7 +18,7 @@ - name: Template Prometheus config 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 %} + From 9cd762d5864c7314bac274e9f5b6d0d22d4c14f4 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sun, 2 Apr 2023 23:31:46 +0100 Subject: [PATCH 6/7] Add Prometheus metrics output to Traefik --- roles/traefik/templates/traefik.toml | 3 +++ 1 file changed, 3 insertions(+) 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] From 791ff3e061be98f356eb40f80344744def3378d3 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sun, 9 Apr 2023 21:16:53 +0100 Subject: [PATCH 7/7] Pi4 support tweaks --- nas.yml | 7 +++++++ requirements.yml | 3 +++ 2 files changed, 10 insertions(+) diff --git a/nas.yml b/nas.yml index b71dcd39..db4d157d 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