Bruno Wolff III d81a1f
---
Bruno Wolff III d81a1f
- hosts: localhost
Bruno Wolff III d81a1f
  vars:
Bruno Wolff III d81a1f
  - artifacts: ./artifacts
Bruno Wolff III d81a1f
  tags:
Bruno Wolff III d81a1f
  - classic
Bruno Wolff III d81a1f
  remote_user: root
Bruno Wolff III d81a1f
  tasks:
Bruno Wolff III d81a1f
  - name: Install the test files
Bruno Wolff III d81a1f
    copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }} mode=0755
Bruno Wolff III d81a1f
    with_items:
Bruno Wolff III d81a1f
    - {file: Squashfs-compression-test.sh, dest: Squashfs-compression-test.sh }
Bruno Wolff III d81a1f
  - name: Test block
Bruno Wolff III d81a1f
    block:
Bruno Wolff III d81a1f
      - name: Execute the tests
Bruno Wolff III d81a1f
        shell: |
Bruno Wolff III d81a1f
          /usr/local/bin/Squashfs-compression-test.sh &> /tmp/test.log; grep -iq failed /tmp/test.log && result=fail || result=pass
Bruno Wolff III d81a1f
          echo -e "results:\n- {result: $result, test: working}" > /tmp/results.yml
Bruno Wolff III d81a1f
    always:
Bruno Wolff III d81a1f
      - name: Pull out the logs
Bruno Wolff III d81a1f
        fetch:
Bruno Wolff III d81a1f
          dest: "{{ artifacts }}/"
Bruno Wolff III d81a1f
          src: "{{ item }}"
Bruno Wolff III d81a1f
          flat: yes
Bruno Wolff III d81a1f
        with_items:
Bruno Wolff III d81a1f
          - /tmp/test.log
Bruno Wolff III d81a1f
          - /tmp/results.yml