Skip to content

Instantly share code, notes, and snippets.

@tbielawa
Created September 20, 2016 20:44
Show Gist options
  • Save tbielawa/c00f38e43375214c3aff9fa24cb179ec to your computer and use it in GitHub Desktop.
Save tbielawa/c00f38e43375214c3aff9fa24cb179ec to your computer and use it in GitHub Desktop.
Quick installer filtering ansible output for https://github.com/openshift/openshift-ansible/issues/2445
----------------------------------
Beginning play 1 of 5
TASK [Verify Ansible version is greater than or equal to 2.1.0.0] **************
----------------------------------
Beginning play 2 of 5
TASK [include_vars] ************************************************************
ok: [localhost]
TASK [add_host] ****************************************************************
changed: [localhost] => (item=192.168.0.14)
----------------------------------
Beginning play 3 of 5
TASK [include_vars] ************************************************************
ok: [192.168.0.14]
----------------------------------
Beginning play 4 of 5
TASK [fail] ********************************************************************
TASK [fail] ********************************************************************
TASK [fail] ********************************************************************
TASK [fail] ********************************************************************
TASK [fail] ********************************************************************
TASK [fail] ********************************************************************
TASK [Evaluate oo_all_hosts] ***************************************************
changed: [localhost] => (item=192.168.0.14)
TASK [Evaluate oo_masters] *****************************************************
changed: [localhost] => (item=192.168.0.14)
TASK [Evaluate oo_etcd_to_config] **********************************************
changed: [localhost] => (item=192.168.0.14)
TASK [Evaluate oo_masters_to_config] *******************************************
changed: [localhost] => (item=192.168.0.14)
TASK [Evaluate oo_nodes_to_config] *********************************************
changed: [localhost] => (item=192.168.0.14)
TASK [Evaluate oo_nodes_to_config] *********************************************
skipping: [localhost] => (item=192.168.0.14)
TASK [Evaluate oo_first_etcd] **************************************************
changed: [localhost]
TASK [Evaluate oo_first_master] ************************************************
changed: [localhost]
TASK [Evaluate oo_lb_to_config] ************************************************
TASK [Evaluate oo_nfs_to_config] ***********************************************
changed: [localhost] => (item=192.168.0.14)
----------------------------------
Beginning play 5 of 5
TASK [setup] *******************************************************************
ok: [192.168.0.14]
TASK [openshift_facts : Detecting Operating System] ****************************
ok: [192.168.0.14]
TASK [openshift_facts : set_fact] **********************************************
ok: [192.168.0.14]
TASK [openshift_facts : set_fact] **********************************************
ok: [192.168.0.14]
TASK [openshift_facts : Ensure PyYaml is installed] ****************************
ok: [192.168.0.14]
TASK [openshift_facts : Ensure yum-utils is installed] *************************
ok: [192.168.0.14]
TASK [openshift_facts : Gather Cluster facts and set is_containerized if needed] ***
ok: [192.168.0.14]
TASK [openshift_facts : Set repoquery command] *********************************
ok: [192.168.0.14]
TASK [openshift_facts] *********************************************************
ok: [192.168.0.14]
TASK [debug] *******************************************************************
ok: [192.168.0.14] => {
"result": {
"ansible_facts": {
...
},
"changed": false
}
}
PLAY RECAP *********************************************************************
192.168.0.14 : ok=11 changed=0 unreachable=0 failed=0
localhost : ok=10 changed=9 unreachable=0 failed=0
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ansible.plugins.callback.default
class CallbackModule(ansible.plugins.callback.default.CallbackModule):
"""
Ansible callback plugin
"""
CALLBACK_VERSION = 2.2
CALLBACK_TYPE = 'stdout'
CALLBACK_NAME = 'openshift_quick_installer'
CALLBACK_NEEDS_WHITELIST = False
def v2_runner_on_skipped(self, result):
pass
def v2_playbook_on_start(self, playbook):
self._total_plays_count = len(playbook.get_plays())
self._total_plays_started = 0
def v2_playbook_on_play_start(self, play):
self._total_plays_started += 1
print("")
print("----------------------------------")
print("Beginning play %s of %s" % (self._total_plays_started, self._total_plays_count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment