diff --git a/changelogs/fragments/galaxy-build-files-ignore.yml b/changelogs/fragments/galaxy-build-files-ignore.yml new file mode 100644 index 00000000000..983307e0ceb --- /dev/null +++ b/changelogs/fragments/galaxy-build-files-ignore.yml @@ -0,0 +1,4 @@ +bugfixes: +- >- + ansible-galaxy collection build - Ignore any existing ``MANIFEST.json`` and ``FILES.json`` in the root directory + when building a collection. diff --git a/lib/ansible/galaxy/collection.py b/lib/ansible/galaxy/collection.py index 054a8a57b50..3ef71172c55 100644 --- a/lib/ansible/galaxy/collection.py +++ b/lib/ansible/galaxy/collection.py @@ -931,6 +931,8 @@ def _build_files_manifest(b_collection_path, namespace, name, ignore_patterns): # We always ignore .pyc and .retry files as well as some well known version control directories. The ignore # patterns can be extended by the build_ignore key in galaxy.yml b_ignore_patterns = [ + b'MANIFEST.json', + b'FILES.json', b'galaxy.yml', b'galaxy.yaml', b'.git',