In a Ansible role, I do this:
- 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"
but ansible-lint
tells me through molecule
:
[ANSIBLE0013] Use shell only when shell functionality is required
When should shell functionality is required and when is it not required ?
How should be the alternate way, my code seems fine to me.
I just replaced
shell:
with
command:
Here is the doc: https://blog.confirm.ch/ansible-modules-shell-vs-command/
And I solved this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With