When running the ansible playbook, i am providing the extra vars especially for modules variable where i am passing multiple values.
ansible-playbook abc.yml --extra-vars "status=enable modules='redis apache zookeeper'"
I want to run the below task when the modules in extra vars has "redis"
- name: fetch ports
shell: ll | grep -i "ports"
when: modules == "redis"
However, the above task is getting skipped even when the module in extra vars has "redis". Any help would be appreciated.