summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/docker/tasks/lvm.yml18
-rw-r--r--roles/docker/tasks/main.yml20
2 files changed, 19 insertions, 19 deletions
diff --git a/roles/docker/tasks/lvm.yml b/roles/docker/tasks/lvm.yml
new file mode 100644
index 00000000..34cbab0f
--- /dev/null
+++ b/roles/docker/tasks/lvm.yml
@@ -0,0 +1,18 @@
+---
+- 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/tasks/main.yml b/roles/docker/tasks/main.yml
index 8da13f77..5e66bb1a 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -16,25 +16,7 @@
- name: prepare /var/lib/docker as LVM
when: docker_lvm is defined
- block:
-
- - 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
+ import_tasks: lvm.yml
- name: prepare package provider
when: docker_pkg_provider != 'distro'