summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2016-12-14 13:30:34 -0500
committerRussell Teague <rteague@redhat.com>2017-01-24 10:43:17 -0500
commit4397b6e3dbfbc6bed8f7b653ba1b6093dbe51f5c (patch)
tree8b3f5c3ae93deb195412aa2ea50124947e464328
parent77656036572baa6abfefd7d467f25033d1fb81b0 (diff)
downloadopenshift-4397b6e3dbfbc6bed8f7b653ba1b6093dbe51f5c.tar.gz
openshift-4397b6e3dbfbc6bed8f7b653ba1b6093dbe51f5c.tar.bz2
openshift-4397b6e3dbfbc6bed8f7b653ba1b6093dbe51f5c.tar.xz
openshift-4397b6e3dbfbc6bed8f7b653ba1b6093dbe51f5c.zip
Add new option 'openshift_docker_selinux_enabled'
Allows controlling 'selinux-enabled' docker options Can be set to true or false
-rw-r--r--playbooks/common/openshift-cluster/config.yml3
-rw-r--r--roles/docker/tasks/main.yml2
-rw-r--r--roles/openshift_docker_facts/tasks/main.yml2
3 files changed, 6 insertions, 1 deletions
diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml
index 0f226f5f9..a95cb68b7 100644
--- a/playbooks/common/openshift-cluster/config.yml
+++ b/playbooks/common/openshift-cluster/config.yml
@@ -38,6 +38,9 @@
- set_fact:
openshift_docker_log_options: "{{ lookup('oo_option', 'docker_log_options') }}"
when: openshift_docker_log_options is not defined
+ - set_fact:
+ openshift_docker_selinux_enabled: "{{ lookup('oo_option', 'docker_selinux_enabled') }}"
+ when: openshift_docker_selinux_enabled is not defined
- include: ../openshift-etcd/config.yml
tags:
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index a8935370a..66c9cfa0f 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -96,7 +96,7 @@
dest: /etc/sysconfig/docker
regexp: '^OPTIONS=.*$'
line: "OPTIONS='\
- {% if ansible_selinux and ansible_selinux.status == '''enabled''' %} --selinux-enabled{% endif %}\
+ {% if ansible_selinux.status | default(None) == '''enabled''' and docker_selinux_enabled | default(true) %} --selinux-enabled {% endif %}\
{% if docker_log_driver is defined %} --log-driver {{ docker_log_driver }}{% endif %}\
{% if docker_log_options is defined %} {{ docker_log_options | oo_split() | oo_prepend_strings_in_list('--log-opt ') | join(' ')}}{% endif %}\
{% if docker_options is defined %} {{ docker_options }}{% endif %}\
diff --git a/roles/openshift_docker_facts/tasks/main.yml b/roles/openshift_docker_facts/tasks/main.yml
index 613c237a3..049ceffe0 100644
--- a/roles/openshift_docker_facts/tasks/main.yml
+++ b/roles/openshift_docker_facts/tasks/main.yml
@@ -9,6 +9,7 @@
additional_registries: "{{ openshift_docker_additional_registries | default(None) }}"
blocked_registries: "{{ openshift_docker_blocked_registries | default(None) }}"
insecure_registries: "{{ openshift_docker_insecure_registries | default(None) }}"
+ selinux_enabled: "{{ openshift_docker_selinux_enabled | default(None) }}"
log_driver: "{{ openshift_docker_log_driver | default(None) }}"
log_options: "{{ openshift_docker_log_options | default(None) }}"
options: "{{ openshift_docker_options | default(None) }}"
@@ -23,6 +24,7 @@
| default(omit) }}"
docker_insecure_registries: "{{ openshift.docker.insecure_registries
| default(omit) }}"
+ docker_selinux_enabled: "{{ openshift.docker.selinux_enabled | default(omit) }}"
docker_log_driver: "{{ openshift.docker.log_driver | default(omit) }}"
docker_log_options: "{{ openshift.docker.log_options | default(omit) }}"
docker_push_dockerhub: "{{ openshift.docker.disable_push_dockerhub