Merge "run-production-playbook: return encrypted logs"

This commit is contained in:
Zuul 2022-02-21 00:29:57 +00:00 committed by Gerrit Code Review
commit 65b20bc8d5
3 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,4 @@
# NOTE(ianw): 2022-02-16 : comment to trigger prod run
- hosts: "codesearch:!disabled"
name: "Configure codesearch"
roles:

View File

@ -26,6 +26,40 @@
always:
- name: Encrypt log
when: infra_prod_playbook_encrypt_log
block:
- name: Create temp dir for download script
tempfile:
state: directory
register: _download_tmpdir
- name: Encrypt logs
include_role:
name: encrypt-logs
vars:
encrypt_logs_files:
- '/var/log/ansible/{{ playbook_name }}.log'
# Artifact in root directory
encrypt_logs_artifact_path: ''
encrypt_logs_download_script_path: '{{ _download_tmpdir.path }}'
- name: Return logs
synchronize:
src: '{{ item[0] }}'
dest: '{{ item[1] }}'
mode: pull
verify_host: true
loop:
- [ '{{ zuul.executor.log_root }}/{{ playbook_name }}.log.gpg }}', '/var/log/ansible/{{ playbook_name }}.log.gpg' ]
- [ '{{ zuul.executor.log_root }}/download-gpg-logs.sh }}', '{{ _download_tmpdir.path }}/download-logs.sh }}' ]
- name: Remove tmpdir
file:
path: '{{ _download_tmpdir.path }}'
state: absent
# Not using normal zuul job roles as bridge.openstack.org is not a
# test node with all the normal bits in place.
- name: Collect log output

View File

@ -506,6 +506,7 @@
description: Run service-codesearch.yaml playbook.
vars:
playbook_name: service-codesearch.yaml
infra_prod_playbook_encrypt_log: True
files:
- docker/hound/
- inventory/base