summaryrefslogtreecommitdiff
path: root/roles/docker/engine
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-04 16:28:25 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-04 16:28:25 +0200
commitb41cd70e60d135d7d6b734746cecdd4ddf4c6d38 (patch)
treed1ab9492227d0d5a34978e867fe7216a75640e26 /roles/docker/engine
parentport kubernetes/base to new storage volume roles (diff)
port docker/engine to new storage volume roles
Diffstat (limited to 'roles/docker/engine')
-rw-r--r--roles/docker/engine/tasks/lvm.yml18
-rw-r--r--roles/docker/engine/tasks/main.yml13
-rw-r--r--roles/docker/engine/tasks/zfs.yml14
3 files changed, 6 insertions, 39 deletions
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