diff --git a/ansible/host_vars/intersect.yml b/ansible/host_vars/intersect.yml index e6b78d2..acaf580 100644 --- a/ansible/host_vars/intersect.yml +++ b/ansible/host_vars/intersect.yml @@ -1,3 +1,5 @@ expose_ssh: true traefik_influx_db_dir: /mnt/tank/dbs/influx/traefik + +docker_zfs_override: true diff --git a/ansible/host_vars/walker.yml b/ansible/host_vars/walker.yml new file mode 100644 index 0000000..e960475 --- /dev/null +++ b/ansible/host_vars/walker.yml @@ -0,0 +1 @@ +docker_zfs_override: true diff --git a/ansible/roles/docker_cleanup/defaults/main.yml b/ansible/roles/docker_cleanup/defaults/main.yml new file mode 100644 index 0000000..acf631b --- /dev/null +++ b/ansible/roles/docker_cleanup/defaults/main.yml @@ -0,0 +1 @@ +docker_zfs_override: false diff --git a/ansible/roles/docker_cleanup/files/zfs-override.conf b/ansible/roles/docker_cleanup/files/zfs-override.conf new file mode 100644 index 0000000..19d01b6 --- /dev/null +++ b/ansible/roles/docker_cleanup/files/zfs-override.conf @@ -0,0 +1,3 @@ +[Unit] +Requires=zfs.target +After=zfs.target diff --git a/ansible/roles/docker_cleanup/tasks/main.yml b/ansible/roles/docker_cleanup/tasks/main.yml index d84b8c3..6153783 100644 --- a/ansible/roles/docker_cleanup/tasks/main.yml +++ b/ansible/roles/docker_cleanup/tasks/main.yml @@ -44,3 +44,7 @@ dest: "{{ home }}" mode: 0755 directory_mode: 0755 + +- name: override docker service for zfs dependencies + include: zfs-override.yml + when: docker_zfs_override diff --git a/ansible/roles/docker_cleanup/tasks/zfs-override.yml b/ansible/roles/docker_cleanup/tasks/zfs-override.yml new file mode 100644 index 0000000..6921838 --- /dev/null +++ b/ansible/roles/docker_cleanup/tasks/zfs-override.yml @@ -0,0 +1,15 @@ +- name: Create dir for docker service ZFS override + file: + path: /etc/systemd/system/docker.service.d + state: directory + mode: "0755" + become: true + +- name: Create override.conf + copy: + src: files/zfs-override.conf + dest: /etc/systemd/system/docker.service.d/zfs-override.conf + owner: root + group: root + mode: "0644" + become: true