SHARE
TWEET

Untitled

a guest Jun 27th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. - name: Check if sys files Empty
  3.   command: if [ ! -s filenames/"{{ item }}"files ]; then echo "{{ item }}fileempty"; fi
  4.   register: checkempty
  5.   loop:
  6.     - sys
  7.     - wifi
  8.     - recoprop
  9.     - udfprop
  10.      
  11. ---
  12. - name: Copy sys Files to prod/stag
  13.   copy:
  14.     src: "{{ git_dest }}{{ git_sys_files }}{{ item }}/"
  15.     dest: "{{ copy_dest_sys }}" #destination path
  16.   loop: "{{ lookup('file', '/home/ansible/repo/hal_ansible/scripts/delta-reco/filenames/sysfiles').split('n')}}"
  17.   when: "{{ checkempty}}.stdout" == "sysfileempty"
  18.  
  19. - name: Copy wifi Files to prod/stag
  20.   copy:
  21.     src: "{{ git_dest }}{{ git_wifi_files }}{{ item }}/"
  22.     dest: "{{ copy_dest_wifi }}" #destination path
  23.   loop: "{{ lookup('file', '/home/ansible/repo/hal_ansible/scripts/delta-reco/filenames/wififiles').split('n')}}"
  24.   when: "{{ checkempty}}.stdout" == "wififileempty"
  25.  
  26. .....
  27.      
  28. ---
  29. - name: check if files are empty
  30.   hosts: localhost
  31.   become: no
  32.   vars_files:
  33.     - ../vars/recommendation-delta.yml
  34.   roles:
  35.     - ../roles/checkfiles
  36.  
  37. - name: Copy Files to prod/stag
  38.   hosts: "{{hosts_exec}}"
  39.   become: yes
  40.   vars_files:
  41.    - ../vars/recommendation-delta.yml
  42.   roles:
  43.    - ../roles/copy-reco-delta-test
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top