Я думаю, вам следует объединить java_cert
с with_fileglob
следующим образом:
- name: "Create my own truststore"
java_cert:
keystore_path: "mytrust.store"
keystore_pass: "changeit"
keystore_create: "yes"
state: "present"
cert_path: "{{ item }}"
with_fileglob:
- "{{ playbook_dir}}/certs/*.crt"