summaryrefslogtreecommitdiffstats
path: root/roles/container_runtime
diff options
context:
space:
mode:
Diffstat (limited to 'roles/container_runtime')
-rw-r--r--roles/container_runtime/defaults/main.yml13
-rw-r--r--roles/container_runtime/tasks/docker_upgrade_check.yml20
-rw-r--r--roles/container_runtime/tasks/systemcontainer_crio.yml2
3 files changed, 27 insertions, 8 deletions
diff --git a/roles/container_runtime/defaults/main.yml b/roles/container_runtime/defaults/main.yml
index 7397e2bec..77cf86b0a 100644
--- a/roles/container_runtime/defaults/main.yml
+++ b/roles/container_runtime/defaults/main.yml
@@ -87,6 +87,8 @@ openshift_use_crio_only: False
l_openshift_image_tag_default: "{{ openshift_release | default('latest') }}"
l_openshift_image_tag: "{{ openshift_image_tag | default(l_openshift_image_tag_default) | string}}"
+l_required_docker_version: '1.12'
+
# --------------------- #
# systemcontainers_crio #
# --------------------- #
@@ -94,6 +96,17 @@ l_insecure_crio_registries: "{{ '\"{}\"'.format('\", \"'.join(l2_docker_insecure
l_crio_registries: "{{ l2_docker_additional_registries + ['docker.io'] }}"
l_additional_crio_registries: "{{ '\"{}\"'.format('\", \"'.join(l_crio_registries)) }}"
+# this is a list of dictionaries of mounts
+# container_runtime_crio_additional_mounts:
+# - destination: /test
+# source: /var/test
+# options:
+# - rw
+# - mode=755
+# type: bind
+container_runtime_crio_additional_mounts: []
+
+l_crio_additional_mounts: "{{ ',' + (container_runtime_crio_additional_mounts | lib_utils_oo_l_of_d_to_csv) if container_runtime_crio_additional_mounts != [] else '' }}"
openshift_crio_image_tag_default: "latest"
diff --git a/roles/container_runtime/tasks/docker_upgrade_check.yml b/roles/container_runtime/tasks/docker_upgrade_check.yml
index 8dd916e79..4a341b744 100644
--- a/roles/container_runtime/tasks/docker_upgrade_check.yml
+++ b/roles/container_runtime/tasks/docker_upgrade_check.yml
@@ -36,14 +36,16 @@
failed_when: false
changed_when: false
-- fail:
- msg: This playbook requires access to Docker 1.12 or later
+- name: Required docker version not available (non-atomic)
+ fail:
+ msg: "This playbook requires access to Docker {{ l_required_docker_version }} or later"
# Disable the 1.12 requirement if the user set a specific Docker version
when:
- not openshift_is_atomic | bool
- docker_version is not defined
- - docker_upgrade is not defined or docker_upgrade | bool == True
- - (pkg_check.rc == 0 and (avail_docker_version.stdout == "" or avail_docker_version.stdout is version_compare('1.12','<')))
+ - docker_upgrade | bool
+ - pkg_check.rc == 0
+ - avail_docker_version.stdout == "" or avail_docker_version.stdout is version_compare(l_required_docker_version,'<')
# Default l_docker_upgrade to False, we'll set to True if an upgrade is required:
- set_fact:
@@ -54,7 +56,8 @@
docker_version: "{{ avail_docker_version.stdout }}"
when:
- not openshift_is_atomic | bool
- - pkg_check.rc == 0 and docker_version is not defined
+ - pkg_check.rc == 0
+ - docker_version is not defined
- name: Flag for Docker upgrade if necessary
set_fact:
@@ -74,8 +77,9 @@
l_docker_version: "{{ g_atomic_docker_version_result.stdout | from_yaml }}"
when: openshift_is_atomic | bool
-- fail:
- msg: This playbook requires access to Docker 1.12 or later
+- name: Required docker version is unavailable (atomic)
+ fail:
+ msg: "This playbook requires access to Docker {{ l_required_docker_version }} or later"
when:
- openshift_is_atomic | bool
- - l_docker_version.avail_version | default(l_docker_version.curr_version, true) is version_compare('1.12','<')
+ - l_docker_version.avail_version | default(l_docker_version.curr_version, true) is version_compare(l_required_docker_version,'<')
diff --git a/roles/container_runtime/tasks/systemcontainer_crio.yml b/roles/container_runtime/tasks/systemcontainer_crio.yml
index d588f2618..f053bdea5 100644
--- a/roles/container_runtime/tasks/systemcontainer_crio.yml
+++ b/roles/container_runtime/tasks/systemcontainer_crio.yml
@@ -53,6 +53,8 @@
name: "cri-o"
image: "{{ l_crio_image }}"
state: latest
+ values:
+ - "ADDTL_MOUNTS={{ l_crio_additional_mounts }}"
- name: Remove CRI-O default configuration files
file: