playbooks: configure-opnfvhost: Ensure we copy only the tracked files 63/61663/8
authorMarkos Chandras <mchandras@suse.de>
Fri, 31 Aug 2018 12:33:40 +0000 (13:33 +0100)
committerMarkos Chandras <mchandras@suse.de>
Tue, 4 Sep 2018 07:26:40 +0000 (07:26 +0000)
This prevents rsync spending time copying temporary files which may have
been created during a CI run.

deploy-scenario:os-nosdn-nofeature
installer-type:osa

Change-Id: Ie02e0dbfc06b8fac40d6b90c4c99e361ecf1c0b2
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/installer/kubespray/playbooks/configure-opnfvhost.yml
xci/installer/osa/playbooks/configure-opnfvhost.yml

index 36104b6..82ece96 100644 (file)
       configure_network: xci_flavor != 'aio'
 
   tasks:
+    - name: Create list of files to copy
+      shell: |
+          git ls-tree -r --name-only HEAD > {{ xci_cache }}/releng-xci.files
+          echo ".git/" >> {{ xci_cache }}/releng-xci.files
+          echo ".cache/repos/" >> {{ xci_cache }}/releng-xci.files
+          echo ".cache/xci.env" >> {{ xci_cache }}/releng-xci.files
+      args:
+        executable: /bin/bash
+        chdir: "{{ xci_path }}"
+      changed_when: False
+      delegate_to: 127.0.0.1
+      tags:
+        - skip_ansible_lint
+
     - name: Copy releng-xci to remote host
       synchronize:
+        archive: yes
         src: "{{ xci_path }}/"
         dest: "{{ remote_xci_path }}"
-        recursive: yes
         delete: yes
+        rsync_opts:
+          - "--recursive"
+          - "--files-from={{ xci_cache }}/releng-xci.files"
 
     - name: delete the opnfv_inventory directory
       file:
index 768b656..4fc966a 100644 (file)
       proxy_settings_no_proxy: "{{ lookup('env','no_proxy') }}"
 
   tasks:
+    - name: Create list of files to copy
+      shell: |
+          git ls-tree -r --name-only HEAD > {{ xci_cache }}/releng-xci.files
+          echo ".git/" >> {{ xci_cache }}/releng-xci.files
+          echo ".cache/repos/" >> {{ xci_cache }}/releng-xci.files
+          echo ".cache/xci.env" >> {{ xci_cache }}/releng-xci.files
+      args:
+        executable: /bin/bash
+        chdir: "{{ xci_path }}"
+      changed_when: False
+      delegate_to: 127.0.0.1
+      tags:
+        - skip_ansible_lint
+
     - name: Copy releng-xci to remote host
       synchronize:
+        archive: yes
         src: "{{ xci_path }}/"
         dest: "{{ remote_xci_path }}"
-        recursive: yes
         delete: yes
+        rsync_opts:
+          - "--recursive"
+          - "--files-from={{ xci_cache }}/releng-xci.files"
 
     - name: Re-create OpenStack-Ansible /etc directory
       file: