小编Tim*_*nes的帖子

Ansible playbook使用私有git角色依赖

我有一个问题是运行带有一组私有角色的Ansible playbook(即私有git存储库中的Ansible角色).

例如,我有一个使用base依赖的角色的剧本,这dep两个角色都托管在私人git存储库中.运行ansible-galaxy提取并安装所有角色和依赖项,但以后ansible-playbook无法使用正确的角色名称.

play.yml

- hosts: test
  roles:
    - role: base
Run Code Online (Sandbox Code Playgroud)

requirements.yml

- name: base
  src: ssh://git@10.0.0.1/ansible/role-base.git
  scm: git
Run Code Online (Sandbox Code Playgroud)

role-base/meta/main.yml

galaxy-info:
  author: Me
  description: Test Ansible role dependencies
  min_ansible_version: 1.9
  platforms: Ubuntu
dependencies:
  - name: dep
    src: ssh://git@10.0.0.1/ansible/role-dep.git
    scm: git
Run Code Online (Sandbox Code Playgroud)
$ ansible-galaxy -r requirements.yml
- executing: git clone ssh://git@10.0.0.1/ansible/role-base.git base
- executing: git archive --prefix=base/ --output=/tmp/tmp4YKG7a.tar
- extracting base to ansible-roles/base
- base was installed successfully
- adding dependency: dep
- executing: …
Run Code Online (Sandbox Code Playgroud)

git ansible ansible-playbook

8
推荐指数
1
解决办法
3682
查看次数

标签 统计

ansible ×1

ansible-playbook ×1

git ×1