summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roles/docker-storage-setup/defaults/main.yaml2
-rw-r--r--roles/docker-storage-setup/tasks/main.yaml35
-rw-r--r--roles/docker-storage-setup/templates/docker-storage-setup-dm.j2 (renamed from roles/docker-storage-setup/templates/docker-storage-setup.j2)0
-rw-r--r--roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j26
4 files changed, 36 insertions, 7 deletions
diff --git a/roles/docker-storage-setup/defaults/main.yaml b/roles/docker-storage-setup/defaults/main.yaml
index e36f1b85a..062f543ad 100644
--- a/roles/docker-storage-setup/defaults/main.yaml
+++ b/roles/docker-storage-setup/defaults/main.yaml
@@ -3,3 +3,5 @@ docker_dev: "/dev/sdb"
docker_vg: "docker-vol"
docker_data_size: "95%VG"
docker_dm_basesize: "3G"
+container_root_lv_name: "dockerlv"
+container_root_lv_mount_path: "/var/lib/docker"
diff --git a/roles/docker-storage-setup/tasks/main.yaml b/roles/docker-storage-setup/tasks/main.yaml
index 7202bc46b..209062ca7 100644
--- a/roles/docker-storage-setup/tasks/main.yaml
+++ b/roles/docker-storage-setup/tasks/main.yaml
@@ -1,8 +1,29 @@
---
-- name: create the docker-storage-setup config file
- template:
- src: "{{ role_path }}/templates/docker-storage-setup.j2"
- dest: /etc/sysconfig/docker-storage-setup
- owner: root
- group: root
- mode: 0644
+- block:
+ - name: create the docker-storage config file
+ template:
+ src: "{{ role_path }}/templates/docker-storage-setup-overlayfs.j2"
+ dest: /etc/sysconfig/docker-storage-setup
+ owner: root
+ group: root
+ mode: 0644
+
+ when:
+ - ansible_distribution_version | version_compare('7.4', '>=')
+ - ansible_distribution == "RedHat"
+
+- block:
+ - name: create the docker-storage-setup config file
+ template:
+ src: "{{ role_path }}/templates/docker-storage-setup-dm.j2"
+ dest: /etc/sysconfig/docker-storage-setup
+ owner: root
+ group: root
+ mode: 0644
+
+ when:
+ - ansible_distribution_version | version_compare('7.4', '<')
+ - ansible_distribution == "RedHat"
+
+- name: start docker
+ service: name=docker state=started enabled=true
diff --git a/roles/docker-storage-setup/templates/docker-storage-setup.j2 b/roles/docker-storage-setup/templates/docker-storage-setup-dm.j2
index b5869feff..b5869feff 100644
--- a/roles/docker-storage-setup/templates/docker-storage-setup.j2
+++ b/roles/docker-storage-setup/templates/docker-storage-setup-dm.j2
diff --git a/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2 b/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2
new file mode 100644
index 000000000..4bef865c8
--- /dev/null
+++ b/roles/docker-storage-setup/templates/docker-storage-setup-overlayfs.j2
@@ -0,0 +1,6 @@
+DEVS="{{ docker_dev }}"
+VG="{{ docker_vg }}"
+DATA_SIZE="{{ docker_data_size }}"
+STORAGE_DRIVER=overlay2
+CONTAINER_ROOT_LV_NAME="{{ container_root_lv_name }}"
+CONTAINER_ROOT_LV_MOUNT_PATH="{{ container_root_lv_mount_path }}"