diff --git a/roles/log-inventory/README.rst b/roles/log-inventory/README.rst index ea7b523f9..ffc7244ce 100644 --- a/roles/log-inventory/README.rst +++ b/roles/log-inventory/README.rst @@ -1,3 +1,10 @@ Log the inventory used to run the job to the job's log dir. This will result in the log collection roles logging the job inventory. + +**Role Variables** + +.. zuul:rolevar:: zuul_info_dir + :default: {{ zuul.executor.log_root }}/zuul-info + + The directory path to store the inventory file. diff --git a/roles/log-inventory/defaults/main.yaml b/roles/log-inventory/defaults/main.yaml new file mode 100644 index 000000000..bbfd07069 --- /dev/null +++ b/roles/log-inventory/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +zuul_info_dir: "{{ zuul.executor.log_root }}/zuul-info" diff --git a/roles/log-inventory/tasks/main.yaml b/roles/log-inventory/tasks/main.yaml index e3dad5544..3f8572c55 100644 --- a/roles/log-inventory/tasks/main.yaml +++ b/roles/log-inventory/tasks/main.yaml @@ -1,3 +1,10 @@ +- name: Ensure Zuul Ansible directory exists + delegate_to: localhost + run_once: true + file: + path: "{{ zuul_info_dir }}" + state: directory + - name: Copy ansible inventory to logs dir delegate_to: localhost copy: