summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorejemba <epo@jemba.net>2015-10-22 19:55:20 +0200
committerejemba <epo@jemba.net>2015-10-23 14:27:00 +0200
commitb274f486d1b92e382ce40344bfbe4903c7452954 (patch)
tree6ea7b2e77e119d63525388858311eb2aed06f54d
parentab959a27d43b1f3a1ef1bbc6eccdde24be1c89f0 (diff)
downloadopenshift-b274f486d1b92e382ce40344bfbe4903c7452954.tar.gz
openshift-b274f486d1b92e382ce40344bfbe4903c7452954.tar.bz2
openshift-b274f486d1b92e382ce40344bfbe4903c7452954.tar.xz
openshift-b274f486d1b92e382ce40344bfbe4903c7452954.zip
Adding Docker Log Options capabilities
In regard of issue https://github.com/openshift/openshift-ansible/issues/696 added options (docker_log_dirver and docker_log_options) to bin/cluster: bin/cluster -o docker_log_driver=json-file -o docker_log_options="max-size=5m,max-files=5" will be added to OPTION in /etc/sysconfig/docker in all nodes of the cluster: "--log-driver json-file --log-opt max-size=5m --log-opt max-files=5"
-rw-r--r--roles/openshift_node/tasks/main.yml8
1 files changed, 6 insertions, 2 deletions
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index d45dd8073..4ebb007f6 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -30,6 +30,8 @@
kubelet_args: "{{ openshift_node_kubelet_args | default(None) }}"
sdn_mtu: "{{ openshift_node_sdn_mtu | default(None) }}"
schedulable: "{{ openshift_schedulable | default(openshift_scheduleable) | default(None) }}"
+ docker_log_driver: "{{ lookup( 'oo_option' , 'docker_log_driver' ) | default('',True) }}"
+ docker_log_options: "{{ lookup( 'oo_option' , 'docker_log_options' ) | default('',True) }}"
# We have to add tuned-profiles in the same transaction otherwise we run into depsolving
# problems because the rpms don't pin the version properly.
@@ -68,12 +70,14 @@
register: docker_check
# TODO: Enable secure registry when code available in origin
-- name: Secure Registry
+- name: Secure Registry and Logs Options
lineinfile:
dest: /etc/sysconfig/docker
regexp: '^OPTIONS=.*$'
line: "OPTIONS='--insecure-registry={{ openshift.node.portal_net }} \
-{% if ansible_selinux and ansible_selinux.status == '''enabled''' %}--selinux-enabled{% endif %}'"
+{% if ansible_selinux and ansible_selinux.status == '''enabled''' %}--selinux-enabled{% endif %} \
+{% if openshift.node.docker_log_driver is defined %} --log-driver {{ openshift.node.docker_log_driver }} {% endif %} \
+{% if openshift.node.docker_log_options is defined %} {{ openshift.node.docker_log_options | oo_split() | oo_prepend_strings_in_list('--log-opt ') | join(' ')}} {% endif %} '"
when: docker_check.stat.isreg
notify:
- restart docker