2019-02-25 10:04:26 +00:00
|
|
|
# ansible-galaxy
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 创建和管理 Ansible 角色。
|
2021-10-01 19:28:01 +01:00
|
|
|
> 更多信息:<https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html>.
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 安装一个角色:
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2019-10-18 04:30:29 +01:00
|
|
|
`ansible-galaxy install {{用户名.角色名}}`
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 移除一个角色:
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2019-10-18 04:30:29 +01:00
|
|
|
`ansible-galaxy remove {{用户名.角色名}}`
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 列出已安装的角色:
|
2019-02-25 10:04:26 +00:00
|
|
|
|
|
|
|
`ansible-galaxy list`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 搜索一个指定的角色:
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2019-02-25 14:44:25 +00:00
|
|
|
`ansible-galaxy search {{角色名}}`
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 创建一个新的角色:
|
2019-02-25 10:04:26 +00:00
|
|
|
|
2019-02-25 14:44:25 +00:00
|
|
|
`ansible-galaxy init {{角色名}}`
|