summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Bielawa <tbielawa@redhat.com>2016-09-29 08:07:39 -0700
committerTim Bielawa <tbielawa@redhat.com>2016-09-29 08:20:59 -0700
commitb03d8cf25077cb824f1afca0ecd7d1b8edcc028d (patch)
tree05b9f5bc19af3735e1cc350df4af96164b22164c
parent76f1cd09097dc28c9efe7e2476534fb8a9cfede5 (diff)
downloadopenshift-b03d8cf25077cb824f1afca0ecd7d1b8edcc028d.tar.gz
openshift-b03d8cf25077cb824f1afca0ecd7d1b8edcc028d.tar.bz2
openshift-b03d8cf25077cb824f1afca0ecd7d1b8edcc028d.tar.xz
openshift-b03d8cf25077cb824f1afca0ecd7d1b8edcc028d.zip
Add messages to let the user know if some plays were skipped, but it's ok. Also, remove the final 'press a key to continue' prompt.
-rw-r--r--callback_plugins/openshift_quick_installer.py40
-rw-r--r--utils/src/ooinstall/cli_installer.py1
2 files changed, 40 insertions, 1 deletions
diff --git a/callback_plugins/openshift_quick_installer.py b/callback_plugins/openshift_quick_installer.py
index 7923a9a80..e2f125df9 100644
--- a/callback_plugins/openshift_quick_installer.py
+++ b/callback_plugins/openshift_quick_installer.py
@@ -40,6 +40,7 @@ import imp
import os
import sys
from ansible import constants as C
+from ansible.utils.color import colorize, hostcolor
ANSIBLE_PATH = imp.find_module('ansible')[1]
DEFAULT_PATH = os.path.join(ANSIBLE_PATH, 'plugins/callback/default.py')
DEFAULT_MODULE = imp.load_source(
@@ -249,3 +250,42 @@ The only thing we change here is adding `log_only=True` to the
'notify' list attached.
"""
self._display.display("skipping: no hosts matched", color=C.COLOR_SKIP, log_only=True)
+
+ def v2_playbook_on_stats(self, stats):
+ """Print the final playbook run stats"""
+ self._display.display("", screen_only=True)
+ self.banner("PLAY RECAP")
+
+ hosts = sorted(stats.processed.keys())
+ for h in hosts:
+ t = stats.summarize(h)
+
+ self._display.display(
+ u"%s : %s %s %s %s" % (
+ hostcolor(h, t),
+ colorize(u'ok', t['ok'], C.COLOR_OK),
+ colorize(u'changed', t['changed'], C.COLOR_CHANGED),
+ colorize(u'unreachable', t['unreachable'], C.COLOR_UNREACHABLE),
+ colorize(u'failed', t['failures'], C.COLOR_ERROR)),
+ screen_only=True
+ )
+
+ self._display.display(
+ u"%s : %s %s %s %s" % (
+ hostcolor(h, t, False),
+ colorize(u'ok', t['ok'], None),
+ colorize(u'changed', t['changed'], None),
+ colorize(u'unreachable', t['unreachable'], None),
+ colorize(u'failed', t['failures'], None)),
+ log_only=True
+ )
+
+ self._display.display("", screen_only=True)
+ self._display.display("", screen_only=True)
+
+ # Some plays are conditional and won't run (such as load
+ # balancers) if they aren't required. Let the user know about
+ # this to avoid potential confusion.
+ if self.plays_total_ran != self.plays_count:
+ print("Installation Complete: Note: Play count is an estimate and some were skipped because your install does not require them")
+ self._display.display("", screen_only=True)
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index 674d1cee4..43b1b3244 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -1078,7 +1078,6 @@ more:
http://docs.openshift.com/enterprise/latest/admin_guide/overview.html
"""
click.echo(message)
- click.pause()
cli.add_command(install)
cli.add_command(upgrade)