ansible-galaxy

安装与管理 Ansible 角色和集合

补充说明

ansible-galaxy 从 Galaxy 或私有源安装角色(role)和集合(collection),也用于初始化、构建和发布。集合是当前推荐的分发单位。

常用示例

ansible-galaxy collection install community.general
ansible-galaxy collection install -r requirements.yml
ansible-galaxy collection list
ansible-galaxy role install geerlingguy.nginx
ansible-galaxy role init myrole
ansible-galaxy collection init myns.mycol
ansible-galaxy collection build
ansible-galaxy collection publish myns-mycol-1.0.0.tar.gz
ansible-galaxy install -r requirements.yml -p ./roles

requirements.yml:

collections:
  - name: community.general
    version: ">=8.0.0,<9.0.0"
  - name: ansible.posix
    version: 1.5.4
roles:
  - name: geerlingguy.nginx
    version: 3.1.4

易错点与排错

相关命令