Split logging of inventory to its own role
The ability to read and write the inventory is privileged and requires you are running in a trusted context. This makes testing the validate-host role difficult as it reads the inventory file and writes it to the job log dir. Make a new role called log-inventory that will allow us to eventually remove this task from validate-host enabling better testing of validate host. Also this will allow us to log the inventory in the post-run logging activity. Change-Id: I4098fd140484bc54dc95b5f4c51afb1c56c7b19c
This commit is contained in:
parent
df364a46e0
commit
f27644c187
3
roles/log-inventory/README.rst
Normal file
3
roles/log-inventory/README.rst
Normal file
@ -0,0 +1,3 @@
|
||||
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.
|
5
roles/log-inventory/tasks/main.yaml
Normal file
5
roles/log-inventory/tasks/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
- name: Copy ansible inventory to logs dir
|
||||
delegate_to: localhost
|
||||
copy:
|
||||
src: "{{ inventory_file }}"
|
||||
dest: "{{ zuul_info_dir }}"
|
Loading…
Reference in New Issue
Block a user