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:
Clark Boylan 2018-04-23 15:53:15 -07:00
parent df364a46e0
commit f27644c187
2 changed files with 8 additions and 0 deletions

View 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.

View File

@ -0,0 +1,5 @@
- name: Copy ansible inventory to logs dir
delegate_to: localhost
copy:
src: "{{ inventory_file }}"
dest: "{{ zuul_info_dir }}"