Collection Galaxy metadata structure

A key component of an Ansible collection is the galaxy.yml file placed in the root directory of a collection. Thisfile contains the metadata of the collection that is used to generate a collection artifact.

Structure

The galaxy.yml file must contain the following keys in valid YAML:

KeyComment
namespacestring/requiredThe namespace of the collection.This can be a company/brand/organization or product namespace under which all content lives.May only contain alphanumeric characters and underscores. Additionally namespaces cannot start with underscores or numbers and cannot contain consecutive underscores.
namestring/requiredThe name of the collection.Has the same character restrictions as namespace.
versionstring/requiredThe version of the collection.Must be compatible with semantic versioning.
readmestring/requiredThe path to the Markdown (.md) readme file.This path is relative to the root of the collection.
authorslist/requiredA list of the collection’s content authors.Can be just the name or in the format ‘Full Name <email> (url) @nicks:irc/im.site#channel’.
descriptionstringA short summary description of the collection.
licenselistEither a single license or a list of licenses for content inside of a collection.Ansible Galaxy currently only accepts SPDX licensesThis key is mutually exclusive with license_file.
license_filestringThe path to the license file for the collection.This path is relative to the root of the collection.This key is mutually exclusive with license.
tagslistA list of tags you want to associate with the collection for indexing/searching.A tag name has the same character requirements as namespace and name.
dependenciesdictionaryCollections that this collection requires to be installed for it to be usable.The key of the dict is the collection label namespace.name.The value is a version range specifiers.Multiple version range specifiers can be set and are separated by ,.
repositorystringThe URL of the originating SCM repository.
documentationstringThe URL to any online docs.
homepagestringThe URL to the homepage of the collection/project.
issuesstringThe URL to the collection issue tracker.

Examples

  1. namespace: "namespace_name"
  2. name: "collection_name"
  3. version: "1.0.12"
  4. readme: "README.md"
  5. authors:
  6. - "Author1"
  7. - "Author2 (https://author2.example.com)"
  8. - "Author3 <[email protected]>"
  9. dependencies:
  10. "other_namespace.collection1": ">=1.0.0"
  11. "other_namespace.collection2": ">=2.0.0,<3.0.0"
  12. "anderson55.my_collection": "*" # note: "*" selects the highest version available
  13. license:
  14. - "MIT"
  15. tags:
  16. - demo
  17. - collection
  18. repository: "https://www.github.com/my_org/my_collection"

See also