diff --git a/roles/borg/tasks/base.yml b/roles/borg/tasks/base.yml index af524b4..58c4356 100644 --- a/roles/borg/tasks/base.yml +++ b/roles/borg/tasks/base.yml @@ -8,5 +8,5 @@ owner: root mode: u=rwx,g=rx,o=rx loop: - - { src: 'backup.j2', dest: 'backup' } + - { src: 'backup', dest: 'backup' } become: true \ No newline at end of file diff --git a/roles/borg/templates/backup.j2 b/roles/borg/templates/backup similarity index 100% rename from roles/borg/templates/backup.j2 rename to roles/borg/templates/backup diff --git a/roles/cloud/tasks/base.yml b/roles/cloud/tasks/base.yml index ccf388b..3bcf8e7 100644 --- a/roles/cloud/tasks/base.yml +++ b/roles/cloud/tasks/base.yml @@ -23,13 +23,12 @@ src: "{{ item.src }}" dest: "cloud/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: cloud_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Update and restart container community.docker.docker_compose_v2: project_src: cloud state: present pull: always - restarted: "{{ cloud_copy_files_results.changed or cloud_copy_templates_results.changed }}" + recreate: "{{ 'always' if cloud_copy_files_results.changed else 'auto' }}" become: true \ No newline at end of file diff --git a/roles/cloud/templates/docker-compose.yml.j2 b/roles/cloud/templates/docker-compose.yml similarity index 99% rename from roles/cloud/templates/docker-compose.yml.j2 rename to roles/cloud/templates/docker-compose.yml index 4b88011..248fe61 100644 --- a/roles/cloud/templates/docker-compose.yml.j2 +++ b/roles/cloud/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: db: image: postgres:14 diff --git a/roles/dolibarr/tasks/base.yml b/roles/dolibarr/tasks/base.yml index 7d5e108..e7093f3 100644 --- a/roles/dolibarr/tasks/base.yml +++ b/roles/dolibarr/tasks/base.yml @@ -11,8 +11,7 @@ src: "{{ item.src }}" dest: "dolibarr/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: dolibarr_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Prepare volume folder ansible.builtin.file: @@ -29,5 +28,4 @@ project_src: dolibarr state: present pull: always - restarted: "{{ dolibarr_copy_templates_results.changed }}" become: true \ No newline at end of file diff --git a/roles/dolibarr/templates/docker-compose.yml.j2 b/roles/dolibarr/templates/docker-compose.yml similarity index 99% rename from roles/dolibarr/templates/docker-compose.yml.j2 rename to roles/dolibarr/templates/docker-compose.yml index 50c4c6d..b789da5 100644 --- a/roles/dolibarr/templates/docker-compose.yml.j2 +++ b/roles/dolibarr/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: mariadb: image: mariadb:latest diff --git a/roles/gitea/tasks/base.yml b/roles/gitea/tasks/base.yml index d131c86..63c138d 100644 --- a/roles/gitea/tasks/base.yml +++ b/roles/gitea/tasks/base.yml @@ -12,12 +12,10 @@ loop: - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - { src: 'config.yml', dest: 'config.yml' } - register: gitea_copy_templates_results - name: Update and restart container community.docker.docker_compose_v2: project_src: gitea state: present pull: always - restarted: "{{ gitea_copy_templates_results.changed }}" become: true \ No newline at end of file diff --git a/roles/gitea/templates/docker-compose.yml b/roles/gitea/templates/docker-compose.yml index aa4212a..0a9e33c 100644 --- a/roles/gitea/templates/docker-compose.yml +++ b/roles/gitea/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3" - services: gitea: image: gitea/gitea:latest @@ -59,4 +57,4 @@ networks: metrics: external: true proxy: - external: true \ No newline at end of file + external: true diff --git a/roles/home_assistant/tasks/base.yml b/roles/home_assistant/tasks/base.yml index bf5f638..7a942c8 100644 --- a/roles/home_assistant/tasks/base.yml +++ b/roles/home_assistant/tasks/base.yml @@ -10,7 +10,7 @@ src: "{{ item.src }}" dest: "home_assistant/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } register: home_assistant_copy_templates_results - name: Update and restart container diff --git a/roles/home_assistant/templates/docker-compose.yml.j2 b/roles/home_assistant/templates/docker-compose.yml similarity index 98% rename from roles/home_assistant/templates/docker-compose.yml.j2 rename to roles/home_assistant/templates/docker-compose.yml index 2377b95..83ae534 100644 --- a/roles/home_assistant/templates/docker-compose.yml.j2 +++ b/roles/home_assistant/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: home_assistant: image: homeassistant/home-assistant diff --git a/roles/iptables/tasks/base.yml b/roles/iptables/tasks/base.yml index 5734c65..1b8748d 100644 --- a/roles/iptables/tasks/base.yml +++ b/roles/iptables/tasks/base.yml @@ -7,7 +7,7 @@ group: root mode: u=rwx,g=rx,o=rx loop: - - { src: 'firewall.j2', dest: '/usr/bin/firewall' } + - { src: 'firewall', dest: '/usr/bin/firewall' } register: iptables_templates_results become: yes diff --git a/roles/iptables/templates/firewall.j2 b/roles/iptables/templates/firewall similarity index 100% rename from roles/iptables/templates/firewall.j2 rename to roles/iptables/templates/firewall diff --git a/roles/matrix/tasks/base.yml b/roles/matrix/tasks/base.yml index 51995c6..b313614 100644 --- a/roles/matrix/tasks/base.yml +++ b/roles/matrix/tasks/base.yml @@ -16,13 +16,12 @@ src: "{{ item.src }}" dest: "matrix/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: matrix_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Update and restart container community.docker.docker_compose_v2: project_src: matrix state: present pull: always - restarted: "{{ matrix_copy_files_results.changed or matrix_copy_templates_results.changed }}" + recreate: "{{ 'always' if matrix_copy_files_results.changed else 'auto' }}" become: true diff --git a/roles/matrix/templates/docker-compose.yml.j2 b/roles/matrix/templates/docker-compose.yml similarity index 99% rename from roles/matrix/templates/docker-compose.yml.j2 rename to roles/matrix/templates/docker-compose.yml index 6afd161..9e6aee5 100644 --- a/roles/matrix/templates/docker-compose.yml.j2 +++ b/roles/matrix/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: postgres: image: postgres:15 diff --git a/roles/metrics/tasks/base.yml b/roles/metrics/tasks/base.yml index c1dd1e4..03ea4bd 100644 --- a/roles/metrics/tasks/base.yml +++ b/roles/metrics/tasks/base.yml @@ -11,12 +11,10 @@ dest: "metrics/{{ item.dest }}" loop: - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - register: metrics_copy_templates_results - name: Update and restart container community.docker.docker_compose_v2: project_src: metrics state: present pull: always - restarted: "{{ metrics_copy_templates_results.changed }}" become: true \ No newline at end of file diff --git a/roles/metrics/templates/docker-compose.yml b/roles/metrics/templates/docker-compose.yml index 36e3515..a970f50 100644 --- a/roles/metrics/templates/docker-compose.yml +++ b/roles/metrics/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: prometheus: image: prom/prometheus:latest diff --git a/roles/n8n/tasks/base.yml b/roles/n8n/tasks/base.yml index 03be16d..19f382b 100644 --- a/roles/n8n/tasks/base.yml +++ b/roles/n8n/tasks/base.yml @@ -10,13 +10,11 @@ src: "{{ item.src }}" dest: "n8n/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: n8n_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Update and restart container community.docker.docker_compose_v2: project_src: n8n state: present pull: always - restarted: "{{ n8n_copy_templates_results.changed }}" become: true diff --git a/roles/n8n/templates/docker-compose.yml.j2 b/roles/n8n/templates/docker-compose.yml similarity index 99% rename from roles/n8n/templates/docker-compose.yml.j2 rename to roles/n8n/templates/docker-compose.yml index 5f9210d..c642816 100644 --- a/roles/n8n/templates/docker-compose.yml.j2 +++ b/roles/n8n/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: db: image: postgres:14 diff --git a/roles/portfolio/tasks/base.yml b/roles/portfolio/tasks/base.yml index 499560e..5fc44ad 100644 --- a/roles/portfolio/tasks/base.yml +++ b/roles/portfolio/tasks/base.yml @@ -11,12 +11,10 @@ dest: "portfolio/{{ item.dest }}" loop: - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - register: portfolio_copy_templates_results - name: Update and restart container community.docker.docker_compose_v2: project_src: portfolio state: present pull: always - restarted: "{{ portfolio_copy_templates_results.changed }}" become: true \ No newline at end of file diff --git a/roles/portfolio/templates/docker-compose.yml b/roles/portfolio/templates/docker-compose.yml index 0b5ba60..c5edac1 100644 --- a/roles/portfolio/templates/docker-compose.yml +++ b/roles/portfolio/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3" - services: portfolio: image: gitea.mrdev023.fr/florian.richer/portfolio:latest diff --git a/roles/protonmail/tasks/base.yml b/roles/protonmail/tasks/base.yml index 10862ad..71eaed4 100644 --- a/roles/protonmail/tasks/base.yml +++ b/roles/protonmail/tasks/base.yml @@ -16,8 +16,7 @@ src: "{{ item.src }}" dest: "protonmail/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: protonmail_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Create protonmail network community.docker.docker_network: @@ -35,5 +34,5 @@ project_src: protonmail state: present pull: always - restarted: "{{ protonmail.initialized and (protonmail_copy_templates_results.changed or protonmail_copy_files_results.changed) }}" + recreate: "{{ 'always' if protonmail.initialized and protonmail_copy_files_results.changed else 'auto' }}" become: true diff --git a/roles/protonmail/templates/docker-compose.yml.j2 b/roles/protonmail/templates/docker-compose.yml similarity index 97% rename from roles/protonmail/templates/docker-compose.yml.j2 rename to roles/protonmail/templates/docker-compose.yml index 044ac67..2e71ccf 100644 --- a/roles/protonmail/templates/docker-compose.yml.j2 +++ b/roles/protonmail/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: protonmail-bridge: image: shenxn/protonmail-bridge diff --git a/roles/ryot/tasks/base.yml b/roles/ryot/tasks/base.yml index e0e99f8..e205649 100644 --- a/roles/ryot/tasks/base.yml +++ b/roles/ryot/tasks/base.yml @@ -10,13 +10,11 @@ src: "{{ item.src }}" dest: "ryot/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: ryot_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Update and restart container community.docker.docker_compose_v2: project_src: ryot state: present pull: always - restarted: "{{ ryot_copy_templates_results.changed }}" become: true diff --git a/roles/ryot/templates/docker-compose.yml.j2 b/roles/ryot/templates/docker-compose.yml similarity index 99% rename from roles/ryot/templates/docker-compose.yml.j2 rename to roles/ryot/templates/docker-compose.yml index 491dece..a696709 100644 --- a/roles/ryot/templates/docker-compose.yml.j2 +++ b/roles/ryot/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.9" - services: postgres: image: postgres:16-alpine diff --git a/roles/ssh/tasks/base.yml b/roles/ssh/tasks/base.yml index 1cabede..f685d94 100644 --- a/roles/ssh/tasks/base.yml +++ b/roles/ssh/tasks/base.yml @@ -7,7 +7,7 @@ group: root mode: u=rwx,g=rx,o=rx loop: - - { src: 'port.conf.j2', dest: '/etc/ssh/sshd_config.d/99-port.conf' } + - { src: 'port.conf', dest: '/etc/ssh/sshd_config.d/99-port.conf' } register: iptables_templates_results become: yes diff --git a/roles/ssh/templates/port.conf.j2 b/roles/ssh/templates/port.conf similarity index 100% rename from roles/ssh/templates/port.conf.j2 rename to roles/ssh/templates/port.conf diff --git a/roles/traefik/tasks/base.yml b/roles/traefik/tasks/base.yml index c28460a..b5ff1e4 100644 --- a/roles/traefik/tasks/base.yml +++ b/roles/traefik/tasks/base.yml @@ -12,7 +12,6 @@ loop: - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - { src: 'config/traefik.yml', dest: 'config/traefik.yml' } - register: traefik_copy_templates_results # Avoid restart docker if dynamic_conf updated - name: Copy dynamic_conf conf @@ -25,5 +24,4 @@ project_src: traefik state: present pull: always - restarted: "{{ traefik_copy_templates_results.changed }}" become: true \ No newline at end of file diff --git a/roles/traefik/templates/docker-compose.yml b/roles/traefik/templates/docker-compose.yml index 13a3f84..66bec1c 100644 --- a/roles/traefik/templates/docker-compose.yml +++ b/roles/traefik/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: traefik: image: traefik:latest diff --git a/roles/vaultwarden/tasks/base.yml b/roles/vaultwarden/tasks/base.yml index f918f0b..2b5d9e4 100644 --- a/roles/vaultwarden/tasks/base.yml +++ b/roles/vaultwarden/tasks/base.yml @@ -11,14 +11,13 @@ src: "{{ item.src }}" dest: "vaultwarden/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: vaultwarden_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Copy dotenv as root ansible.builtin.template: owner: root group: root - src: ".env.j2" + src: ".env" dest: "vaultwarden/.env" mode: 0600 become: true @@ -38,5 +37,4 @@ project_src: vaultwarden state: present pull: always - restarted: "{{ vaultwarden_copy_templates_results.changed }}" become: true \ No newline at end of file diff --git a/roles/vaultwarden/templates/.env.j2 b/roles/vaultwarden/templates/.env similarity index 100% rename from roles/vaultwarden/templates/.env.j2 rename to roles/vaultwarden/templates/.env diff --git a/roles/vaultwarden/templates/docker-compose.yml.j2 b/roles/vaultwarden/templates/docker-compose.yml similarity index 99% rename from roles/vaultwarden/templates/docker-compose.yml.j2 rename to roles/vaultwarden/templates/docker-compose.yml index 78408ed..ca23407 100644 --- a/roles/vaultwarden/templates/docker-compose.yml.j2 +++ b/roles/vaultwarden/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: db: image: postgres:15 diff --git a/roles/watchtower/tasks/base.yml b/roles/watchtower/tasks/base.yml index d893562..ead9f46 100644 --- a/roles/watchtower/tasks/base.yml +++ b/roles/watchtower/tasks/base.yml @@ -10,13 +10,11 @@ src: "{{ item.src }}" dest: "watchtower/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: watchtower_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Force update and restart container community.docker.docker_compose_v2: project_src: watchtower state: present pull: always - restarted: "{{ watchtower_copy_templates_results.changed }}" become: true diff --git a/roles/watchtower/templates/docker-compose.yml.j2 b/roles/watchtower/templates/docker-compose.yml similarity index 97% rename from roles/watchtower/templates/docker-compose.yml.j2 rename to roles/watchtower/templates/docker-compose.yml index 41fcbb5..9e340fd 100644 --- a/roles/watchtower/templates/docker-compose.yml.j2 +++ b/roles/watchtower/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: watchtower: image: containrrr/watchtower:latest diff --git a/roles/whoami/tasks/base.yml b/roles/whoami/tasks/base.yml index 7ee00b2..9ffa67c 100644 --- a/roles/whoami/tasks/base.yml +++ b/roles/whoami/tasks/base.yml @@ -10,13 +10,11 @@ src: "{{ item.src }}" dest: "whoami/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: whoami_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Force update and restart container community.docker.docker_compose_v2: project_src: whoami state: present pull: always - restarted: "{{ whoami_copy_templates_results.changed }}" become: true diff --git a/roles/whoami/templates/docker-compose.yml.j2 b/roles/whoami/templates/docker-compose.yml similarity index 98% rename from roles/whoami/templates/docker-compose.yml.j2 rename to roles/whoami/templates/docker-compose.yml index 9095d12..7a0dbc9 100644 --- a/roles/whoami/templates/docker-compose.yml.j2 +++ b/roles/whoami/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: whoami: image: "containous/whoami" diff --git a/roles/wireguard/tasks/base.yml b/roles/wireguard/tasks/base.yml index 00874f1..0d82922 100644 --- a/roles/wireguard/tasks/base.yml +++ b/roles/wireguard/tasks/base.yml @@ -10,13 +10,11 @@ src: "{{ item.src }}" dest: "wireguard/{{ item.dest }}" loop: - - { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' } - register: wireguard_copy_templates_results + - { src: 'docker-compose.yml', dest: 'docker-compose.yml' } - name: Update and restart container community.docker.docker_compose_v2: project_src: wireguard state: present pull: always - restarted: "{{ wireguard_copy_templates_results.changed }}" become: true diff --git a/roles/wireguard/templates/docker-compose.yml.j2 b/roles/wireguard/templates/docker-compose.yml similarity index 99% rename from roles/wireguard/templates/docker-compose.yml.j2 rename to roles/wireguard/templates/docker-compose.yml index 21d3724..94d3f4d 100644 --- a/roles/wireguard/templates/docker-compose.yml.j2 +++ b/roles/wireguard/templates/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: wireguard: image: lscr.io/linuxserver/wireguard:latest