From 8a886a6bee30fbb29835558f939a585007eaec67 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 22 Jul 2019 17:59:22 -0400 Subject: [PATCH] Fix gather facts ignoring gather_subsets config (#59271) * Fix gather facts ignoring gather_subsets config fixes #58728 * Update lib/ansible/playbook/play.py Co-Authored-By: Abhijeet Kasurde --- changelogs/fragments/gather_subset_defaults.yml | 2 ++ lib/ansible/playbook/play.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/gather_subset_defaults.yml diff --git a/changelogs/fragments/gather_subset_defaults.yml b/changelogs/fragments/gather_subset_defaults.yml new file mode 100644 index 00000000000..7db2ef753af --- /dev/null +++ b/changelogs/fragments/gather_subset_defaults.yml @@ -0,0 +1,2 @@ +bugfixes: + - Gather facts should use gather_subset config by default. diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 2eb0c743750..2d6e3d4e48c 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -57,7 +57,7 @@ class Play(Base, Taggable, CollectionSearch): # Facts _gather_facts = FieldAttribute(isa='bool', default=None, always_post_validate=True) - _gather_subset = FieldAttribute(isa='list', default=None, listof=string_types, always_post_validate=True) + _gather_subset = FieldAttribute(isa='list', default=(lambda: C.DEFAULT_GATHER_SUBSET), listof=string_types, always_post_validate=True) _gather_timeout = FieldAttribute(isa='int', default=C.DEFAULT_GATHER_TIMEOUT, always_post_validate=True) _fact_path = FieldAttribute(isa='string', default=C.DEFAULT_FACT_PATH)