How to run Ansible command to update imunify360 settings How can I use Ansible to run the following CloudLinux Imunify360 commands properly on CloudLinux 7 (similar to CentOS7)?
I tried different ways to "escape" the colons in the commands and it doesn't run properly, even when a YAML syntax checker showed it's correct.

imunify360-agent config update '{"MALWARE_SCANNING": {"rapid_scan": true}}'
imunify360-agent config update '{"MALWARE_SCANNING": {"default_action": "cleanup"}, "MALWARE_SCAN_SCHEDULE":{"interval": "week"}}'
imunify360-agent config update '{"MALWARE_SCANNING": {"enable_scan_inotify": true}}'


from:
https://blog.imunify360.com/new-default-settings-for-imunify360

Note: Imunify360 has a free trial.
It turns out single quote works where double quote and backslash didn't.


- name: Enable rapid scan
  command: imunify360-agent config update '{"MALWARE_SCANNING"':' {"rapid_scan"':' true}}'



I learned that folding block scalar (>) is an easy alternative and a good way to avoid escaping.