1
0
Fork 0

Begin migration to v2 Step 2

This commit is contained in:
Florian RICHER 2024-07-14 22:16:35 +02:00
parent b91292576f
commit a7140e5a84
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
37 changed files with 19 additions and 74 deletions

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
db:
image: postgres:14

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
mariadb:
image: mariadb:latest

View file

@ -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

View file

@ -1,5 +1,3 @@
version: "3"
services:
gitea:
image: gitea/gitea:latest
@ -59,4 +57,4 @@ networks:
metrics:
external: true
proxy:
external: true
external: true

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
home_assistant:
image: homeassistant/home-assistant

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
postgres:
image: postgres:15

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
prometheus:
image: prom/prometheus:latest

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
db:
image: postgres:14

View file

@ -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

View file

@ -1,5 +1,3 @@
version: "3"
services:
portfolio:
image: gitea.mrdev023.fr/florian.richer/portfolio:latest

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
protonmail-bridge:
image: shenxn/protonmail-bridge

View file

@ -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

View file

@ -1,5 +1,3 @@
version: "3.9"
services:
postgres:
image: postgres:16-alpine

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
traefik:
image: traefik:latest

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
db:
image: postgres:15

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
watchtower:
image: containrrr/watchtower:latest

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
whoami:
image: "containous/whoami"

View file

@ -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

View file

@ -1,5 +1,3 @@
version: '3'
services:
wireguard:
image: lscr.io/linuxserver/wireguard:latest