Merged in oherrala/puppet (pull request #2)
This commit is contained in:
commit
8418c2c557
2 changed files with 13 additions and 11 deletions
|
@ -230,22 +230,21 @@ define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
|
||||||
# $device:
|
# $device:
|
||||||
# Interface to use for this route.
|
# Interface to use for this route.
|
||||||
#
|
#
|
||||||
define network::route($gateway = "NONE", $device, $ipv6gateway = "") {
|
define network::route($gateway = "", $device, $ipv6gateway = "") {
|
||||||
|
|
||||||
case $name {
|
case $name {
|
||||||
"default": {
|
"default": {
|
||||||
if "${gateway}" == "NONE" {
|
|
||||||
fail("Cannot set empty gateway for default route.")
|
|
||||||
}
|
|
||||||
case $operatingsystem {
|
case $operatingsystem {
|
||||||
centos,fedora: {
|
centos,fedora: {
|
||||||
include network::helper::restart
|
include network::helper::restart
|
||||||
augeas { "set-default-route":
|
if "${gateway}" != "" {
|
||||||
context => "/files/etc/sysconfig/network",
|
augeas { "set-default-route":
|
||||||
changes => [ "set GATEWAY ${gateway}",
|
context => "/files/etc/sysconfig/network",
|
||||||
"set GATEWAYDEV ${device}", ],
|
changes => [ "set GATEWAY ${gateway}",
|
||||||
notify => Exec["restart-network"],
|
"set GATEWAYDEV ${device}", ],
|
||||||
}
|
notify => Exec["restart-network"],
|
||||||
|
}
|
||||||
|
}
|
||||||
if "${ipv6gateway}" != "" {
|
if "${ipv6gateway}" != "" {
|
||||||
augeas { "set-default-ipv6-route":
|
augeas { "set-default-ipv6-route":
|
||||||
context => "/files/etc/sysconfig/network",
|
context => "/files/etc/sysconfig/network",
|
||||||
|
@ -284,6 +283,9 @@ define network::route($gateway = "NONE", $device, $ipv6gateway = "") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
if ipv6gateway != "" {
|
||||||
|
fail("Custom IPv6 routes not supported yet.")
|
||||||
|
}
|
||||||
case $operatingsystem {
|
case $operatingsystem {
|
||||||
"fedora","centos": {
|
"fedora","centos": {
|
||||||
include network::helper::restart
|
include network::helper::restart
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
ADDRESS0=<%= name.split('/')[0] %>
|
ADDRESS0=<%= name.split('/')[0] %>
|
||||||
NETMASK0=<%= name.split('/')[1] %>
|
NETMASK0=<%= name.split('/')[1] %>
|
||||||
<% if gateway != "NONE" %>GATEWAY0=<%= gateway %><% end %>
|
<% if gateway != "" %>GATEWAY0=<%= gateway %><% end %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue