Network settings control module

384 views
Skip to first unread message

SyRenity

unread,
Jul 5, 2010, 5:45:25 PM7/5/10
to Puppet Users
Hi.

Can someone recommend a good module for network control?

Regards.

SyRenity

unread,
Jul 6, 2010, 4:01:13 AM7/6/10
to Puppet Users
I need to switch machines from DHCP to static IP, any good module for
this?

Regards.

Ashley Penney

unread,
Jul 6, 2010, 7:32:13 AM7/6/10
to puppet...@googlegroups.com
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?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


SyRenity

unread,
Jul 6, 2010, 8:17:21 AM7/6/10
to Puppet Users
> 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.

Ashley Penney

unread,
Jul 6, 2010, 12:08:34 PM7/6/10
to puppet...@googlegroups.com
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.




Regards.

SyRenity

unread,
Jul 7, 2010, 7:09:27 PM7/7/10
to Puppet Users
Thanks - this gives me a good direction how to start indeed!

Regards.
> 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...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > puppet-users...@googlegroups.com<puppet-users%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages