ansible-galaxy
Manage Ansible roles and collections from Galaxy
TLDR
SYNOPSIS
ansible-galaxy [role|collection] command [options]
DESCRIPTION
ansible-galaxy manages Ansible roles and collections from Ansible Galaxy and other sources. Galaxy is a public repository of community-contributed content, providing reusable automation components.The tool can install, create, and manage roles (traditional content) and collections (bundled content including modules, plugins, and roles). Subcommands are grouped by content type as ansible-galaxy role command and ansible-galaxy collection command; if the type is omitted, role is assumed (for example, "ansible-galaxy install" is equivalent to "ansible-galaxy role install").
PARAMETERS
install name
Install a role (or use "collection install" for a collection)init name
Create a new role or collection scaffoldlist
List installed roles or collectionssearch query
Search Galaxy for rolesinfo name
Show detailed information about a role or collectionremove name
Remove an installed role or collectionbuild
Build a collection artifact (collection only)publish tarball
Publish a collection to a Galaxy server (collection only)-r file, --role-file file, --requirements-file file
Install items listed in a YAML requirements file-p path, --roles-path path
Installation path for roles (--collections-path for collections)--force
Force overwrite of an existing role or collection-s server, --server server
Galaxy API server URL--offline
Work offline (init/install/verify, using installed content only)
CONFIGURATION
/etc/ansible/ansible.cfg
System-wide Ansible configuration, including Galaxy server URL and roles path.~/.ansible.cfg
Per-user Ansible configuration overriding system defaults.ansible.cfg
Project-level configuration in the current directory, highest priority.
CAVEATS
Galaxy content is community-maintained; review before use in production. Collection names are namespaced (namespace.collection). Roles and collections have different installation paths.
HISTORY
ansible-galaxy was introduced with Ansible Galaxy in 2013 to share and distribute roles. Collections support was added in Ansible 2.9 (2019) as a new content distribution format.
SEE ALSO
ansible(1), ansible-playbook(1), ansible-doc(1)