From c9d3c9e233ec777b59600c36342ba70beef448f0 Mon Sep 17 00:00:00 2001 From: Martin Westergaard Lassen Date: Mon, 18 Nov 2019 13:54:36 +0100 Subject: [PATCH] hcloud: inventory: missing compose variables (#64559) --- .../64559-hcloud-inventory-missing-compose-variables.yaml | 2 ++ lib/ansible/plugins/inventory/hcloud.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/64559-hcloud-inventory-missing-compose-variables.yaml diff --git a/changelogs/fragments/64559-hcloud-inventory-missing-compose-variables.yaml b/changelogs/fragments/64559-hcloud-inventory-missing-compose-variables.yaml new file mode 100644 index 00000000000..4b618d34c08 --- /dev/null +++ b/changelogs/fragments/64559-hcloud-inventory-missing-compose-variables.yaml @@ -0,0 +1,2 @@ +bugfixes: + - hcloud - Added missing host variables in Compose section diff --git a/lib/ansible/plugins/inventory/hcloud.py b/lib/ansible/plugins/inventory/hcloud.py index 5c329d4cad5..21647f0fffd 100644 --- a/lib/ansible/plugins/inventory/hcloud.py +++ b/lib/ansible/plugins/inventory/hcloud.py @@ -208,7 +208,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable): strict = self.get_option('strict') # Composed variables - self._set_composite_vars(self.get_option('compose'), {}, server.name, strict=strict) + self._set_composite_vars(self.get_option('compose'), self.inventory.get_host(server.name).get_vars(), server.name, strict=strict) # Complex groups based on jinja2 conditionals, hosts that meet the conditional are added to group self._add_host_to_composed_groups(self.get_option('groups'), {}, server.name, strict=strict)