diff options
author | Andrew Butcher <abutcher@redhat.com> | 2016-06-07 13:56:30 -0400 |
---|---|---|
committer | Andrew Butcher <abutcher@redhat.com> | 2016-06-07 15:21:31 -0400 |
commit | 5701ba78c681e6f9efd841e76382e3aeb9853c9b (patch) | |
tree | 4f9dd93b954ee719d3ab532f3548abc02d9291fd | |
parent | 377405b67551ef51ce6f644bde018986465a1e0c (diff) | |
download | openshift-5701ba78c681e6f9efd841e76382e3aeb9853c9b.tar.gz openshift-5701ba78c681e6f9efd841e76382e3aeb9853c9b.tar.bz2 openshift-5701ba78c681e6f9efd841e76382e3aeb9853c9b.tar.xz openshift-5701ba78c681e6f9efd841e76382e3aeb9853c9b.zip |
Ansible 2.1 support.
-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, |