Actions
Bug #18906
closedAdd advanced jinja2 template example for main IP address
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:
Description
Add an example of template logic to chose an IP by interface name priority.
{%- if 'bond0' in vars.sys.interfaces %} # 'bond0' in vars.sys.interfaces {%- set my_ip = vars.sys['ipv4[bond0]'] %} {%- elif 'eth0' in vars.sys.interfaces %} # Found eth0 as default interface {%- set my_ip = vars.sys['ipv4[eth0]'] %} {%- else %} # Not found bond0 or eth0, using default sys.ipv4 {%- set my_ip = vars.sys.ipv4 %} {%- endif %}
Actions