I just got warning raised by Ansible Lint.
This is the issue:
[no-jinja-when] [HIGH] No Jinja2 in when
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list: # or 'skip_list' to silence them completely
- no-jinja-when # No Jinja2 in when
This is my task:
- name: remove unecessary batch
file:
path: "{{ item.path }}"
state: absent
when: var_service == "service2" and item.path | regex_replace(cron_regex_for_s2_deletion, '\\1') not in batches_{{ var_fuction | regex_replace('^service2-batch-', '') }}
with_items: "{{ result.files }}"
I'm not sure how to fix the when
condition to fulfil Ansible lint recommendations.