From fcfe12437c9fab4182251f805dfa24d1733d3de3 Mon Sep 17 00:00:00 2001 From: Magnus Holm Date: Tue, 7 Aug 2018 15:22:14 +0200 Subject: [PATCH] contrib/terraform/terraform.py: fix for Ansible 2.6.2+, issue #3067 --- contrib/terraform/terraform.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/terraform/terraform.py b/contrib/terraform/terraform.py index 955d5155b..6feaed42a 100755 --- a/contrib/terraform/terraform.py +++ b/contrib/terraform/terraform.py @@ -706,6 +706,10 @@ def query_list(hosts): for name, attrs, hostgroups in hosts: for group in set(hostgroups): + # Ansible 2.6.2 stopped supporting empty group names: https://github.com/ansible/ansible/pull/42584/commits/d4cd474b42ed23d8f8aabb2a7f84699673852eaf + # Empty group name defaults to "all" in Ansible < 2.6.2 so we alter empty group names to "all" + if not group: group = "all" + groups[group].setdefault('hosts', []) groups[group]['hosts'].append(name)