summaryrefslogtreecommitdiffstats
path: root/utils/src/ooinstall
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/ooinstall')
-rw-r--r--utils/src/ooinstall/cli_installer.py28
-rw-r--r--utils/src/ooinstall/openshift_ansible.py2
2 files changed, 21 insertions, 9 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index a62bfe134..ace834323 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -528,18 +528,30 @@ Add new nodes here
def get_installed_hosts(hosts, callback_facts):
installed_hosts = []
+
+ # count nativeha lb as an installed host
+ try:
+ first_master = next(host for host in hosts if host.master)
+ lb_hostname = callback_facts[first_master.connect_to]['master'].get('cluster_hostname', '')
+ lb_host = \
+ next(host for host in hosts if host.ip == callback_facts[lb_hostname]['common']['ip'])
+
+ installed_hosts.append(lb_host)
+ except (KeyError, StopIteration):
+ pass
+
for host in hosts:
- if host.connect_to in callback_facts.keys() and (
- ('common' in callback_facts[host.connect_to].keys() and
- callback_facts[host.connect_to]['common'].get('version', '') and
- callback_facts[host.connect_to]['common'].get('version', '') != 'None') \
- or
- ('master' in callback_facts[host.connect_to].keys() and
- callback_facts[host.connect_to]['master'].get('cluster_hostname', '') == host.connect_to)
- ):
+ if host.connect_to in callback_facts.keys() and is_installed_host(host, callback_facts):
installed_hosts.append(host)
return installed_hosts
+def is_installed_host(host, callback_facts):
+ version_found = 'common' in callback_facts[host.connect_to].keys() and \
+ callback_facts[host.connect_to]['common'].get('version', '') and \
+ callback_facts[host.connect_to]['common'].get('version', '') != 'None'
+
+ return version_found or host.master_lb or host.preconfigured
+
# pylint: disable=too-many-branches
# This pylint error will be corrected shortly in separate PR.
def get_hosts_to_run_on(oo_cfg, callback_facts, unattended, force, verbose):
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py
index 64875dbe9..f2c7289fa 100644
--- a/utils/src/ooinstall/openshift_ansible.py
+++ b/utils/src/ooinstall/openshift_ansible.py
@@ -206,7 +206,7 @@ def run_main_playbook(hosts, hosts_to_run_on, verbose=False):
inventory_file = generate_inventory(hosts_to_run_on)
if len(hosts_to_run_on) != len(hosts):
main_playbook_path = os.path.join(CFG.ansible_playbook_directory,
- 'playbooks/byo/openshift-cluster/scaleup.yml')
+ 'playbooks/byo/openshift-node/scaleup.yml')
else:
main_playbook_path = os.path.join(CFG.ansible_playbook_directory,
'playbooks/byo/openshift-cluster/config.yml')