emit-job-header: fix print node information
This task may be failing when ansible_hostname is not available: The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'ansible_hostname' Change-Id: I8d67d8aa284b6ce9ae012608e8f1b12784ce836b
This commit is contained in:
parent
dd9ebadd6e
commit
7766406431
@ -24,10 +24,11 @@
|
|||||||
debug:
|
debug:
|
||||||
msg: |
|
msg: |
|
||||||
# Node Information
|
# Node Information
|
||||||
Hostname: {{ hostvars[item]['ansible_hostname'] }}
|
Hostname: {{ hostvars[item]['ansible_hostname']|default('unknown') }}
|
||||||
Provider: {{ hostvars[item]['nodepool']['provider'] }}
|
Provider: {{ hostvars[item]['nodepool']['provider'] }}
|
||||||
Label: {{ hostvars[item]['nodepool']['label'] }}
|
Label: {{ hostvars[item]['nodepool']['label'] }}
|
||||||
{% if hostvars[item]['nodepool']['interface_ip'] is defined %}
|
{% if hostvars[item]['nodepool']['interface_ip'] is defined %}
|
||||||
Interface IP: {{ hostvars[item]['nodepool']['interface_ip'] }}
|
Interface IP: {{ hostvars[item]['nodepool']['interface_ip'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
loop: "{{ query('inventory_hostnames', 'all,!localhost') }}"
|
loop: "{{ query('inventory_hostnames', 'all,!localhost') }}"
|
||||||
|
ignore_errors: yes
|
||||||
|
Loading…
Reference in New Issue
Block a user