Well it seems that ansible does a pre checks of include before it run the function parse_yaml_from_file
is called and that fails if no file is on FS
As a workaround you can use the following code, but you might want to report that on Ansible github as a feature request.
Please create a dummy.yml under the directory action for the code below to work touch action/dummy.yml
---
- hosts: all
gather_facts: no
vars:
action : ""
dummy : "{{ action if action in validAction else 'dummy' }}"
validAction : ["action1","action2","action3","action4"]
tasks:
- include: "action/{{dummy}}.yml"