diff options
Diffstat (limited to 'utils/src')
-rw-r--r-- | utils/src/ooinstall/cli_installer.py | 32 | ||||
-rw-r--r-- | utils/src/ooinstall/openshift_ansible.py | 10 |
2 files changed, 32 insertions, 10 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index 71bdbd5a1..c896a74b4 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -11,6 +11,7 @@ from ooinstall import OOConfig from ooinstall.oo_config import OOConfigInvalidHostError from ooinstall.oo_config import Host from ooinstall.variants import find_variant, get_variant_version_combos +from distutils.version import LooseVersion DEFAULT_ANSIBLE_CONFIG = '/usr/share/atomic-openshift-utils/ansible.cfg' DEFAULT_PLAYBOOK_DIR = '/usr/share/ansible/openshift-ansible/' @@ -520,7 +521,7 @@ def error_if_missing_info(oo_cfg): if missing_info: sys.exit(1) -def get_proxy_hostname_and_excludes(): +def get_proxy_hostnames_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 @@ -532,12 +533,22 @@ 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 = "Specify your http proxy ? (ENTER for none)" + http_proxy_hostname = click.prompt(message, default='') - message = "List any hosts that should be excluded from your proxy. (ENTER for none)" - proxy_excludes = click.prompt(message) - return proxy_hostname, proxy_excludes + message = "Specify your https proxy ? (ENTER for none)" + https_proxy_hostname = click.prompt(message, default=http_proxy_hostname) + + if http_proxy_hostname or https_proxy_hostname: + message = """ +All hosts in your openshift inventory will automatically be added to the NO_PROXY value. +Please provide any additional hosts to be added to NO_PROXY. (ENTER for none) +""" + proxy_excludes = click.prompt(message, default='') + else: + proxy_excludes = '' + + return http_proxy_hostname, https_proxy_hostname, proxy_excludes def get_missing_info_from_user(oo_cfg): """ Prompts the user for any information missing from the given configuration. """ @@ -584,10 +595,11 @@ 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 + if not oo_cfg.settings.get('openshift_http_proxy', None) and \ + LooseVersion(oo_cfg.settings.get('variant_version', '0.0')) >= LooseVersion('3.2'): + http_proxy, https_proxy, proxy_excludes = get_proxy_hostnames_and_excludes() + oo_cfg.settings['openshift_http_proxy'] = http_proxy + oo_cfg.settings['openshift_https_proxy'] = https_proxy oo_cfg.settings['openshift_no_proxy'] = proxy_excludes click.clear() diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py index 5ace63918..97aee0b53 100644 --- a/utils/src/ooinstall/openshift_ansible.py +++ b/utils/src/ooinstall/openshift_ansible.py @@ -135,6 +135,16 @@ def write_inventory_vars(base_inventory, multiple_masters, proxy): #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')) + if CFG.settings.get('openshift_http_proxy', ''): + base_inventory.write("openshift_http_proxy={}\n".format( + CFG.settings['openshift_http_proxy'])) + if CFG.settings.get('openshift_https_proxy', ''): + base_inventory.write("openshift_https_proxy={}\n".format( + CFG.settings['openshift_https_proxy'])) + if CFG.settings.get('openshift_no_proxy', ''): + base_inventory.write("openshift_no_proxy={}\n".format( + CFG.settings['openshift_no_proxy'])) + def write_host(host, inventory, schedulable=None): global CFG |