- name: Move artifacts and docs to logs dir when: zuul.change is defined delegate_to: localhost block: # Artifacts - name: Check if artifacts is empty find: paths: '{{ zuul.executor.work_root }}/artifacts' register: _artifacts - name: Copy artifacts into log root synchronize: src: '{{ zuul.executor.work_root }}/artifacts/' dest: '{{ zuul.exector.log_root }}/artifacts/' owner: no group: no when: _artifacts.files - name: Clean artifacts include_role: name: clean-directory vars: clean_directory_path: '{{ zuul.executor.work_root }}/artifacts/' when: _artifacts.files # Docs - name: Check if docs is empty find: paths: '{{ zuul.executor.work_root }}/docs' register: _docs - name: Copy docs into log root synchronize: src: '{{ zuul.executor.work_root }}/docs/' dest: '{{ zuul.exector.log_root }}/docs/' owner: no group: no when: _docs.files - name: Clean docs include_role: name: clean-directory vars: clean_directory_path: '{{ zuul.executor.work_root }}/docs/' when: _docs.files