← 返回命令列表

Linux command

ansible-galaxy 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Install

ansible-galaxy install [username.role_name]

Example

ansible-galaxy collection install [community.docker]

Example

ansible-galaxy install -r [requirements.yml]

List

ansible-galaxy list

Initialize

ansible-galaxy init [role_name]

Search

ansible-galaxy search [nginx]

说明

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).

参数

install _name_
Install role or collection
init _name_
Create new role scaffold
list
List installed roles/collections
search _query_
Search Galaxy for roles
remove _name_
Remove installed role/collection
-r _file_, --role-file _file_
Requirements file
-p _path_, --roles-path _path_
Installation path for roles
--force
Force overwrite existing
-s _server_, --server _server_
Galaxy server URL
--offline
Work offline (installed content only)

FAQ

What is the ansible-galaxy command used for?

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).

How do I run a basic ansible-galaxy example?

Run `ansible-galaxy install [username.role_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does install _name_ do in ansible-galaxy?

Install role or collection