Ansible: Collection
Manage collections
# Install collection ansible-galaxy collection install ansible.posix ansible-galaxy collection install git@git.example.com:foo/ansible-collections/bar ansible-galaxy collection install git+file:///home/user/path/to/repo_name # List collections ansible-galaxy collection list
# default user Ansible collection directory ~/.ansible/collections/ansible_collections/ # env vars ANSIBLE_COLLECTIONS_PATHS # ~/.ansible.cfg [defaults] collections_paths = /path/to/collection # get current path ansible-config dump | grep -i collection
Include collection in playbook
- hosts: all collections: - my_namespace.my_collection - hosts: all tasks: - import_role: name: my_namespace.my_collection.my_role
Defile collection dependency in role