Use inventory_hostname and with_fileglob 
(https://docs.ansible.com/ansible/playbooks_loops.html#id4) to match the 
filenames, and use the file module to copy the respective files.

Something like :

- file: src={{item|basename}}.crt.pem dest=/etc/ssl/certs/{{item|basename}}.
crt.pem owner=root group=root mode=0644
  with_fileglob:
    - ../files/*.crt.pem
  when: item|basename == inventory_hostname


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d33e9d0d-abeb-4c66-a033-4f323937d8e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to