Collections 如何在ansible中定义集合中角色之间的本地依赖关系?
我有一个关于集合中角色之间的依赖关系的问题。 一般来说,我关心的是是否有可能定义集合中角色之间的依赖关系—像相对路径一样的本地依赖关系 我希望实现以下场景:Collections 如何在ansible中定义集合中角色之间的本地依赖关系?,collections,ansible,dependencies,local,roles,Collections,Ansible,Dependencies,Local,Roles,我有一个关于集合中角色之间的依赖关系的问题。 一般来说,我关心的是是否有可能定义集合中角色之间的依赖关系—像相对路径一样的本地依赖关系 我希望实现以下场景: roleB依赖于roleA roleC的默认场景应使用prepare.yml中的roleA来设置环境 或 roleC的默认场景应在converge.yml中使用roleA 我希望将这些依赖项作为本地依赖项。 对于案例2,我尝试使用requirements.yml文件 在molector.yml中有适当的条目 --- dependency:
roleC的默认场景应在converge.yml中使用roleA
---
dependency:
name: galaxy
driver:
name: docker
platforms:
.. ...
provisioner:
name: ansible
# env:
# ANSIBLE_ROLES_PATH: "../../roles"
playbooks:
prepare: prepare.yml
config_options:
defaults:
remote_user: ansible
dependency:
name: galaxy
options:
ignore-certs: True
ignore-errors: True
requirements-file: requirements.yml
verifier:
name: ansible
但不幸的是,我无法解决错误:
ERROR [1m[0;34mUsing /etc/ansible/ansible.cfg as config file[1m[0m
Starting galaxy role install process
- downloading role from file://../../tool-box
[1m[0;31m [ERROR]: failed to download the file: <urlopen error [Errno 2] No such file or[1m[0m
[1m[0;31mdirectory: '/../tool-box'>[1m[0m
[1m[1;35m[WARNING]: - tool-box was NOT installed successfully.[1m[0m
[1m[0;31mERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.[1m[0m
多谢各位
更新: 请参阅ansible/galaxy中的请求问题: 我添加这个是因为我认为没有这样的功能
mynamespace
|
|-- mycollection
|
| --roles
|
| -- roleA --
| |--molecule
| |
| |--default
|
| -- roleB --
| |--molecule
| |
| |--default
|
| -- roleC --
| |--molecule
| |
| |--default