From 4688af8ab051b7ff0ad478e3bea101890703e989 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 6 Nov 2017 19:12:36 +0100 Subject: 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 --- roles/docker/tasks/main.yml | 9 +++++++++ roles/docker/tasks/systemcontainer_crio.yml | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'roles/docker') 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" -- cgit v1.2.3