From 60c4e41791c9517ad7201c8c04f0fee2bff8873c Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Thu, 28 Apr 2016 14:50:04 -0400 Subject: Replace hostvars with vars for openshift env facts when ansible >= v2. --- roles/openshift_hosted_facts/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'roles/openshift_hosted_facts/tasks/main.yml') diff --git a/roles/openshift_hosted_facts/tasks/main.yml b/roles/openshift_hosted_facts/tasks/main.yml index f595e1e81..897fc0b35 100644 --- a/roles/openshift_hosted_facts/tasks/main.yml +++ b/roles/openshift_hosted_facts/tasks/main.yml @@ -3,5 +3,7 @@ openshift_facts: role: hosted openshift_env: "{{ hostvars[inventory_hostname] - | oo_merge_dicts(hostvars) + | oo_merge_dicts(vars if (ansible_version.full + | version_compare('2.0', 'ge') + | bool) else hostvars) | oo_openshift_env }}" -- cgit v1.2.3 From f0c412a9ab50a9030d51f83c459a66451a7c344a Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Tue, 3 May 2016 16:56:15 -0400 Subject: Add oo_merge_hostvars filter for merging host & play variables. --- roles/openshift_hosted_facts/tasks/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'roles/openshift_hosted_facts/tasks/main.yml') diff --git a/roles/openshift_hosted_facts/tasks/main.yml b/roles/openshift_hosted_facts/tasks/main.yml index 897fc0b35..2a11e6cbd 100644 --- a/roles/openshift_hosted_facts/tasks/main.yml +++ b/roles/openshift_hosted_facts/tasks/main.yml @@ -2,8 +2,6 @@ - name: Set hosted facts openshift_facts: role: hosted - openshift_env: "{{ hostvars[inventory_hostname] - | oo_merge_dicts(vars if (ansible_version.full - | version_compare('2.0', 'ge') - | bool) else hostvars) + openshift_env: "{{ hostvars + | oo_merge_hostvars(vars, inventory_hostname) | oo_openshift_env }}" -- cgit v1.2.3