CI for the TripleO project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

post.yaml 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. - hosts: primary
  2. tasks:
  3. - name: Include common vars
  4. include_vars:
  5. file: "common.yaml"
  6. - name: Grab job artifacts
  7. become: true
  8. args:
  9. chdir: "{{ workspace }}"
  10. shell: |
  11. set -x
  12. mkdir -p {{ workspace }}/conf/
  13. mkdir -p {{ workspace }}/logs/system
  14. mkdir -p {{ workspace }}/etc/docker
  15. mv *.conf {{ workspace }}/conf/
  16. mv *.log {{ workspace }}/logs/
  17. rsync -var --no-links /var/log/ {{ workspace }}/logs/system/ || true
  18. rsync -var --no-links /etc/docker/ {{ workspace }}/etc/docker/ || true
  19. gzip -r "{{ workspace }}/logs" "{{ workspace }}/conf" "{{ workspace }}/etc"
  20. chmod -R a+r "{{ workspace }}"
  21. chown -R {{ ansible_user }}: "{{ workspace }}"
  22. - name: Rename compressed text based files to end with txt.gz extension
  23. become: true
  24. shell: >
  25. set -o pipefail &&
  26. find {{ workspace }}/logs {{ workspace }}/conf {{ workspace }}/etc -type f |
  27. awk 'function rename(orig)
  28. { new=orig; sub(/\.gz$/, ".txt.gz", new); system("mv " orig " " new) }
  29. /\.(conf|ini|json|sh|log|yaml|yml|repo|cfg|j2|py)\.gz$/ { rename($0) }
  30. /(\/logs\/|\/etc\/)[^ \/\.]+\.gz$/ { rename($0) }';
  31. - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
  32. #no_log: true
  33. synchronize:
  34. src: '{{ ansible_user_dir }}/workspace/'
  35. dest: '{{ zuul.executor.log_root }}'
  36. mode: pull
  37. copy_links: true
  38. verify_host: true
  39. rsync_opts:
  40. - --include=/etc/**
  41. - --include=/conf/**
  42. - --include=/logs/**
  43. - --include=*/
  44. - --exclude=*
  45. - --prune-empty-dirs