Hi all,
I am trying to use the sysctl module from the wiki. I got it to work
as expected and documented my results here:
http://reductivelabs.com/trac/puppet/wiki/Recipes/sysctl
This gives me the ''sysctl'' resource type.
I am trying to have a subset of my nodes inherit the common config,
but override one of the settings, very similar to the contrived
example given here:
http://reductivelabs.com/trac/puppet/wiki/PuppetIntroduction#classes
Here are my class definitions (I''m writing a module called
''pgfi''):
class pgfi::sysctl {
sysctl { "net.ipv4.icmp_echo_ignore_broadcasts": val =>
"1", }
sysctl { "net.ipv4.conf.all.accept_redirects": val =>
"0", }
sysctl { "net.ipv4.conf.all.send_redirects": val =>
"0", }
sysctl { "net.ipv4.icmp_ignore_bogus_error_responses": val =>
"1", }
sysctl { "net.ipv4.conf.all.log_martians": val => "1",
}
sysctl { "net.ipv4.conf.all.proxy_arp": val => "0", }
}
class pgfi::sysctl::gpfs inherits pgfi::sysctl {
#for GPFS, from the Deployment Guide
# increase Linux TCP buffer limits
sysctl { "net.core.rmem_max": val => "8388608", }
sysctl { "net.core.wmem_max": val => "8388608", }
# increase default and maximum Linux TCP buffer sizes
sysctl { "net.ipv4.tcp_rmem": val => "4096 262144
8388608", }
sysctl { "net.ipv4.tcp_wmem": val => "4096 262144
8388608", }
# increase max backlog to avoid dropped packets
sysctl { "net.core.netdev_max_backlog": val => "2500",
}
}
class pgfi::sysctl::gpfs::ten_gige inherits pgfi::sysctl::gpfs {
sysctl {"net.core.netdev_max_backlog": val => "30000",
}
}
So you see that pgfi::sysctl::gpfs just adds additional settings on
top of pgfi::sysctl, without overriding anything. In the next one,
though, I want to override the settings and I get this error from
puppetd:
err: Could not retrieve catalog: Puppet::Parser::AST::Resource failed
with error ArgumentError: Duplicate definition:
Sysctl[net.core.netdev_max_backlog] is already defined in file /etc/
puppet/modules/pgfi/manifests/init.pp at line 91; cannot redefine at /
etc/puppet/modules/pgfi/manifests/init.pp:95 on node my_fqdn
If I capitalize the first letter of Sysctl type as in the contrived
example, I get this error:
err: Could not retrieve catalog: Syntax error at
''net.core.netdev_max_backlog''; expected ''}''
at /etc/puppet/modules/
pgfi/manifests/init.pp:95 on node my_fqdn
What am I missing?
As a workaround, I can make classes like pgfi::sysctl::gpfs::one_gige
and pgfi::sysctl::ten_gige and not have this override problem, but I
think it should work with inheritance...
Regards,
Alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---