summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorEduardo Mínguez <edu@redhat.com>2017-10-04 03:31:56 +0200
committerRyan Cook <rcook@redhat.com>2017-10-03 21:31:56 -0400
commitc969394a52c311f1ff5cc2fc669276bc8e2b4e4b (patch)
tree2d2731381aae8334f3a2f80fcc602e138346df8b /roles
parentb1c98274f883a5b98ca82b6f3a4829417352eac9 (diff)
downloadopenshift-c969394a52c311f1ff5cc2fc669276bc8e2b4e4b.tar.gz
openshift-c969394a52c311f1ff5cc2fc669276bc8e2b4e4b.tar.bz2
openshift-c969394a52c311f1ff5cc2fc669276bc8e2b4e4b.tar.xz
openshift-c969394a52c311f1ff5cc2fc669276bc8e2b4e4b.zip
Required variables to create dedicated lv (#766)
* Required variables to create dedicated lv https://bugzilla.redhat.com/show_bug.cgi?id=1490910#c11 * Fixed lint and added distribution to checks
Diffstat (limited to 'roles')
-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 }}"