diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2015-08-12 16:44:58 -0400 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2015-08-12 16:44:58 -0400 |
commit | d307f715764164c8f543d57486718f95b1987875 (patch) | |
tree | 30b2dfdb09b3133188536d24f47fac07bb42e4fa | |
parent | 2244cbd8f0c1acf0a0f3666781ff8d44c8338a73 (diff) | |
parent | 6a00818b03773feb76f5ec997431f975a517b69d (diff) | |
download | openshift-d307f715764164c8f543d57486718f95b1987875.tar.gz openshift-d307f715764164c8f543d57486718f95b1987875.tar.bz2 openshift-d307f715764164c8f543d57486718f95b1987875.tar.xz openshift-d307f715764164c8f543d57486718f95b1987875.zip |
Merge pull request #429 from spinolacastro/custom_cors
Custom cors configuration
-rw-r--r-- | inventory/byo/hosts.example | 3 | ||||
-rw-r--r-- | roles/openshift_master/tasks/main.yml | 1 | ||||
-rw-r--r-- | roles/openshift_master/templates/master.yaml.v1.j2 | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/inventory/byo/hosts.example b/inventory/byo/hosts.example index 4c652d06e..629956d0e 100644 --- a/inventory/byo/hosts.example +++ b/inventory/byo/hosts.example @@ -57,6 +57,9 @@ deployment_type=enterprise # default subdomain to use for exposed routes #osm_default_subdomain=apps.test.example.com +# additional cors origins +#osm_custom_cors_origins=['foo.example.com', 'bar.example.com'] + # host group for masters [masters] ose3-master[1:3]-ansible.test.example.com diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 8d6c02e7f..151d0662f 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -54,6 +54,7 @@ sdn_cluster_network_cidr: "{{ osm_cluster_network_cidr | default(None) }}" sdn_host_subnet_length: "{{ osm_host_subnet_length | default(None) }}" default_subdomain: "{{ osm_default_subdomain | default(None) }}" + custom_cors_origins: "{{ osm_custom_cors_origins | default(None) }}" # TODO: These values need to be configurable - name: Set dns OpenShift facts diff --git a/roles/openshift_master/templates/master.yaml.v1.j2 b/roles/openshift_master/templates/master.yaml.v1.j2 index 01c0ea7e4..c4d319c87 100644 --- a/roles/openshift_master/templates/master.yaml.v1.j2 +++ b/roles/openshift_master/templates/master.yaml.v1.j2 @@ -14,10 +14,12 @@ assetConfig: maxRequestsInFlight: 0 requestTimeoutSeconds: 0 corsAllowedOrigins: -{# TODO: add support for user specified corsAllowedOrigins #} {% for origin in ['127.0.0.1', 'localhost', openshift.common.hostname, openshift.common.ip, openshift.common.public_hostname, openshift.common.public_ip] %} - {{ origin }} {% endfor %} +{% for custom_origin in openshift.master.custom_cors_origins | default("") %} + - {{ custom_origin }} +{% endfor %} {% if openshift.master.embedded_dns | bool %} dnsConfig: bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.dns_port }} |