diff options
author | Vadim Rutkovsky <vrutkovs@redhat.com> | 2018-02-07 14:21:40 +0100 |
---|---|---|
committer | Vadim Rutkovsky <vrutkovs@redhat.com> | 2018-02-07 15:44:10 +0100 |
commit | dafd08378a76a4da69eb27e00fccdb6738796adf (patch) | |
tree | 47f8b99d598eaa40fe49a782ba2a4627a4f28118 /utils/src/ooinstall | |
parent | 5e7eaaf7b8b30f8343b1564853b82c1e768f546e (diff) | |
download | openshift-dafd08378a76a4da69eb27e00fccdb6738796adf.tar.gz openshift-dafd08378a76a4da69eb27e00fccdb6738796adf.tar.bz2 openshift-dafd08378a76a4da69eb27e00fccdb6738796adf.tar.xz openshift-dafd08378a76a4da69eb27e00fccdb6738796adf.zip |
Quick installer: run prerequistes first and update path to main playbook
Diffstat (limited to 'utils/src/ooinstall')
-rw-r--r-- | utils/src/ooinstall/cli_installer.py | 11 | ||||
-rw-r--r-- | utils/src/ooinstall/openshift_ansible.py | 17 |
2 files changed, 27 insertions, 1 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index eb42721b5..ffab3bfbf 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -796,6 +796,17 @@ If changes are needed please edit the installer.cfg.yml config file above and re if not unattended: confirm_continue(message) + error = openshift_ansible.run_prerequisites(inventory_file, oo_cfg.deployment.hosts, + hosts_to_run_on, verbose) + if error: + # The bootstrap script will print out the log location. + message = """ +An error was detected. After resolving the problem please relaunch the +installation process. +""" + click.echo(message) + sys.exit(1) + error = openshift_ansible.run_main_playbook(inventory_file, oo_cfg.deployment.hosts, hosts_to_run_on, verbose) diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py index 84a76fa53..5e1ad09d5 100644 --- a/utils/src/ooinstall/openshift_ansible.py +++ b/utils/src/ooinstall/openshift_ansible.py @@ -275,6 +275,21 @@ def default_facts(hosts, verbose=False): return load_system_facts(inventory_file, os_facts_path, facts_env, verbose) +def run_prerequisites(inventory_file, hosts, hosts_to_run_on, verbose=False): + global CFG + prerequisites_playbook_path = os.path.join(CFG.ansible_playbook_directory, + 'playbooks/prerequisites.yml') + facts_env = os.environ.copy() + if 'ansible_log_path' in CFG.settings: + facts_env['ANSIBLE_LOG_PATH'] = CFG.settings['ansible_log_path'] + + # override the ansible config for prerequisites playbook run + if 'ansible_quiet_config' in CFG.settings: + facts_env['ANSIBLE_CONFIG'] = CFG.settings['ansible_quiet_config'] + + return run_ansible(prerequisites_playbook_path, inventory_file, facts_env, verbose) + + def run_main_playbook(inventory_file, hosts, hosts_to_run_on, verbose=False): global CFG if len(hosts_to_run_on) != len(hosts): @@ -282,7 +297,7 @@ def run_main_playbook(inventory_file, hosts, hosts_to_run_on, verbose=False): 'playbooks/openshift-node/scaleup.yml') else: main_playbook_path = os.path.join(CFG.ansible_playbook_directory, - 'playbooks/byo/openshift-cluster/config.yml') + 'playbooks/deploy_cluster.yml') facts_env = os.environ.copy() if 'ansible_log_path' in CFG.settings: facts_env['ANSIBLE_LOG_PATH'] = CFG.settings['ansible_log_path'] |