playbook中写循环,运行的时候有个警告
来源:2-7 使用playbook实战Python环境的安装
喵的薛定谔i
2018-12-19
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via
squash_actions is deprecated. Instead of using a loop to supply multiple items
and specifying `name: {{ item }}`, please use `name: [u'python-dev', u'python-
setuptools']` and remove the loop. This feature will be removed in version 2.11.
Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
- 这个在
yaml文件里面怎么改一下,可以不让他抛出这个警告呢?这样对么?
原来的是:
apt:
name: "{{ item }}"
state: latest
update_cache: yes
with_items:
- python-dev
- python-setuptools
改为:
apt:
name: [u'python-dev', u'python-setuptools']
state: latest
update_cache: yes
写回答
1回答
-
七寸法师
2018-12-20
嗯,看着没问题,实际运行有问题吗?
012018-12-20
相似问题