From 4c589661c2add45023f2bff9203e0c4e11efe5f6 Mon Sep 17 00:00:00 2001 From: JeferCatarina <37630538+JeferCatarina@users.noreply.github.com> Date: Tue, 26 Nov 2019 15:41:28 -0300 Subject: [PATCH] Fixed want_facts in the foreman inventory plugin - fixes #65111 (#65114) * Replaced 'ansible_facts' by 'foreman_facts' 'foreman_facts' is the key that the foreman inventory script used 'ansible_facts' is a special key that is overwritten internally and has never worked in this inventory plugin * Added changelog --- .../65114-fixed-replaced-ansible_facts-by-foreman_facts.yaml | 3 +++ lib/ansible/plugins/inventory/foreman.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/65114-fixed-replaced-ansible_facts-by-foreman_facts.yaml diff --git a/changelogs/fragments/65114-fixed-replaced-ansible_facts-by-foreman_facts.yaml b/changelogs/fragments/65114-fixed-replaced-ansible_facts-by-foreman_facts.yaml new file mode 100644 index 00000000000..e75fc45780b --- /dev/null +++ b/changelogs/fragments/65114-fixed-replaced-ansible_facts-by-foreman_facts.yaml @@ -0,0 +1,3 @@ +bugfixes: +- foreman inventory plugin - Populate host variable information using the "foreman_facts" key + rather than the internal "ansible_facts" key. (https://github.com/ansible/ansible/issues/65111) diff --git a/lib/ansible/plugins/inventory/foreman.py b/lib/ansible/plugins/inventory/foreman.py index 986a1440f4b..d44432ed510 100644 --- a/lib/ansible/plugins/inventory/foreman.py +++ b/lib/ansible/plugins/inventory/foreman.py @@ -229,7 +229,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable, Constructable): # set host vars from facts if self.get_option('want_facts'): - self.inventory.set_variable(host_name, 'ansible_facts', self._get_facts(host)) + self.inventory.set_variable(host_name, 'foreman_facts', self._get_facts(host)) strict = self.get_option('strict')