summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-02-15 16:09:50 -0500
committerScott Dodson <sdodson@redhat.com>2016-02-15 16:09:50 -0500
commit6f5a98a13251b7017d9be60603c31f46ff2dc5d1 (patch)
tree3fce98d572b9d3876d17499120a09be98c4111e2
parent7aff6316210a8c9b32147770397d3e4664b21af7 (diff)
downloadopenshift-6f5a98a13251b7017d9be60603c31f46ff2dc5d1.tar.gz
openshift-6f5a98a13251b7017d9be60603c31f46ff2dc5d1.tar.bz2
openshift-6f5a98a13251b7017d9be60603c31f46ff2dc5d1.tar.xz
openshift-6f5a98a13251b7017d9be60603c31f46ff2dc5d1.zip
Add openshift_docker_options to append arbitrary options to
/etc/sysconfig/docker OPTIONS
-rw-r--r--inventory/byo/hosts.aep.example6
-rw-r--r--inventory/byo/hosts.origin.example6
-rw-r--r--inventory/byo/hosts.ose.example7
-rw-r--r--roles/openshift_docker/tasks/main.yml10
4 files changed, 25 insertions, 4 deletions
diff --git a/inventory/byo/hosts.aep.example b/inventory/byo/hosts.aep.example
index a2e1708d4..8cd4caac4 100644
--- a/inventory/byo/hosts.aep.example
+++ b/inventory/byo/hosts.aep.example
@@ -58,12 +58,18 @@ deployment_type=atomic-enterprise
# See: https://docs.openshift.com/enterprise/latest/install_config/aggregate_logging.html
#openshift_master_logging_public_url=https://kibana.example.com
+# Docker Configuration
# Add additional, insecure, and blocked registries to global docker configuration
# For enterprise deployment types we ensure that registry.access.redhat.com is
# included if you do not include it
#cli_docker_additional_registries=registry.example.com
#cli_docker_insecure_registries=registry.example.com
#cli_docker_blocked_registries=registry.hacker.com
+# Items added, as is, to end of /etc/sysconfig/docker OPTIONS
+#openshift_docker_options="-l warn --ipv6=false"
+# Deprecated methods to set --log-driver and --log-opts flags, use openshift_docker_options instead
+#cli_docker_log_driver=json
+#cli_docker_log_options="tag=mailer"
# Alternate image format string. If you're not modifying the format string and
# only need to inject your own registry you may want to consider
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index de1d0f88b..fffdcaab4 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -59,12 +59,18 @@ deployment_type=origin
# See: https://docs.openshift.org/latest/install_config/aggregate_logging.html
#openshift_master_logging_public_url=https://kibana.example.com
+# Docker Configuration
# Add additional, insecure, and blocked registries to global docker configuration
# For enterprise deployment types we ensure that registry.access.redhat.com is
# included if you do not include it
#cli_docker_additional_registries=registry.example.com
#cli_docker_insecure_registries=registry.example.com
#cli_docker_blocked_registries=registry.hacker.com
+# Items added, as is, to end of /etc/sysconfig/docker OPTIONS
+#openshift_docker_options="-l warn --ipv6=false"
+# Deprecated methods to set --log-driver and --log-opts flags, use openshift_docker_options instead
+#cli_docker_log_driver=json
+#cli_docker_log_options="tag=mailer"
# Alternate image format string. If you're not modifying the format string and
# only need to inject your own registry you may want to consider
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index c80be574f..233c1c8e2 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -58,12 +58,19 @@ deployment_type=openshift-enterprise
# See: https://docs.openshift.com/enterprise/latest/install_config/aggregate_logging.html
#openshift_master_logging_public_url=https://kibana.example.com
+# Docker Configuration
# Add additional, insecure, and blocked registries to global docker configuration
# For enterprise deployment types we ensure that registry.access.redhat.com is
# included if you do not include it
#cli_docker_additional_registries=registry.example.com
#cli_docker_insecure_registries=registry.example.com
#cli_docker_blocked_registries=registry.hacker.com
+# Items added, as is, to end of /etc/sysconfig/docker OPTIONS
+#openshift_docker_options="-l warn --ipv6=false"
+# Deprecated methods to set --log-driver and --log-opts flags, use openshift_docker_options instead
+#cli_docker_log_driver=json
+#cli_docker_log_options="tag=mailer"
+
# Alternate image format string. If you're not modifying the format string and
# only need to inject your own registry you may want to consider
diff --git a/roles/openshift_docker/tasks/main.yml b/roles/openshift_docker/tasks/main.yml
index 5a285e773..a57cf815e 100644
--- a/roles/openshift_docker/tasks/main.yml
+++ b/roles/openshift_docker/tasks/main.yml
@@ -10,6 +10,7 @@
docker_additional_registries: "{{ docker_additional_registries }}"
docker_insecure_registries: "{{ docker_insecure_registries }}"
docker_blocked_registries: "{{ docker_blocked_registries }}"
+ docker_options: "{{ openshift_docker_options | default('',True) }}"
- role: node
local_facts:
portal_net: "{{ openshift_master_portal_net | default(None) }}"
@@ -44,10 +45,11 @@
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 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 %} '"
+ line: "OPTIONS='--insecure-registry={{ openshift.node.portal_net }}\
+ {% 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 %}\
+ {% if openshift.common.docker_options is defined %} {{ openshift.common.docker_options }}{% endif %}'"
when: docker_check.stat.isreg
notify:
- restart openshift_docker