2021-05-31 09:42:02 -07:00
|
|
|
- hosts: all
|
|
|
|
tasks:
|
|
|
|
- name: Write a test file
|
|
|
|
copy:
|
|
|
|
content: "Test file"
|
|
|
|
dest: "/tmp/test-output.txt"
|
2022-08-31 13:10:18 -07:00
|
|
|
- name: Write a second test file
|
|
|
|
copy:
|
|
|
|
content: "Second test file"
|
2022-09-06 16:15:15 -07:00
|
|
|
dest: "/tmp/test-output.something.log"
|
2022-08-31 13:10:18 -07:00
|
|
|
- name: Test stage-output with explicit files
|
2021-05-31 09:42:02 -07:00
|
|
|
include_role:
|
|
|
|
name: stage-output
|
|
|
|
vars:
|
|
|
|
zuul_copy_output:
|
|
|
|
/tmp/test-output.txt: logs
|
2022-09-06 16:15:15 -07:00
|
|
|
/tmp/test-output.something.log: logs
|
2022-08-31 13:10:18 -07:00
|
|
|
extensions_to_txt:
|
|
|
|
log: true
|
|
|
|
txt: false
|
|
|
|
- name: Check the file was renamed
|
|
|
|
stat:
|
2022-09-06 16:15:15 -07:00
|
|
|
path: /home/zuul/logs/test-output.something_log.txt
|
2022-08-31 13:10:18 -07:00
|
|
|
register: renamed_file_stat
|
|
|
|
- name: Fail if file was not renamed
|
|
|
|
fail:
|
|
|
|
msg: "Renamed test-output log file does not exist."
|
|
|
|
when: not renamed_file_stat.stat.exists
|
2021-05-31 09:42:02 -07:00
|
|
|
- name: Test stage-output with no input
|
|
|
|
include_role:
|
|
|
|
name: stage-output
|
|
|
|
- name: Remove sudo
|
|
|
|
include_role:
|
|
|
|
name: revoke-sudo
|
|
|
|
- name: Test stage-output without sudo
|
|
|
|
include_role:
|
|
|
|
name: stage-output
|