【发布时间】:2014-07-08 06:59:21
【问题描述】:
所以看起来这个功能已被弃用,我真的不明白为什么,Ansible CTO 说我们应该使用 with_nested 但老实说我不知道该怎么做,
这是我的剧本:
- hosts: all
user: root
vars:
- sites:
- site: site1.com
repo: ssh://hg@bitbucket.org/orgname/reponame
nginx_ssl: true;
copy_init:
- path1/file1.txt
- path2/file2.php
- path2/file3.php
- site: site2.net
repo: ssh://hg@bitbucket.org/orgname/reposite2
- site: site4.com
repo: ssh://hg@bitbucket.org/orgname/reposite3
copy_init:
- path2/file2.php
tasks:
- name: Bootstrap Sites
include: bootstrap_site.yml site={{item}}
在 Ansible 1.6.6 中尝试执行此操作时的错误消息:
错误:[DEPRECATED]:include + with_items 是已移除的弃用功能。请更新您的剧本。
如何将此剧本转换为适用于此 ansible 版本的内容?
【问题讨论】:
-
我错过了一些东西。
with_items在哪里。item来自哪里?
标签: deprecated ansible ansible-playbook