在Ansible角色中,我这样做:
- name: update trusted ca
shell: "{{ in_ca_dict[ansible_os_family]['update']['shell'] }}"
with:
package_name: ca-certificates
RedHat:
path:
6: /usr/local/share/ca-certificates
7: /etc/pki/ca-trust/source/anchors
update:
shell: /bin/update-ca-trust
Debian:
path: /usr/local/share/ca-certificates
update:
shell: /usr/sbin/update-ca-certificates
cache: "no"
但ansible-lint
告诉我molecule
:
[ANSIBLE0013] Use shell only when shell functionality is required
何时需要shell功能以及何时不需要?
如何替代方式,我的代码对我来说似乎很好。
答案 0 :(得分:4)