在Ansible的meta / main.yml中定义角色依赖关系的正确语法是什么?

前端之家收集整理的这篇文章主要介绍了在Ansible的meta / main.yml中定义角色依赖关系的正确语法是什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
元/ main.yml
dependencies:
  - { role: 030.sensu-install }

结果是:

[DEPRECATION WARNING]: The comma separated role spec format,use the
yaml/explicit format instead..
This feature will be removed in a future release. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in 
ansible.cfg.

当sudo ansible-galaxy安装-r requirements / development.yml发布时.

试图解决这个问题

什么时候

dependencies:
  - role: 030.sensu-install
    version: 0.1.0

已定义,语法检查成功,但弃用警告仍然存在.

什么时候

dependencies:
  - src: 030.sensu-install
    version: 0.1.0

已定义,sudo ansible-galaxy install -r requirements / development.yml运行已弃用警告已解决,但ansible-playbook / etc / ansible / roles / role_under_test / tests / ${playbook} –Syntax-check结果为:

ERROR! role definitions must contain a role name

解决方法

根据 this snippet更新 meta/main.yml如下:
dependencies:
  - src: 030.firewall
    version: 0.1.0
    name: 030.firewall
  - src: 030.sensu-client
    version: 0.4.1
    name: 030.sensu-client
  - src: geerlingguy.ntp
    version: 1.3.0
    name: geerlingguy.ntp    
  - src: geerlingguy.postfix
    version: 1.1.0
    name: geerlingguy.postfix
  - src: geerlingguy.redis
    version: 1.4.1
    name: geerlingguy.redis
  - src: Stouts.rabbitmq
    version: 1.2.1
    name: Stouts.rabbitmq

通过发出ansible-galaxy install -r requirements / development.yml来安装需求并没有返回[DEPRECATION WARNING]:逗号分隔的角色规范格式问题了.

猜你在找的HTML5相关文章