From 36aafc022a4e3a20ef046b1c32206a40a09fe6a5 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 21 Dec 2023 22:40:42 +0100 Subject: [PATCH] Add tasks to configure data-root of docker --- roles/docker/tasks/config.yml | 10 ++++++++++ roles/docker/tasks/main.yml | 4 +++- roles/docker/templates/daemon.json | 1 - 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 roles/docker/tasks/config.yml diff --git a/roles/docker/tasks/config.yml b/roles/docker/tasks/config.yml new file mode 100644 index 0000000..7088c3a --- /dev/null +++ b/roles/docker/tasks/config.yml @@ -0,0 +1,10 @@ +--- + +- name: Copy template conf + ansible.builtin.template: + src: "daemon.json" + dest: "/etc/docker/daemon.json" + group: root + owner: root + mode: '0600' + become: true diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 46e5ce0..e3db400 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -1,6 +1,8 @@ --- -# TODO : Copy template into /etc/docker/daemon.json +- ansible.builtin.import_tasks: config.yml + name: config + become: true - name: set mydistribution ansible.builtin.set_fact: diff --git a/roles/docker/templates/daemon.json b/roles/docker/templates/daemon.json index 432de14..3f2fedd 100644 --- a/roles/docker/templates/daemon.json +++ b/roles/docker/templates/daemon.json @@ -1,4 +1,3 @@ { "data-root": "{{ server.work_dir }}/docker" } -