Hello,
I created a module for modifying the base network settings on a
machine. However no matter what changes I make it keeps giving me the
error "has different MAC address than expected, ignoring" when the
network tries to startup.
I am testing this out on the puppet learning VM.
Does anyone see anything wrong with my code:
init.pp
--------------------------
define basehost ($ipaddress, $gateway, $hostname, $environ,
$macaddress) {
file { 'hosts':
path => '/etc/hosts',
ensure => 'present',
owner => 'root',
group => 'root',
mode => '644',
content => template("basehost/hosts.erb"),
notify => Service[network],
}
file { 'resolv.conf':
path => '/etc/resolv.conf',
ensure => 'present',
owner => 'root',
group => 'root',
mode => '644',
content => template("basehost/resolv.conf.erb"),
notify => Service[network],
}
file { 'network':
path => '/etc/sysconfig/network',
ensure => 'present',
owner => 'root',
group => 'root',
mode => '644',
content => template("basehost/network.erb"),
notify => Service[network],
}
file { 'ifcfg-eth0':
path => '/etc/sysconfig/network-scripts/ifcfg-eth0',
ensure => 'present',
owner => 'root',
group => 'root',
mode => '644',
content => template("basehost/ifcfg-eth0.erb"),
notify => Service[network],
}
service { network:
ensure => "running",
hasstatus => "true",
hasrestart => "true",
restart => "/etc/init.d/network restart",
}
}
hosts.erb
----------------------------
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
<%= ipaddress %> <%= hostname %> <%= hostname %>.<%= environ
%>.mydomain.local manage.<%= environ %>.mydomain.net
::1 localhost6.localdomain6 localhost6
resolve.conf.erb
----------------
search <%= environ %>.mydomain.local
nameserver 10.180.0.2
nameserver 10.180.0.4
network.erb
------------------
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=<%= hostname %>.<%= environ %>.mydomain.local
GATEWAY=<%= gateway %>
ifcfg-eth0.erb
----------------
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
IPADDR=<%= ipaddress %>
NETMASK=255.255.255.0
ONBOOT=yes
HWADDR=<%= macaddress %>
Gets kicked off using:
basehost {'basehostsetup':
ipaddress => '10.148.0.32',
gateway => '10.148.0.1',
hostname => 'myhostname',
environ => 'test',
macaddress => '00:50:56:ac:40:8a',
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.