From d3bc1a89bb0322514199077d9cdf08e233a46a73 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 21 Dec 2023 22:20:10 +0100 Subject: [PATCH] Move docker root --- roles/borg/templates/backup.j2 | 2 +- roles/docker/tasks/main.yml | 5 ++++- roles/docker/templates/daemon.json | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 roles/docker/templates/daemon.json diff --git a/roles/borg/templates/backup.j2 b/roles/borg/templates/backup.j2 index 668f9c9..1930072 100644 --- a/roles/borg/templates/backup.j2 +++ b/roles/borg/templates/backup.j2 @@ -1,2 +1,2 @@ #!/bin/sh -cd {{ server.work_dir }} && borg create --stats -C zstd,22 --progress "{{ server.backup_dir }}::$(date --iso-8601=seconds)" . \ No newline at end of file +cd {{ server.work_dir }} && borg create --stats -C zstd,22 --progress "{{ server.backup_dir }}::$(date --iso-8601=seconds)" . --exclude "{{ server.work_dir }}/docker" diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index d56ab0d..46e5ce0 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -1,4 +1,7 @@ --- + +# TODO : Copy template into /etc/docker/daemon.json + - name: set mydistribution ansible.builtin.set_fact: mydistribution: "{{ ansible_distribution | lower }}" @@ -36,4 +39,4 @@ community.docker.docker_network: name: metrics state: present - become: true \ No newline at end of file + become: true diff --git a/roles/docker/templates/daemon.json b/roles/docker/templates/daemon.json new file mode 100644 index 0000000..432de14 --- /dev/null +++ b/roles/docker/templates/daemon.json @@ -0,0 +1,4 @@ +{ + "data-root": "{{ server.work_dir }}/docker" +} +