diff options
-rw-r--r-- | filter_plugins/openshift_master.py | 12 | ||||
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 10 |
2 files changed, 17 insertions, 5 deletions
diff --git a/filter_plugins/openshift_master.py b/filter_plugins/openshift_master.py index bb79b27d1..b3f284a8e 100644 --- a/filter_plugins/openshift_master.py +++ b/filter_plugins/openshift_master.py @@ -13,11 +13,15 @@ from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error try: - # ansible-2.0 - from ansible.runner.filter_plugins.core import bool as ansible_bool + # ansible-2.1 + from ansible.plugins.filter.core import to_bool as ansible_bool except ImportError: - # ansible-1.9.x - from ansible.plugins.filter.core import bool as ansible_bool + try: + #ansible-2.0.x + from ansible.runner.filter_plugins.core import bool as ansible_bool + except ImportError: + # ansible-1.9.x + from ansible.plugins.filter.core import bool as ansible_bool class IdentityProviderBase(object): """ IdentityProviderBase diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 3de0c23d3..2f8af2454 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1573,7 +1573,15 @@ class OpenShiftFacts(object): "Role %s is not supported by this module" % role ) self.role = role - self.system_facts = ansible_facts(module) + + try: + # ansible-2.1 + # pylint: disable=too-many-function-args + self.system_facts = ansible_facts(module, ['hardware', 'network', 'virtual', 'facter']) + except TypeError: + # ansible-1.9.x,ansible-2.0.x + self.system_facts = ansible_facts(module) + self.facts = self.generate_facts(local_facts, additive_facts_to_overwrite, openshift_env, |