Merge "Make validate-host read from site-variables"
This commit is contained in:
commit
579d9f2202
@ -3,6 +3,7 @@ An ansible role to configure services to use mirrors.
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: mirror_fqdn
|
||||
:default: {{ zuul_site_mirror_fqdn }}
|
||||
|
||||
The base host for mirror servers.
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
mirror_fqdn: "{{ zuul_site_mirror_fqdn|default(omit) }}"
|
||||
pypi_mirror: "http://{{ mirror_fqdn }}/pypi/simple"
|
||||
wheel_mirror: "http://{{ mirror_fqdn }}/wheel/{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}-{{ ansible_architecture | lower }}"
|
||||
|
@ -1 +1,32 @@
|
||||
Log information about the remote build host
|
||||
Log information about the build node
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: zuul_traceroute_host
|
||||
:default: {{ zuul_site_traceroute_host }}
|
||||
|
||||
If defined, a host to run a traceroute against to verify build node
|
||||
network connectivity.
|
||||
**DEPRECATED** being replaced by zuul_site versions.
|
||||
|
||||
.. zuul:rolevar:: zuul_image_manifest
|
||||
:default: {{ zuul_site_image_manifest|default('/etc/dib-builddate.txt') }}
|
||||
|
||||
A file expected to be on the filesystem of the build node to read if it
|
||||
exists and log. The default value comes from a site-variable called
|
||||
``zuul_site_image_manifest``, but if that is not set
|
||||
``/etc/dib-builddate.txt`` is used, which is written to nodes by
|
||||
diskimage-builder in the ``nodepool-base`` element.
|
||||
**DEPRECATED** being replaced by zuul_site versions.
|
||||
|
||||
.. zuul:rolevar:: zuul_site_traceroute_host
|
||||
|
||||
If defined, a host to run a traceroute against to verify build node
|
||||
network connectivity.
|
||||
|
||||
.. zuul:rolevar:: zuul_site_image_manifest_files
|
||||
:default: ['/etc/dib-builddate.txt', '/etc/image-hostname.txt']
|
||||
|
||||
A list of files to read from the filesystem of the build node and
|
||||
whose contents will be logged. The default files are files written
|
||||
to nodes by diskimage-builder.
|
||||
|
3
roles/validate-host/defaults/main.yaml
Normal file
3
roles/validate-host/defaults/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
zuul_site_traceroute_host: "{{ zuul_traceroute_host|default(omit) }}"
|
||||
zuul_site_image_manifest: "{{ validate_host_default_image_manifest_files }}"
|
||||
zuul_site_image_manifest_files: "{{ zuul_site_image_manifest_files|default(validate_host_default_image_manifest_files) }}"
|
@ -42,16 +42,26 @@ def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
image_manifest=dict(required=False, type='str'),
|
||||
image_manifest_files=dict(required=False, type='list'),
|
||||
traceroute_host=dict(required=False, type='str'),
|
||||
)
|
||||
)
|
||||
|
||||
image_manifest = module.params['image_manifest']
|
||||
traceroute_host = module.params['traceroute_host']
|
||||
ret = {'image_manifest': None, 'traceroute': None}
|
||||
image_manifest_files = module.params['image_manifest_files']
|
||||
if not image_manifest_files and image_manifest:
|
||||
image_manifest_files = [image_manifest]
|
||||
ret = {'image_manifest_files': [], 'traceroute': None}
|
||||
|
||||
if image_manifest and os.path.exists(image_manifest):
|
||||
ret['image_manifest'] = open(image_manifest, 'r').read()
|
||||
for image_manifest in image_manifest_files:
|
||||
if image_manifest and os.path.exists(image_manifest):
|
||||
ret['image_manifest_files'].append({
|
||||
'filename': image_manifest,
|
||||
# Do this in python cause it's easier than in jinja2
|
||||
'underline': len(image_manifest) * '-',
|
||||
'content': open(image_manifest, 'r').read(),
|
||||
})
|
||||
if traceroute_host:
|
||||
passed = False
|
||||
try:
|
||||
|
@ -21,8 +21,9 @@
|
||||
|
||||
- name: Collect information about zuul worker
|
||||
zuul_debug_info:
|
||||
image_manifest: "{{ zuul_image_manifest|default(omit) }}"
|
||||
traceroute_host: "{{ zuul_traceroute_host|default(omit) }}"
|
||||
image_manifest: "{{ zuul_site_image_manifest|default(omit) }}"
|
||||
image_manifest_files: "{{ zuul_site_image_manifest_files|default(omit) }}"
|
||||
traceroute_host: "{{ zuul_site_traceroute_host|default(omit) }}"
|
||||
register: zdi
|
||||
|
||||
- name: Write out all zuul information for each host
|
||||
|
@ -1,46 +1,51 @@
|
||||
{% if 'image_manifest' in zdi %}
|
||||
{% if zdi.image_manifest_files %}
|
||||
Image Information
|
||||
=================
|
||||
{{ zdi.image_manifest }}
|
||||
{% endif %}
|
||||
|
||||
{% for item in zdi.image_manifest_files %}
|
||||
{{ item.filename }}
|
||||
{{ item.underline }}
|
||||
{{ item.content }}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
{% if 'uname' in zdi %}
|
||||
Host & kernel
|
||||
=============
|
||||
{{ zdi.uname }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% if 'network_interfaces' in zdi %}
|
||||
Network interface addresses
|
||||
===========================
|
||||
{{ zdi.network_interfaces }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% if 'network_routing_v4' in zdi %}
|
||||
Network routing tables v4
|
||||
=========================
|
||||
{{ zdi.network_routing_v4 }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% if 'network_routing_v6' in zdi %}
|
||||
Network routing tables v6
|
||||
=========================
|
||||
{{ zdi.network_routing_v6 }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% if 'network_neighbors' in zdi %}
|
||||
Network neighbors
|
||||
=================
|
||||
{{ zdi.network_neighbors }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% if 'traceroute_v4' in zdi %}
|
||||
Route to Known Host v4
|
||||
======================
|
||||
Known Host: {{ zuul_traceroute_host }}
|
||||
{{ zdi.traceroute_v4 }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% if 'traceroute_v6' in zdi %}
|
||||
Route to Known Host v6
|
||||
======================
|
||||
|
3
roles/validate-host/vars/main.yaml
Normal file
3
roles/validate-host/vars/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
validate_host_default_image_manifest_files:
|
||||
- /etc/dib-builddate.txt
|
||||
- /etc/image-hostname.txt
|
Loading…
Reference in New Issue
Block a user