2017-09-13 19:57:24 -07:00
|
|
|
# ansible-galaxy
|
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
> Perform various Ansible Role and Collection related operations.
|
2019-06-03 02:06:36 +02:00
|
|
|
> More information: <https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html>.
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
- List installed roles or collections:
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
`ansible-galaxy {{role|collection}} list`
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
- Search for a role with various levels of verbosely (`-v` should be specified at the end):
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
`ansible-galaxy role search {{keyword}} -v{{vvvvv}}`
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
- Install or remove role(s):
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
`ansible-galaxy role {{install|remove}} {{role_name1 role_name2 ...}}`
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
- Create a new role:
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
`ansible-galaxy role init {{role_name}}`
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
- Get information about a role:
|
2017-09-13 19:57:24 -07:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
`ansible-galaxy role info {{role_name}}`
|
2021-07-08 12:27:17 +02:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
- Install or remove collection(s):
|
2021-07-08 12:27:17 +02:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
`ansible-galaxy collection {{install|remove}} {{collection_name1 collection_name2 ...}}`
|
2021-07-08 12:27:17 +02:00
|
|
|
|
2024-10-19 20:35:54 +11:00
|
|
|
- Display help about roles or collections:
|
2021-07-08 12:27:17 +02:00
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`ansible-galaxy {{role|collection}} {{[-h|--help]}}`
|