所以看起来这个功能已经被弃用了,我真的不明白为什么,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 中执行此操作时出现错误消息:
错误:[已弃用]:include + with_items 是已删除的弃用功能。请更新您的剧本。
我怎样才能将此剧本转换为适用于此 ansible 版本的内容?