diff options
author | Jason DeTiberus <detiber@gmail.com> | 2016-04-26 11:17:01 -0400 |
---|---|---|
committer | Jason DeTiberus <detiber@gmail.com> | 2016-04-26 11:17:01 -0400 |
commit | 432a700960e9a09177432e71a8cdc2a496891c1f (patch) | |
tree | 273cd7fe4d1dd5a458fae54b5197acbc2f426fba /utils/src/ooinstall | |
parent | 44407f04615073f1ffde4bf31f6a2a5894c7bafc (diff) | |
parent | 5647c1364b481107c00aef2c4e038b7eb2efb0db (diff) | |
download | openshift-432a700960e9a09177432e71a8cdc2a496891c1f.tar.gz openshift-432a700960e9a09177432e71a8cdc2a496891c1f.tar.bz2 openshift-432a700960e9a09177432e71a8cdc2a496891c1f.tar.xz openshift-432a700960e9a09177432e71a8cdc2a496891c1f.zip |
Merge pull request #1765 from smunilla/proxy_ui
a-o-i: UI additions for proxies
Diffstat (limited to 'utils/src/ooinstall')
-rw-r--r-- | utils/src/ooinstall/cli_installer.py | 25 | ||||
-rw-r--r-- | utils/src/ooinstall/oo_config.py | 2 | ||||
-rw-r--r-- | utils/src/ooinstall/openshift_ansible.py | 3 |
3 files changed, 29 insertions, 1 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index 3d6b24138..71bdbd5a1 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -520,6 +520,24 @@ def error_if_missing_info(oo_cfg): if missing_info: sys.exit(1) +def get_proxy_hostname_and_excludes(): + message = """ +If a proxy is needed to reach HTTP and HTTPS traffic please enter the name below. +This proxy will be configured by default for all processes needing to reach systems outside +the cluster. + +More advanced configuration is possible if using ansible directly: + +https://docs.openshift.com/enterprise/latest/install_config/http_proxies.html +""" + click.echo(message) + + message = "Specify the hostname for your proxy? (ENTER for none)" + proxy_hostname = click.prompt(message) + + message = "List any hosts that should be excluded from your proxy. (ENTER for none)" + proxy_excludes = click.prompt(message) + return proxy_hostname, proxy_excludes def get_missing_info_from_user(oo_cfg): """ Prompts the user for any information missing from the given configuration. """ @@ -566,6 +584,13 @@ https://docs.openshift.com/enterprise/latest/admin_guide/install/prerequisites.h oo_cfg.settings['master_routingconfig_subdomain'] = get_master_routingconfig_subdomain() click.clear() + if not oo_cfg.settings.get('openshift_http_proxy', None): + proxy_hostname, proxy_excludes = get_proxy_hostname_and_excludes() + oo_cfg.settings['openshift_http_proxy'] = proxy_hostname + oo_cfg.settings['openshift_https_proxy'] = proxy_hostname + oo_cfg.settings['openshift_no_proxy'] = proxy_excludes + click.clear() + return oo_cfg diff --git a/utils/src/ooinstall/oo_config.py b/utils/src/ooinstall/oo_config.py index 0f1f5caf7..24dfbe013 100644 --- a/utils/src/ooinstall/oo_config.py +++ b/utils/src/ooinstall/oo_config.py @@ -11,6 +11,8 @@ PERSIST_SETTINGS = [ 'ansible_config', 'ansible_log_path', 'master_routingconfig_subdomain', + 'proxy', + 'proxy_exclude_hosts', 'variant', 'variant_version', 'version', diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py index cfe2819e8..5ace63918 100644 --- a/utils/src/ooinstall/openshift_ansible.py +++ b/utils/src/ooinstall/openshift_ansible.py @@ -129,7 +129,8 @@ def write_inventory_vars(base_inventory, multiple_masters, proxy): "openshift_master_cluster_public_hostname={}\n".format(proxy.public_hostname)) if CFG.settings.get('master_routingconfig_subdomain', False): base_inventory.write( - "openshift_master_default_subdomain={}\n".format(CFG.settings['master_routingconfig_subdomain'])) + "openshift_master_default_subdomain={}\n".format( + CFG.settings['master_routingconfig_subdomain'])) if CFG.settings.get('variant_version', None) == '3.1': #base_inventory.write('openshift_image_tag=v{}\n'.format(CFG.settings.get('variant_version'))) base_inventory.write('openshift_image_tag=v{}\n'.format('3.1.1.6')) |