Open Praveenm8672 opened 11 months ago
hosts: app tasks:
name: Fetch the file from the mwiapp01 to master run_once: yes fetch: src=/tmp/app01-to-app02.jar dest=buffer/ flat=yes when: "{{ inventory_hostname == 'mwiapp01' }}"
name: Copy the file from master to mwiapp02 copy: src=buffer/app01-to-app02.jar dest=/tmp/ when: "{{ inventory_hostname == 'mwiapp02' }}"
name: Fetch the files from the mwiapp01 to master run_once: yes fetch: src=/tmp/app01 dest=buffer/ flat=yes when: "{{ inventory_hostname == 'mwiapp02' }}"
name: copy the file from master to mwiapp02 copy: src=buffer/ dest=/tmp/ when: "{{ inventory_hostname == 'mwiapp02' }}"
ansible basics
hosts: app tasks:
name: Fetch the file from the mwiapp01 to master run_once: yes fetch: src=/tmp/app01-to-app02.jar dest=buffer/ flat=yes when: "{{ inventory_hostname == 'mwiapp01' }}"
name: Copy the file from master to mwiapp02 copy: src=buffer/app01-to-app02.jar dest=/tmp/ when: "{{ inventory_hostname == 'mwiapp02' }}"
hosts: app tasks:
name: Fetch the files from the mwiapp01 to master run_once: yes fetch: src=/tmp/app01 dest=buffer/ flat=yes when: "{{ inventory_hostname == 'mwiapp02' }}"
name: copy the file from master to mwiapp02 copy: src=buffer/ dest=/tmp/ when: "{{ inventory_hostname == 'mwiapp02' }}"