I am trying to have a block in Ansible which will invoke multiple playbooks using include if a specific flag is set. I am trying to achieve something similar to below:
- hosts: localhost
tasks:
- block:
- include: script1.yml
- include: script2.yml
- include: script3.yml
when: flag|bool
This snippet throws an error stating ERROR! unexpected parameter type in action: <type 'bool'>
Thanks in advance!