Skip to content

Commit

Permalink
Fix typo in interface variable. Use ipaddress rather than ipaddr. Res…
Browse files Browse the repository at this point in the history
…tart the network service if we change the interface config file
  • Loading branch information
erwbgy committed Feb 11, 2013
1 parent bbfd5da commit 99fed64
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions manifests/network/interface.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
define system::network::interface (
$dhcp = undef,
$hwaddr = undef,
$hotplug = true,
$ipaddr = undef,
$netmask = undef,
$onboot = true,
$routes = undef,
$type = 'Ethernet',
$dhcp = undef,
$hwaddr = undef,
$hotplug = true,
$ipaddress = undef,
$netmask = undef,
$onboot = true,
$routes = undef,
$type = 'Ethernet',
) {
$_interface = $title
if $dhcp == undef {
Expand All @@ -21,22 +21,23 @@
$_hwaddr = $hwaddr
}
else {
$_hwaddr = scope.lookupvar("macaddress_${interface}")
$_hwaddr = inline_template("<%= scope.lookupvar('macaddress_${_interface}') %>")
}
$_hotplug = $hotplug
$_ipaddr = $ipaddr
$_ipaddr = $ipaddress
$_netmask = $netmask
$_onboot = $onboot
$_type = $type
file { "/etc/sysconfig/network-scripts/ifcfg-${interface}":
ensure => present,
owner => 'root',
group => 'root'
mode => '0644',
content => template('system/network/interface.erb')
file { "/etc/sysconfig/network-scripts/ifcfg-${_interface}":
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
content => template('system/network/interface.erb'),
notify => Class['system::network::service'],
}
if $routes {
concat { "/etc/sysconfig/network-scripts/route-${interface}":
concat { "/etc/sysconfig/network-scripts/route-${_interface}":
owner => 'root',
group => 'root',
mode => '0644',
Expand Down

0 comments on commit 99fed64

Please sign in to comment.