diff --git a/roles/validate-host/defaults/main.yaml b/roles/validate-host/defaults/main.yaml index 80ced4067..5a89d2e53 100644 --- a/roles/validate-host/defaults/main.yaml +++ b/roles/validate-host/defaults/main.yaml @@ -1,3 +1,4 @@ zuul_site_image_manifest_files: - /etc/dib-builddate.txt - /etc/image-hostname.txt +validate_host_hostname: "{{ inventory_hostname }}" diff --git a/roles/validate-host/tasks/main.yaml b/roles/validate-host/tasks/main.yaml index 98b252d25..98da1e931 100644 --- a/roles/validate-host/tasks/main.yaml +++ b/roles/validate-host/tasks/main.yaml @@ -13,10 +13,14 @@ setup: register: setupinfo +- name: Sanitize hostname + set_fact: + validate_host_hostname_sanitized: "{{ validate_host_hostname | replace('/', '_') }}" + - name: Write out all ansible variables/facts known for each host delegate_to: localhost template: - dest: "{{ zuul_info_dir }}/host-info.{{ inventory_hostname }}.yaml" + dest: "{{ zuul_info_dir }}/host-info.{{ validate_host_hostname_sanitized }}.yaml" src: templates/host-info.j2 - name: zuul_debug_info block @@ -31,7 +35,7 @@ - name: Write out all zuul information for each host delegate_to: localhost template: - dest: "{{ zuul_info_dir }}/zuul-info.{{ inventory_hostname }}.txt" + dest: "{{ zuul_info_dir }}/zuul-info.{{ validate_host_hostname_sanitized }}.txt" src: templates/zuul-info.j2 when: ansible_python_version is version('2.7', '>=') diff --git a/test-playbooks/base-roles/validate-host.yaml b/test-playbooks/base-roles/validate-host.yaml index 67e40da7e..88dcdb62f 100644 --- a/test-playbooks/base-roles/validate-host.yaml +++ b/test-playbooks/base-roles/validate-host.yaml @@ -11,3 +11,4 @@ roles: - role: validate-host zuul_site_traceroute_host: files.openstack.org + validate_host_hostname: "abc/123"