834358541d
In Ansible-2.4, the |succeed behavior changed and always return True when task uses 'failed_when: false'. Also uses "type -p" instead of "which" that is used in other roles. Change-Id: Iddcff07a40dc6c36a1a1c2101a7822697cdbbc34
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
- name: Check for ARA db
|
|
stat:
|
|
path: "{{ zuul.executor.work_root }}/.ara/ansible.sqlite"
|
|
register: ara_db_stat
|
|
|
|
- name: Save the ARA database
|
|
command: |
|
|
cp "{{ zuul.executor.work_root }}/.ara/ansible.sqlite" \
|
|
{{ zuul.executor.log_root }}
|
|
when:
|
|
- ara_db_stat.stat.exists
|
|
- ara_save_database | bool
|
|
|
|
- name: Check for ARA install
|
|
command: bash -c "type -p ara"
|
|
ignore_errors: yes
|
|
register: ara_command_type
|
|
when: ara_db_stat.stat.exists
|
|
|
|
- when:
|
|
- ara_command_type.rc == 0
|
|
- not ara_command_type | skipped
|
|
block:
|
|
# Always generate (true), never (false) or only on failure ('failure')
|
|
# Additionally cover for edge cases where zuul_success might be undefined
|
|
- name: Generate ARA html output
|
|
command: "ara generate html {{ zuul.executor.log_root }}/ara"
|
|
ignore_errors: yes
|
|
when: ara_generate_html | bool or
|
|
(ara_generate_html == 'failure' and not zuul_success | default(false) | bool)
|
|
register: ara_generated
|
|
|
|
- name: Compress ARA html output
|
|
command: gzip --recursive --best {{ zuul.executor.log_root }}/ara
|
|
ignore_errors: yes
|
|
when:
|
|
- not ara_generated | skipped
|