diff options
author | Andrew Butcher <abutcher@afrolegs.com> | 2016-06-08 15:04:20 -0400 |
---|---|---|
committer | Andrew Butcher <abutcher@afrolegs.com> | 2016-06-08 15:04:20 -0400 |
commit | c35f17f15639f71fa1e7b53fb01edeeee4c4b066 (patch) | |
tree | 933ec49604130ad8486e0f428b4fbf26a01607b9 | |
parent | be14df1ed4a1c86afde034c834ea8db58413c14f (diff) | |
parent | 5701ba78c681e6f9efd841e76382e3aeb9853c9b (diff) | |
download | openshift-c35f17f15639f71fa1e7b53fb01edeeee4c4b066.tar.gz openshift-c35f17f15639f71fa1e7b53fb01edeeee4c4b066.tar.bz2 openshift-c35f17f15639f71fa1e7b53fb01edeeee4c4b066.tar.xz openshift-c35f17f15639f71fa1e7b53fb01edeeee4c4b066.zip |
Merge pull request #1996 from abutcher/ansible-2.1
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, |