avoid-implicit¶
此规则识别危险的隐式行为的使用,这些行为通常也未被文档化。
此规则将产生以下类型的错误消息
avoid-implicit[copy-content]
不是字符串,因为 copy 模块也接受这些,但没有记录它们。
有问题的代码¶
---
- name: Example playbook
hosts: localhost
tasks:
- name: Write file content
ansible.builtin.copy:
content: { "foo": "bar" } # <-- should use explicit jinja template
dest: /tmp/foo.txt