Switch to using setup instead of hostvars
hostvars can potentially leak secrets. setup doesn't, and records what we're interested in, which is the information ansible knows about the remote host. Change-Id: Ice585cb3beddf4e3ecc1e692ecf4e7da8c5754b8
This commit is contained in:
parent
2dfb08a49e
commit
c00eca3f15
@ -1,3 +1 @@
|
|||||||
Output all of the Ansible variables for the host
|
Log information about the remote build host
|
||||||
|
|
||||||
This is unsafe to run in Trusted jobs as it will write any secrets to the log.
|
|
||||||
|
@ -8,11 +8,15 @@
|
|||||||
path: "{{ zuul_info_dir }}"
|
path: "{{ zuul_info_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: Collect information about the host
|
||||||
|
setup:
|
||||||
|
register: setupinfo
|
||||||
|
|
||||||
- name: Write out all ansible variables/facts known for each host
|
- name: Write out all ansible variables/facts known for each host
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
template:
|
template:
|
||||||
dest: "{{ zuul_info_dir }}/ansible-hostvars.{{ inventory_hostname }}.yaml"
|
dest: "{{ zuul_info_dir }}/host-info.{{ inventory_hostname }}.yaml"
|
||||||
src: templates/ansible-hostvars.j2
|
src: templates/host-info.j2
|
||||||
|
|
||||||
- name: Collect information about zuul worker
|
- name: Collect information about zuul worker
|
||||||
zuul_debug_info:
|
zuul_debug_info:
|
||||||
|
@ -1 +0,0 @@
|
|||||||
{{ hostvars[inventory_hostname] | to_nice_yaml(indent=2) }}
|
|
1
roles/validate-host/templates/host-info.j2
Normal file
1
roles/validate-host/templates/host-info.j2
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{ setupinfo | to_nice_yaml(indent=2) }}
|
Loading…
Reference in New Issue
Block a user