diff options
author | Markos Chandras <mchandras@suse.de> | 2018-05-16 15:59:23 +0100 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2018-05-16 16:37:19 +0100 |
commit | 1230e9c0fd38c8e9da3f65a245f737e99c122829 (patch) | |
tree | 42f67d22850d541be3f1b878b5b488c18dd631f9 /xci/playbooks/roles/bootstrap-host/templates/osa | |
parent | 8dc9f3a0d2c4db3bd9720966043dda0d2d4431bb (diff) |
xci: bootstrap-host: Fetch netmask information from IDF
The IDF file contains the netmask for every network so we should use
that information instead of using hardcoded values.
Change-Id: Ie798cb49563bdb72fdfb7b6e9e269692bf1f7bc9
Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/roles/bootstrap-host/templates/osa')
4 files changed, 10 insertions, 15 deletions
diff --git a/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 b/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 index 56db509b..3eddce45 100644 --- a/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 +++ b/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 @@ -25,14 +25,12 @@ iface {{ item.name }} inet static post-down ip link del br-vlan-veth || true bridge_ports br-vlan-veth {% endif %} -{% if item.ip is defined %} - address {{ item.ip }} +{% if item.network is defined %} + address {{ item.network.address | ipaddr('address') }} + netmask {{ item.network.address | ipaddr('netmask') }} {% endif %} -{% if item.prefix is defined %} - netmask {{ item.prefix }} -{% endif %} -{% if item.gateway is defined %} - gateway {{ item.gateway }} +{% if item.network is defined and item.network.gateway is defined %} + gateway {{ item.network.gateway | ipaddr('address') }} {% endif %} {% endif %} diff --git a/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 b/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 index d3364385..fa957764 100644 --- a/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 +++ b/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 @@ -14,9 +14,6 @@ TYPE=Bridge DELAY=0 STP=off {% endif %} -{% if item.ip is defined %} -IPADDR={{ item.ip }} -{% endif %} -{% if item.prefix is defined %} -PREFIX={{ item.prefix }} +{% if item.network is defined %} +IPADDR={{ item.network.address }} {% endif %} diff --git a/xci/playbooks/roles/bootstrap-host/templates/osa/suse.interface.j2 b/xci/playbooks/roles/bootstrap-host/templates/osa/suse.interface.j2 index 27b01eb4..70811a09 100644 --- a/xci/playbooks/roles/bootstrap-host/templates/osa/suse.interface.j2 +++ b/xci/playbooks/roles/bootstrap-host/templates/osa/suse.interface.j2 @@ -10,8 +10,8 @@ BRIDGE_FORWARDDELAY='0' BRIDGE_STP=off BRIDGE_PORTS={{ item.bridge_ports }} {% endif %} -{% if item.ip is defined %} -IPADDR={{ item.ip }} +{% if item.network is defined %} +IPADDR={{ item.network.address }} {% endif %} PRE_UP_SCRIPT="compat:suse:network-config-suse" POST_DOWN_SCRIPT="compat:suse:network-config-suse" diff --git a/xci/playbooks/roles/bootstrap-host/templates/osa/suse.routes.j2 b/xci/playbooks/roles/bootstrap-host/templates/osa/suse.routes.j2 index 7c868447..93941fad 100644 --- a/xci/playbooks/roles/bootstrap-host/templates/osa/suse.routes.j2 +++ b/xci/playbooks/roles/bootstrap-host/templates/osa/suse.routes.j2 @@ -1 +1 @@ -{{ item.route }} {{ item.gateway }} +{{ item.route }} {{ item.gateway | ipaddr('address') }} |