Bug 1320346 - Set oauthConfig.templates in installer
Summary: Set oauthConfig.templates in installer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Devan Goodwin
QA Contact: Ma xiaoqiang
URL:
Whiteboard:
Depends On:
Blocks: OSOPS_V3
TreeView+ depends on / blocked
 
Reported: 2016-03-22 23:38 UTC by Stefanie Forrester
Modified: 2016-06-01 06:03 UTC (History)
9 users (show)

Fixed In Version: openshift-ansible-3.0.74-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 16:39:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1065 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise atomic-openshift-utils bug fix update 2016-05-12 20:32:56 UTC

Description Stefanie Forrester 2016-03-22 23:38:23 UTC
Description of problem:

OpenShift Online needs to set the following Oauth UI changes in master-config.yaml. It would be ideal if this could be handled inside the installer.

oauthConfig
  alwaysShowProviderSelection: true
  templates:
    providerSelection: provider-selection.html
    error: oauth-error.html

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Devan Goodwin 2016-03-24 19:59:31 UTC
Jason could I get your feedback on this, there's already a oauth_template variable, but all it lets you set is the "login" template.

I assume I can't just change that as it would impact real deployments.

So I am thinking we add a new more freeform templates variable like (forgive me for just pluralizing it, I know it looks close, but it is technically different):

openshift_oauth_templates: {"providerSelection": "provider-selection.html", "error": "oauth-error.html"}

In the master config I propose we change the current:

{% if 'oauth_template' in openshift.master %}
  templates:
    login: {{ openshift.master.oauth_template }}
{% endif %}

To make that a fallback and use the new templates variable instead:

oauthConfig:
{% if 'oauth_templates' in openshift.master %}
  templates:{{ openshift.master.oauth_templates | to_padded_yaml(level=2) }}
{% else if 'oauth_template' in openshift.master %}
  templates:
    login: {{ openshift.master.oauth_template }}
{% endif %}

Then update all examples and comment the other one as deprecated.

Comment 2 Jason DeTiberus 2016-03-30 16:20:20 UTC
+1 on the approach

Comment 3 Brenton Leanhardt 2016-04-06 20:34:31 UTC
https://github.com/openshift/openshift-ansible/pull/1660

Comment 5 Ma xiaoqiang 2016-04-07 01:20:17 UTC
Check openshift-ansilbe -b master 

Scenarios 1:
Install env without templates parameters
check the master config
oauthConfig:
  assetPublicURL: https://openshift-115.lab.eng.nay.redhat.com:8443/console/
  grantConfig:
Get the expected result

Scenarios 2: Install env with template parameters
<--snip-->
openshift_master_oauth_always_show_provider_selection=true
openshift_master_oauth_template = {'providerSelection': 'provider-selection.html', 'error': 'oauth-error.html'} 
<--snip-->
check the master config 
<--snip-->
oauthConfig:
  alwaysShowProviderSelection: true
  templates:
    login:
      error: oauth-error.html
      providerSelection: provider-selection.html
<--snip-->
Get the expected result

Scenarios 3: Install env with templates
<--snip-->
openshift_master_oauth_always_show_provider_selection=false
openshift_master_oauth_template = {'providerSelection': 'provider-selection.html', 'error': 'oauth-error.html'} 
<--snip-->
check the master config
<--snip-->
oauthConfig:
  alwaysShowProviderSelection: false
  templates:
    error: oauth-error.html
    providerSelection: provider-selection.html
<--snip-->
Get the expected result

Scenarios 4: Install env with templates and template
<--snip-->
openshift_master_oauth_always_show_provider_selection=false
openshift_master_oauth_templates = {'providerSelection': 'provider-selection.html', 'error': 'oauth-error.html'} 
openshift_master_oauth_template = {'test', 'test'}
<--snip-->
check the master config
<--snip-->
oauthConfig:
  alwaysShowProviderSelection: false
  templates:
    error: oauth-error.html
    providerSelection: provider-selection.html
<--snip-->
Check the result
  alwaysShowProviderSelection: false
  templates:
    error: oauth-error.html
    login:
      test: test
<--snip-->
Get the expected result.

Comment 7 errata-xmlrpc 2016-05-12 16:39:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1065


Note You need to log in before you can comment on or make changes to this bug.