hello Experts,
How to copy certain files in different servers (different location )to another remote server using ansible.
for example i have 5 application servers (A1,A2, A3, A4, A5), from theser servers i need to copy 2 files (file1.xml and file2.jks)
location of file1.xml for all 5 application servers are (/opt/IBM/myapp/plugins/file1.xml)
location of file2.jks for all 5 application servers are (/opt/IBM/myapp/security/file2.crt)
now i want to copy these 2 different files from all 5 application servers to my IHS servers 2 different location.
example: file1.xml of all 5 should got to IHS server's /opt/plugin folder
and file2.crt should go to IHS servers /opt/security directory.
I tried with some possible ways of playbook using delegate option but not getting succeded here.
---
- name: copy the certificates to the IHS server
hosts: A1
tasks:
- name: Transfer file from JTS to IHS
synchronize:
src: /opt/IBM/myapp/security/file2.crt
dest: /opt/security directory
mode: pull
delegate_to: IHSEnter code here...