summaryrefslogtreecommitdiffstats
path: root/roles/docker/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/docker/tasks')
-rw-r--r--roles/docker/tasks/main.yml8
-rw-r--r--roles/docker/tasks/package_docker.yml28
-rw-r--r--roles/docker/tasks/systemcontainer_crio.yml21
-rw-r--r--roles/docker/tasks/systemcontainer_docker.yml19
4 files changed, 50 insertions, 26 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index dae17c3ce..f73f90686 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -10,14 +10,6 @@
l_use_crio: "{{ openshift_use_crio | default(False) }}"
l_use_crio_only: "{{ openshift_use_crio_only | default(False) }}"
-- when:
- - openshift_deployment_type == 'openshift-enterprise'
- assert:
- that:
- - "openshift_image_tag is defined"
- msg: >
- openshift_image_tag is a required inventory variable when installing openshift-enterprise
-
- name: Use Package Docker if Requested
include: package_docker.yml
when:
diff --git a/roles/docker/tasks/package_docker.yml b/roles/docker/tasks/package_docker.yml
index a35335937..dbe0b0d28 100644
--- a/roles/docker/tasks/package_docker.yml
+++ b/roles/docker/tasks/package_docker.yml
@@ -48,7 +48,9 @@
template:
dest: "{{ docker_systemd_dir }}/custom.conf"
src: custom.conf.j2
- when: not os_firewall_use_firewalld | default(False) | bool
+ notify:
+ - restart docker
+ when: not (os_firewall_use_firewalld | default(False)) | bool
- name: Add enterprise registry, if necessary
set_fact:
@@ -137,18 +139,6 @@
notify:
- restart docker
-- name: Check for credentials file for registry auth
- stat:
- path: "{{ docker_cli_auth_config_path }}/config.json"
- when: oreg_auth_user is defined
- register: docker_cli_auth_credentials_stat
-
-- name: Create credentials for docker cli registry auth
- command: "docker --config={{ docker_cli_auth_config_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}"
- when:
- - oreg_auth_user is defined
- - (not docker_cli_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
-
- name: Start the Docker service
systemd:
name: docker
@@ -163,4 +153,16 @@
- set_fact:
docker_service_status_changed: "{{ r_docker_package_docker_start_result | changed }}"
+- name: Check for credentials file for registry auth
+ stat:
+ path: "{{ docker_cli_auth_config_path }}/config.json"
+ when: oreg_auth_user is defined
+ register: docker_cli_auth_credentials_stat
+
+- name: Create credentials for docker cli registry auth
+ command: "docker --config={{ docker_cli_auth_config_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}"
+ when:
+ - oreg_auth_user is defined
+ - (not docker_cli_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
+
- meta: flush_handlers
diff --git a/roles/docker/tasks/systemcontainer_crio.yml b/roles/docker/tasks/systemcontainer_crio.yml
index 386369d26..fdc6cd24a 100644
--- a/roles/docker/tasks/systemcontainer_crio.yml
+++ b/roles/docker/tasks/systemcontainer_crio.yml
@@ -14,6 +14,22 @@
l_additional_crio_registries: "{{ '\"{}\"'.format('\", \"'.join(l_crio_registries)) }}"
when: l2_docker_additional_registries
+- set_fact:
+ l_openshift_image_tag: "{{ openshift_image_tag | string }}"
+ when: openshift_image_tag is defined
+
+- set_fact:
+ l_openshift_image_tag: "latest"
+ when:
+ - openshift_image_tag is not defined
+ - openshift_release == "latest"
+
+- set_fact:
+ l_openshift_image_tag: "{{ openshift_release | string }}"
+ when:
+ - openshift_image_tag is not defined
+ - openshift_release != "latest"
+
- name: Ensure container-selinux is installed
package:
name: container-selinux
@@ -106,10 +122,9 @@
- name: Set CRI-O image tag
set_fact:
- l_crio_image_tag: "{{ openshift_image_tag }}"
+ l_crio_image_tag: "{{ l_openshift_image_tag }}"
when:
- openshift_deployment_type == 'openshift-enterprise'
- - openshift_image_tag is defined
- name: Use RHEL based image when distribution is Red Hat
set_fact:
@@ -147,7 +162,7 @@
image: "{{ l_crio_image }}"
state: latest
-- name: Remove CRI-o default configuration files
+- name: Remove CRI-O default configuration files
file:
path: "{{ item }}"
state: absent
diff --git a/roles/docker/tasks/systemcontainer_docker.yml b/roles/docker/tasks/systemcontainer_docker.yml
index 5b1605b58..15c6a55db 100644
--- a/roles/docker/tasks/systemcontainer_docker.yml
+++ b/roles/docker/tasks/systemcontainer_docker.yml
@@ -1,5 +1,21 @@
---
+- set_fact:
+ l_openshift_image_tag: "{{ openshift_image_tag | string }}"
+ when: openshift_image_tag is defined
+
+- set_fact:
+ l_openshift_image_tag: "latest"
+ when:
+ - openshift_image_tag is not defined
+ - openshift_release == "latest"
+
+- set_fact:
+ l_openshift_image_tag: "{{ openshift_release | string }}"
+ when:
+ - openshift_image_tag is not defined
+ - openshift_release != "latest"
+
# If docker_options are provided we should fail. We should not install docker and ignore
# the users configuration. NOTE: docker_options == inventory:openshift_docker_options
- name: Fail quickly if openshift_docker_options are set
@@ -94,10 +110,9 @@
- name: Set container engine image tag
set_fact:
- l_docker_image_tag: "{{ openshift_image_tag }}"
+ l_docker_image_tag: "{{ l_openshift_image_tag }}"
when:
- openshift_deployment_type == 'openshift-enterprise'
- - openshift_image_tag is defined
- name: Use Red Hat Registry for image when distribution is Red Hat
set_fact: