##### SUMMARY
When installing a collection, all files are created with mode 0600. This is caused by the way the collection .tar.gz file is extracted: https://github.com/ansible/ansible/blob/d3ec31f8d5683926aa6a05bb573d9929a6266fac/lib/ansible/galaxy/collection.py#L1076-L1090 The file created by `tempfile.NamedTemporaryFile()` seems to have mode `0600` and is simply moved to the final destination without a following `os.chmod`.

(See also this discussion: https://github.com/ansible-collections/community.general/pull/29#discussion_r396147440)

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
lib/ansible/galaxy/collection.py

##### ANSIBLE VERSION
```
2.9
2.10
```

test_dir = to_bytes(tmp_path_factory.mktemp('test-ÅÑŚÌβŁÈ Collections Input'))
    test_file = os.path.join(test_dir, b'fake.tar.gz')
    with open(test_file, 'wb') as test_obj:
        test_obj.write(b"\x00\x01\x02\x03")
    expected = "Collection artifact at '%s' is not a valid tar file." % to_native(test_file)
    with pytest.raises(AnsibleError, match=expected):
        collection.CollectionRequirement.from_tar(test_file, True, True)
def test_build_requirement_from_tar_no_manifest(tmp_path_factory):
    test_dir = to_bytes(tmp_path_factory.mktemp('test-ÅÑŚÌβŁÈ Collections Input'))
    json_data = to_bytes(json.dumps(
        {
            'files': [],
            'format': 1,
        }
    ))
    tar_path = os.path.join(test_dir, b'ansible-collections.tar.gz')
    with tarfile.open(tar_path, 'w:gz') as tfile:
        b_io = BytesIO(json_data)
        tar_info = tarfile.TarInfo('FILES.json')
        tar_info.size = len(json_data)
        tar_info.mode = 0o0644
        tfile.addfile(tarinfo=tar_info, fileobj=b_io)
    expected = "Collection at '%s' does not contain the required file MANIFEST.json." % to_native(tar_path)
    with pytest.raises(AnsibleError, match=expected):
        collection.CollectionRequirement.from_tar(tar_path, True, True)
def test_build_requirement_from_tar_no_files(tmp_path_factory):