fuel-plugin-contrail/deployment_scripts/puppet/modules/contrail/templates/ubuntu-ifcfg-vhost0.erb

20 lines
806 B
Plaintext

auto vhost0
iface vhost0 inet static
pre-up /opt/contrail/bin/if-vhost0
address <%= scope.lookupvar('contrail::address') %>/<%= scope.lookupvar('contrail::netmask_short') %>
network_name contrail
<% if scope.lookupvar('contrail::phys_dev_mtu') -%>
mtu <%= scope.lookupvar('contrail::phys_dev_mtu') -%>
<% end -%>
<% if scope.lookupvar('contrail::gateway') -%>
<% scope.lookupvar('contrail::gateways').each do |gw| -%>
post-up ip route add <%= gw %>/32 via <%= scope.lookupvar('contrail::gateway') %> dev vhost0
<% end -%>
<% scope.lookupvar('contrail::routes').each do |route| -%>
post-up ip route add <%= route['net'] %> via <%= route['via'] %> dev vhost0
<% end -%>
<% end -%>
<% if scope.lookupvar('contrail::compute_dpdk_enabled') -%>
post-up ip link set vhost0 address <%= @dpdk_dev_mac %>
<% end -%>