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)