如何在依赖角色的Ansible中指定dependency list角色及其参数,这两个角色都存储在单独的Git存储库中?
考虑以下错误示例,其中角色tomcat
取决于角色openjdk
的第8版:
# Role tomcat at git+http://source/ansible/roles/tomcat.
# File tomcat/meta/main.yml.
---
dependencies:
# When it retrieves role tomcat, ansible-galaxy retrieves role openjdk.
- src: git+http://source/ansible/roles/openjdk
version: master
# ansible-playbook invokes role openjdk, but fails to set openjdk_version.
- { role: openjdk, openjdk_version: 8 }
指定依赖关系角色openjdk
的正确方法是什么?
Ansible Galaxy版本:
derek@derek-lubuntu:~/Projects/deployer$ ansible-galaxy --version
ansible-galaxy 2.3.0 (devel 947e0f264e) last updated 2016/11/10 11:45:16 (GMT -400)
lib/ansible/modules/core: (detached HEAD 2584fca0ae) last updated 2016/11/04 12:08:44 (GMT -400)
lib/ansible/modules/extras: (detached HEAD a1dcbf9ce5) last updated 2016/11/04 12:08:44 (GMT -400)
config file = /home/derek/Projects/deployer/ansible.cfg
configured module search path = Default w/o overrides
Ansible Playbook版本:
ansible-playbook 2.3.0 (devel 947e0f264e) last updated 2016/11/10 11:45:16 (GMT -400)
lib/ansible/modules/core: (detached HEAD 2584fca0ae) last updated 2016/11/04 12:08:44 (GMT -400)
lib/ansible/modules/extras: (detached HEAD a1dcbf9ce5) last updated 2016/11/04 12:08:44 (GMT -400)
config file = /home/derek/Projects/deployer/ansible.cfg
configured module search path = Default w/o overrides
答案 0 :(得分:1)
由于我找不到将in: query
name: template_id
description: some
required: false
type: array
items:
type: int64
collectionFormat: multi
作为参数传递给角色openjdk_version
的方法,而是关注了Andrey Rusanov的suggestion并添加了变量openjdk
} openjdk_version
角色vars/main.yml
:
tomcat
---
openjdk_version: 8
现在只包含meta/main.yml
的{{1}}依赖项:
src