Browse Source

Removing dependency on the extra stroage device.

Kenny Woodson 7 years ago
parent
commit
bf443f65b0

+ 1 - 1
roles/container_runtime/defaults/main.yml

@@ -64,7 +64,7 @@ docker_storage_setup_options:
   root_lv_mount_path: "{{ docker_storage_path }}"
 docker_storage_extra_options:
 - "--storage-opt overlay2.override_kernel_check=true"
-- "--storage-opt overlay2.size={{ docker_storage_size }}"
+- "{{ '--storage-opt overlay2.size=' ~ docker_storage_size if container_runtime_docker_storage_setup_device is defined and container_runtime_docker_storage_setup_device != '' else '' }}"
 - "--graph={{ docker_storage_path}}"
 
 

+ 4 - 0
roles/container_runtime/templates/docker_storage_setup.j2

@@ -2,6 +2,7 @@
 # /usr/lib/docker-storage-setup/docker-storage-setup.
 #
 # For more details refer to "man docker-storage-setup"
+{% if container_runtime_docker_storage_setup_device is defined and container_runtime_docker_storage_setup_device != '' %}
 DEVS={{ container_runtime_docker_storage_setup_device }}
 VG={{ docker_storage_setup_options.vg }}
 DATA_SIZE={{ docker_storage_setup_options.data_size }}
@@ -9,4 +10,7 @@ STORAGE_DRIVER="{{ docker_storage_setup_options.storage_driver }}"
 CONTAINER_ROOT_LV_NAME="{{ docker_storage_setup_options.root_lv_name }}"
 CONTAINER_ROOT_LV_SIZE="{{ docker_storage_setup_options.root_lv_size }}"
 CONTAINER_ROOT_LV_MOUNT_PATH="{{ docker_storage_setup_options.root_lv_mount_path }}"
+{% else %}
+STORAGE_DRIVER="{{ docker_storage_setup_options.storage_driver }}"
+{% endif %}
 EXTRA_STORAGE_OPTIONS="{{ docker_storage_extra_options | join(' ') }}"