Updated all templates to use instance variables

This commit is contained in:
Ossi Salmi 2013-05-05 00:07:55 +03:00
parent a0c854d3c0
commit dc51af1ca2
113 changed files with 527 additions and 522 deletions

View file

@ -1,15 +1,15 @@
<% if proto == 'dhcp' -%>
dhcp NONE NONE NONE<% options.each do |val| %> <%= val %><% end %>
<% elsif proto == 'none' -%>
<% if @proto == 'dhcp' -%>
dhcp NONE NONE NONE<% @options.each do |val| %> <%= val %><% end %>
<% elsif @proto == 'none' -%>
up
<% else -%>
inet <%= ipaddr %> <%= netmask %> NONE<% options.each do |val| %> <%= val %><% end %>
inet <%= @ipaddr %> <%= @netmask %> NONE<% @options.each do |val| %> <%= val %><% end %>
<% end -%>
<% if ip6addr == 'auto' -%>
<% if @ip6addr == 'auto' -%>
rtsol
<% elsif ip6addr != 'none' -%>
inet6 alias <%= ip6addr %> <%= ip6netmask %>
<% elsif @ip6addr != 'none' -%>
inet6 alias <%= @ip6addr %> <%= @ip6netmask %>
<% end -%>
<% postcmd.each do |val| -%>
<% @postcmd.each do |val| -%>
!<%= val %>
<% end -%>

View file

@ -1,4 +1,4 @@
inet 0.0.0.0 255.255.255.255 NONE pppoedev <%= device -%> authproto <%= authtype -%> authname '<%= username -%>' authkey '<%= password %>' up
inet 0.0.0.0 255.255.255.255 NONE pppoedev <%= @device -%> authproto <%= @authtype -%> authname '<%= @username -%>' authkey '<%= @password %>' up
dest 0.0.0.1
!/sbin/route -qn delete default
!/sbin/route add default -ifp pppoe0 0.0.0.1

View file

@ -1,33 +1,33 @@
DEVICE=<%= name %>
<% if name !~ /(bond|br)[0-9]/ && has_variable?("macaddress_" + name) -%>
DEVICE=<%= @name %>
<% if @name !~ /(bond|br)[0-9]/ && has_variable?("macaddress_" + name) -%>
HWADDR=<%= scope.lookupvar("macaddress_" + name) %>
<% end -%>
ONBOOT=yes
BOOTPROTO=<%= proto %>
<% if ipaddr != 'none' and ipaddr != 'dhcp' -%>
IPADDR=<%= ipaddr %>
<% if @ipaddr != 'none' and @ipaddr != 'dhcp' -%>
IPADDR=<%= @ipaddr %>
<% end -%>
<% if netmask != 'none' -%>
NETMASK=<%= netmask %>
<% if @netmask != 'none' -%>
NETMASK=<%= @netmask %>
<% end -%>
<% if proto == 'dhcp' -%>
<% if @proto == 'dhcp' -%>
DHCPCLASS=
PERSISTENT_DHCLIENT=yes
NOZEROCONF=yes
<% end -%>
<% if ip6addr == 'none' -%>
<% if @ip6addr == 'none' -%>
IPV6INIT=no
<% else -%>
IPV6INIT=yes
<% if ip6addr != 'auto' -%>
IPV6ADDR=<%= ip6addr %>/<%= ip6netmask %>
<% if @ip6addr != 'auto' -%>
IPV6ADDR=<%= ip6addr %>/<%= @ip6netmask %>
<% end -%>
<% end -%>
<% if name =~ /br[0-9]/ -%>
<% if @name =~ /br[0-9]/ -%>
TYPE=Bridge
DELAY=0
LINKDELAY=10
<% end -%>
<% options.each do |val| -%>
<% @options.each do |val| -%>
<%= val %>
<% end -%>

View file

@ -1,3 +1,3 @@
<% if gateway != 'none' -%>
gateway <%= gateway %>
<% if @gateway != 'none' -%>
gateway <%= @gateway %>
<% end -%>

View file

@ -1,22 +1,22 @@
auto <%= name %>
<% if proto == 'none' -%>
iface <%= name %> inet manual
auto <%= @name %>
<% if @proto == 'none' -%>
iface <%= @name %> inet manual
<% else -%>
iface <%= name %> inet <%= proto %>
iface <%= @name %> inet <%= @proto %>
<% end -%>
<% if ipaddr != 'none' and ipaddr != 'dhcp' -%>
address <%= ipaddr %>
<% if @ipaddr != 'none' and @ipaddr != 'dhcp' -%>
address <%= @ipaddr %>
<% end -%>
<% if netmask != 'none' -%>
netmask <%= netmask %>
<% if @netmask != 'none' -%>
netmask <%= @netmask %>
<% end -%>
<% if dnssearch != 'none' -%>
dns-search <%= dnssearch %>
<% if @dnssearch != 'none' -%>
dns-search <%= @dnssearch %>
<% end -%>
<% if dnsnameservers != 'none' -%>
dns-nameservers <%= dnsnameservers %>
<% if @dnsnameservers != 'none' -%>
dns-nameservers <%= @dnsnameservers %>
<% end -%>
<% options.each do |val| -%>
<% @options.each do |val| -%>
<%= val %>
<% end -%>

View file

@ -1,6 +1,6 @@
<% if gateway != "" -%>
<%= gateway %>
<% if @gateway != "" -%>
<%= @gateway %>
<% end -%>
<% if ipv6gateway != "" -%>
<%= ipv6gateway %>
<% if @ipv6gateway != "" -%>
<%= @ipv6gateway %>
<% end -%>

View file

@ -1,13 +1,13 @@
# <%= description %>
interface <%= name %>
# <%= @description %>
interface <%= @name %>
{
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
AdvHomeAgentFlag off;
prefix <%= prefix %>
prefix <%= @prefix %>
{
AdvOnLink on;
AdvAutonomous on;

View file

@ -1,3 +1,3 @@
ADDRESS0=<%= name.split('/')[0] %>
NETMASK0=<%= name.split('/')[1] %>
<% if gateway != "" %>GATEWAY0=<%= gateway %><% end %>
ADDRESS0=<%= @name.split('/')[0] %>
NETMASK0=<%= @name.split('/')[1] %>
<% if @gateway != "" %>GATEWAY0=<%= @gateway %><% end %>

View file

@ -1,4 +1,4 @@
# <%= description %>
<%= name %>:\
:addr="<%= prefix.split("/").first %>":":prefixlen#<%= prefix.split("/").last %>:raflags#8:
# <%= @description %>
<%= @name %>:\
:addr="<%= @prefix.split("/").first %>":":prefixlen#<%= @prefix.split("/").last %>:raflags#8:

View file

@ -3,12 +3,12 @@
# In the simple scenario, you want a single virtual IP address from the _same_
# network to be taken over by one of the routers.
VIP_ADDRESS="<%= ipaddr -%>"
SOURCE_ADDRESS="<%= ipaddress %>"
VIP_ADDRESS="<%= @ipaddr -%>"
SOURCE_ADDRESS="<%= @ipaddress %>"
# In more complex scenarios, check the "vip-common" file for values to override
# and how to add options.
PASSWORD="<%= password -%>"
PASSWORD="<%= @password -%>"
# Extra options.
OPTIONS="<% options.each do |val| -%> <%= val %><% end -%>"
OPTIONS="<% @options.each do |val| -%> <%= val %><% end -%>"