From b41cd70e60d135d7d6b734746cecdd4ddf4c6d38 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 4 Apr 2021 16:28:25 +0200 Subject: port docker/engine to new storage volume roles --- roles/docker/engine/tasks/lvm.yml | 18 ------------------ roles/docker/engine/tasks/main.yml | 13 ++++++------- roles/docker/engine/tasks/zfs.yml | 14 -------------- 3 files changed, 6 insertions(+), 39 deletions(-) delete mode 100644 roles/docker/engine/tasks/lvm.yml delete mode 100644 roles/docker/engine/tasks/zfs.yml (limited to 'roles/docker/engine') diff --git a/roles/docker/engine/tasks/lvm.yml b/roles/docker/engine/tasks/lvm.yml deleted file mode 100644 index 34cbab0f..00000000 --- a/roles/docker/engine/tasks/lvm.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: create logical volume - lvol: - vg: "{{ docker_lvm.vg }}" - lv: "{{ docker_lvm.lv }}" - size: "{{ docker_lvm.size }}" - -- name: create filesystem - filesystem: - fstype: "{{ docker_lvm.fs }}" - dev: "/dev/mapper/{{ docker_lvm.vg | replace('-', '--') }}-{{ docker_lvm.lv | replace('-', '--') }}" - -- name: mount filesytem - mount: - src: "/dev/mapper/{{ docker_lvm.vg | replace('-', '--') }}-{{ docker_lvm.lv | replace('-', '--') }}" - path: /var/lib/docker - fstype: "{{ docker_lvm.fs }}" - state: mounted diff --git a/roles/docker/engine/tasks/main.yml b/roles/docker/engine/tasks/main.yml index 6c07797e..7bfd3eeb 100644 --- a/roles/docker/engine/tasks/main.yml +++ b/roles/docker/engine/tasks/main.yml @@ -14,13 +14,12 @@ dest: /etc/docker/daemon.json notify: restart docker -- name: prepare /var/lib/docker as LVM - when: docker_lvm is defined - import_tasks: lvm.yml - -- name: prepare /var/lib/docker as ZFS dataset - when: docker_zfs is defined - import_tasks: zfs.yml +- name: prepare storage volume for /var/lib/docker + when: docker_storage is defined + vars: + storage_volume: "{{ docker_storage | combine({'dest': '/var/lib/docker'})}}" + include_role: + name: "storage/{{ docker_storage.type }}/volume" - name: prepare package provider when: docker_pkg_provider != 'distro' diff --git a/roles/docker/engine/tasks/zfs.yml b/roles/docker/engine/tasks/zfs.yml deleted file mode 100644 index e8289c7d..00000000 --- a/roles/docker/engine/tasks/zfs.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: create zfs dataset - zfs: - name: "{{ docker_zfs.pool }}/{{ docker_zfs.name }}" - state: present - extra_zfs_properties: "{{ docker_zfs.properties | default(omit) }}" - -- name: bind mount filesytem - mount: - src: "{{ zfs_pools[docker_zfs.pool].mountpoint }}/{{ docker_zfs.name }}" - path: /var/lib/docker - fstype: none - opts: bind,x-systemd.automount,nofail - state: mounted -- cgit v1.2.3