diff options
author | Ian Wienand <iwienand@redhat.com> | 2022-08-31 14:50:19 +1000 |
---|---|---|
committer | Ian Wienand <iwienand@redhat.com> | 2022-09-14 11:19:40 +1000 |
commit | c54ccda1283cda500ec2e83be2b8769ce261fd7b (patch) | |
tree | 69977f65a6808cc6b1cf2cb824a38744adf5158c /playbooks | |
parent | c9fa64b4db2743e2c8716b2d41675e5c995ef34e (diff) | |
download | zuul-c54ccda1283cda500ec2e83be2b8769ce261fd7b.tar.gz |
zuul-stream: Add variable to disable writing streaming files
Upon further discussion we recently found another case of leaking
console streaming files; if the zuul_console is not running on port
19885, or can not be reached, the streaming spool files will still be
leaked.
The prior work in I823156dc2bcae91bd6d9770bd1520aa55ad875b4 has the
receiving side indicate to the zuul_console daemon that it should
remove the spool file.
If this doesn't happen, either because the daemon was never there, or
it is firewalled off, the streaming spool files are left behind.
This modifies the command action plugin to look for a variable
"zuul_console_disable" which will indicate to the library running the
shell/command task not to write out the spool file at all, as it will
not be consumed.
It is expected this would be set at a host level in inventory for
nodes that you know can not or will not have access to zuul_console
daemon.
We already have a mechanism to disable this for commands running in a
loop; we expand this with a new string type. The advantage of this is
it leaves the library/command.py side basically untouched.
Documentation is updated, and we cover this with a new test.
Change-Id: I0273993c3ece4363098e4bf30bfc4308bb69a8b4
Diffstat (limited to 'playbooks')
-rw-r--r-- | playbooks/zuul-stream/fixtures/test-stream.yaml | 8 | ||||
-rw-r--r-- | playbooks/zuul-stream/functional.yaml | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/playbooks/zuul-stream/fixtures/test-stream.yaml b/playbooks/zuul-stream/fixtures/test-stream.yaml index 0326ae54e..488f8cb2f 100644 --- a/playbooks/zuul-stream/fixtures/test-stream.yaml +++ b/playbooks/zuul-stream/fixtures/test-stream.yaml @@ -11,6 +11,14 @@ port: 19887 when: new_console | default(false) +- name: Run command to show skipping works + vars: + zuul_console_disabled: true + hosts: node + tasks: + - name: Run quiet command + command: echo 'This command should not stream' + - name: Run some commands to show that logging works hosts: node tasks: diff --git a/playbooks/zuul-stream/functional.yaml b/playbooks/zuul-stream/functional.yaml index b8a44a87c..1d03e650b 100644 --- a/playbooks/zuul-stream/functional.yaml +++ b/playbooks/zuul-stream/functional.yaml @@ -74,7 +74,7 @@ mv job-output.txt job-output-success-19885.txt mv job-output.json job-output-success-19885.json - - name: Validate outputs + - name: Validate text outputs include_tasks: validate.yaml loop: - { node: 'node1', filename: 'job-output-success-19887.txt' } @@ -82,6 +82,13 @@ - { node: 'node1', filename: 'job-output-success-19885.txt' } - { node: 'node2', filename: 'job-output-success-19885.txt' } + # This shows that zuul_console_disabled has activated and set the + # UUID to "skip" + - name: Validate json output + shell: | + egrep 'zuul_log_id": "skip"' job-output-success-19885.json + egrep 'zuul_log_id": "skip"' job-output-success-19887.json + # failure case - name: Run ansible playbook that should fail |