summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2017-11-06 19:12:36 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2017-11-06 20:09:48 +0100
commit4688af8ab051b7ff0ad478e3bea101890703e989 (patch)
treea9926b39979ee0e4b6c42bbba27796048fd0a9f5
parentd3301fb655988df1f8fb0b9dcf450396690ed951 (diff)
downloadopenshift-4688af8ab051b7ff0ad478e3bea101890703e989.tar.gz
openshift-4688af8ab051b7ff0ad478e3bea101890703e989.tar.bz2
openshift-4688af8ab051b7ff0ad478e3bea101890703e989.tar.xz
openshift-4688af8ab051b7ff0ad478e3bea101890703e989.zip
container-engine: ensure /var/lib/containers/ is properly labelled
we were doing it only when CRI-O is installed. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1509880 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--roles/docker/tasks/main.yml9
-rw-r--r--roles/docker/tasks/systemcontainer_crio.yml4
2 files changed, 9 insertions, 4 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 1539af53f..71e1b2ce2 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -25,6 +25,15 @@
- not l_use_system_container
- not l_use_crio_only
+- name: Ensure /var/lib/containers exists
+ file:
+ path: /var/lib/containers
+ state: directory
+
+- name: Fix SELinux Permissions on /var/lib/containers
+ command: "restorecon -R /var/lib/containers/"
+ changed_when: false
+
- name: Use System Container Docker if Requested
include: systemcontainer_docker.yml
when:
diff --git a/roles/docker/tasks/systemcontainer_crio.yml b/roles/docker/tasks/systemcontainer_crio.yml
index 67ede0d21..1e2d64293 100644
--- a/roles/docker/tasks/systemcontainer_crio.yml
+++ b/roles/docker/tasks/systemcontainer_crio.yml
@@ -170,10 +170,6 @@
dest: /etc/cni/net.d/openshift-sdn.conf
src: 80-openshift-sdn.conf.j2
-- name: Fix SELinux Permissions on /var/lib/containers
- command: "restorecon -R /var/lib/containers/"
- changed_when: false
-
- name: Start the CRI-O service
systemd:
name: "cri-o"