Hi. Can someone recommend a good module for network control? Regards. -- 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.
I need to switch machines from DHCP to static IP, any good module for this? Regards. On Jul 6, 12:45 am, SyRenity <stas.os...@gmail.com> wrote:> Hi. > > Can someone recommend a good module for network control? > > Regards.-- 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.
Ashley Penney
2010-Jul-06 11:32 UTC
Re: [Puppet Users] Re: Network settings control module
We would need a lot more information to be helpful - what OS are you using, or what distribution if Linux, and how do you want to control the ip''s for machines - variables, a database, ldap? On Tue, Jul 6, 2010 at 4:01 AM, SyRenity <stas.oskin@gmail.com> wrote:> I need to switch machines from DHCP to static IP, any good module for > this? > > Regards. > > On Jul 6, 12:45 am, SyRenity <stas.os...@gmail.com> wrote: > > Hi. > > > > Can someone recommend a good module for network control? > > > > Regards. > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- 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.
> We would need a lot more information to be helpful - what OS are you using, > or what distribution if Linux, and how do you want to control the ip''s for > machines - variables, a database, ldap?CentOS 5.5, variables for now. I''m using foreman, so storing these values in DB comes with it. Regards. -- 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.
Ashley Penney
2010-Jul-06 16:08 UTC
Re: [Puppet Users] Re: Network settings control module
I use this for rhel/foreman:
init.pp
class network {
tag("bootstrap")
file { "ifcfg-eth0":
path =>
"/etc/sysconfig/network-scripts/ifcfg-eth0",
owner => root,
group => root,
mode => 644,
content =>
template("network/ifcfg.erb"),
ensure => present,
notify => Service[network],
}
file { "network":
path => "/etc/sysconfig/network",
owner => root,
group => root,
mode => 644,
content =>
template("network/network.erb"),
notify => Service[network],
}
service { network:
ensure => "running",
hasstatus => "true",
hasrestart => "true",
restart => "/etc/init.d/network
restart",
}
}
[root@hlslinutil1]/root/puppet/modules/testing/network/templates# cat
ifcfg.erb
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=<%= ip %>
BROADCAST=xxx
NETMASK=xxx
NETWORK=xxx
[root@hlslinutil1]/root/puppet/modules/testing/network/templates# cat
network.erb
NETWORKING=yes
HOSTNAME=<%= fqdn %>
GATEWAY=10.241.209.1
I actually have it slightly more complicated as I modified foreman to
provide ip and then I have extra checks in the erb like:
<% if ip =~ /10.241.209/ %>
BROADCAST=10.241.209.255
NETMASK=255.255.255.0
NETWORK=10.241.209.0
Hopefully that''ll start you on the right path.
On Tue, Jul 6, 2010 at 8:17 AM, SyRenity <stas.oskin@gmail.com> wrote:
> > We would need a lot more information to be helpful - what OS are you
> using,
> > or what distribution if Linux, and how do you want to control the
ip''s
> for
> > machines - variables, a database, ldap?
>
> CentOS 5.5, variables for now.
>
> I''m using foreman, so storing these values in DB comes with it.
>
> Regards.
>
> --
> 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<puppet-users%2Bunsubscribe@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
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.
Thanks - this gives me a good direction how to start indeed! Regards. On Jul 6, 7:08 pm, Ashley Penney <apen...@gmail.com> wrote:> I use this for rhel/foreman: > > init.pp > class network { > tag("bootstrap") > > file { "ifcfg-eth0": > path => > "/etc/sysconfig/network-scripts/ifcfg-eth0", > owner => root, > group => root, > mode => 644, > content => template("network/ifcfg.erb"), > ensure => present, > notify => Service[network], > } > > file { "network": > path => "/etc/sysconfig/network", > owner => root, > group => root, > mode => 644, > content => template("network/network.erb"), > notify => Service[network], > } > > service { network: > ensure => "running", > hasstatus => "true", > hasrestart => "true", > restart => "/etc/init.d/network restart", > } > > } > > [root@hlslinutil1]/root/puppet/modules/testing/network/templates# cat > ifcfg.erb > DEVICE=eth0 > BOOTPROTO=static > ONBOOT=yes > TYPE=Ethernet > IPADDR=<%= ip %> > BROADCAST=xxx > NETMASK=xxx > NETWORK=xxx > > [root@hlslinutil1]/root/puppet/modules/testing/network/templates# cat > network.erb > NETWORKING=yes > HOSTNAME=<%= fqdn %> > GATEWAY=10.241.209.1 > > I actually have it slightly more complicated as I modified foreman to > provide ip and then I have extra checks in the erb like: > > <% if ip =~ /10.241.209/ %> > BROADCAST=10.241.209.255 > NETMASK=255.255.255.0 > NETWORK=10.241.209.0 > > Hopefully that''ll start you on the right path. > > On Tue, Jul 6, 2010 at 8:17 AM, SyRenity <stas.os...@gmail.com> wrote: > > > We would need a lot more information to be helpful - what OS are you > > using, > > > or what distribution if Linux, and how do you want to control the ip''s > > for > > > machines - variables, a database, ldap? > > > CentOS 5.5, variables for now. > > > I''m using foreman, so storing these values in DB comes with it. > > > Regards. > > > -- > > 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<puppet-users%2Bunsubscribe@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/puppet-users?hl=en.-- 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.