Fix zuul-jobs-test-upload-logs-s3 job
Since the security update we are not able to modify zuul.executor.log_root variable in the role testing. Replace this with explicit log folder creation on the test node. Change-Id: Ie6cff6f9e9c5594167ddda6cd345f9c3d9f2f470
This commit is contained in:
parent
2cedd93c02
commit
e7d7575eaf
@ -9,6 +9,10 @@
|
||||
block:
|
||||
# Use chmod instead of file because ansible 2.5 file with recurse and
|
||||
# follow can't really handle symlinks to .
|
||||
- name: debug var
|
||||
debug:
|
||||
msg: "log_root {{ zuul.executor.log_root }}"
|
||||
|
||||
- name: Ensure logs are readable before uploading
|
||||
delegate_to: "{{ _undocumented_test_worker_node_ | default('localhost') }}"
|
||||
command: "chmod -R u=rwX,g=rX,o=rX {{ zuul.executor.log_root }}/"
|
||||
|
@ -30,9 +30,14 @@
|
||||
aws_access_key: "{{ zuul_log_aws_access_key }}"
|
||||
aws_secret_key: "{{ zuul_log_aws_secret_key }}"
|
||||
|
||||
- name: Create tempdir to upload to s3
|
||||
tempfile:
|
||||
- name: Create Logdir
|
||||
become: true
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ zuul.executor.log_root }}"
|
||||
mode: "0755"
|
||||
group: "zuul"
|
||||
owner: "zuul"
|
||||
register: fake_zuul_logdir
|
||||
|
||||
- name: Add content to tempfile
|
||||
@ -40,19 +45,11 @@
|
||||
content: "{{ test_content }}"
|
||||
dest: "{{ fake_zuul_logdir.path }}/testfile"
|
||||
|
||||
- name: Save zuul variables
|
||||
set_fact:
|
||||
old_zuul: "{{ zuul }}"
|
||||
- name: Set simulated zuul variables
|
||||
set_fact:
|
||||
new_zuul: "{{ old_zuul | combine({'executor': {'log_root': fake_zuul_logdir.path}}, recursive=True) }}"
|
||||
|
||||
- name: Upload file to s3
|
||||
include_role:
|
||||
name: upload-logs-s3
|
||||
vars:
|
||||
upload_logs_s3_endpoint: 'http://localhost:9000'
|
||||
zuul: "{{ new_zuul }}"
|
||||
|
||||
- name: Download mc
|
||||
get_url:
|
||||
|
Loading…
Reference in New Issue
Block a user