From 5701ba78c681e6f9efd841e76382e3aeb9853c9b Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Tue, 7 Jun 2016 13:56:30 -0400 Subject: Ansible 2.1 support. --- roles/openshift_facts/library/openshift_facts.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'roles') 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, -- cgit v1.2.3