Puppet Forge

PuppetForge 0.4.0

Module razorsedge/network 1.0.0

Module description

Puppet Network Module

Introduction

This module manages Red Hat/Fedora traditional network configuration.

It allows for static, dhcp, and bootp configuration of normal and bonded interfaces. There is support for aliases on normal and bonded interfaces. It can configure static routes. It can configure MTU, ETHTOOL_OPTS, and BONDING_OPTS on a per-interface basis.

It can configure the following files:

  • /etc/sysconfig/network
  • /etc/sysconfig/networking-scripts/route-*
  • /etc/sysconfig/networking-scripts/ifcfg-*

Class and Define documentation is available via puppetdoc.

Examples

Global network settings:

network::global { "default":
  gateway => "1.2.3.1",
}

Normal interface - static (minimal):

network::if::static { "eth0":
  ipaddress  => "1.2.3.248",
  netmask    => "255.255.255.128",
  macaddress => $macaddress_eth0,
  ensure     => "up",
}

Normal interface - static:

network::if::static { "eth1":
  ipaddress    => "1.2.3.4",
  netmask      => "255.255.255.0",
  gateway      => "1.2.3.1",
  macaddress   => "fe:fe:fe:aa:aa:aa",
  mtu          => "9000",
  ethtool_opts => "speed 1000 duplex full autoneg off",
  ensure       => "up",
}

Normal interface - dhcp (minimal):

network::if::dynamic { "eth2":
  macaddress => $macaddress_eth2,
  ensure     => "up",
}

Normal interface - dhcp:

network::if::dynamic { "eth3":
  macaddress   => "fe:fe:fe:ae:ae:ae",
  mtu          => "1500",
  ethtool_opts => "speed 100 duplex full autoneg off",
  ensure       => "up",
}

Normal interface - bootp (minimal):

network::if::dynamic { "eth2":
  macaddress => "fe:fe:fe:fe:fe:fe",
  bootproto  => "bootp",
  ensure     => "up",
}

Aliased interface:

network::if::alias { "eth0:1":
  ipaddress => "1.2.3.5",
  netmask   => "255.255.255.0",
  ensure    => "up",
}

Bonded master interface - static:

network::bond::static { "bond0":
  ipaddress    => "1.2.3.5",
  netmask      => "255.255.255.0",
  gateway      => "1.2.3.1",
  mtu          => "9000",
  bonding_opts => "mode=active-backup miimon=100",
  ensure       => "up",
}

Bonded master interface - dhcp:

network::bond::dynamic { "bond2":
  mtu          => "8000",
  bonding_opts => "mode=active-backup arp_interval=60 arp_ip_target=192.168.1.254",
  ensure       => "up",
}

Bonded slave interface:

network::bond::slave { "eth1":
  macaddress   => $macaddress_eth1,
  ethtool_opts => "speed 1000 duplex full autoneg off",
  master       => "bond0",
}

Aliased bonded interface:

network::bond::alias { "bond2:1":
  ipaddress => "1.2.3.6",
  netmask   => "255.255.255.0",
  ensure    => "up",
}

Static interface routes:

network::route { "eth0":
  address => [ "192.168.2.0", "10.0.0.0", ],
  netmask => [ "255.255.255.0", "255.0.0.0", ],
  gateway => [ "192.168.1.1", "10.0.0.1", ],
}

Notes

  • Only works with RedHat-ish systems.
  • Read /usr/share/doc/initscripts-*/sysconfig.txt for underlying details.
  • Read /usr/share/doc/kernel-doc-*/Documentation/networking/bonding.txt for underlying details.
  • Only tested on EL5.5.
  • There is an assumption that an aliased interface will never use DHCP.
  • bootp support is unknown for bonded interfaces. Thus no bootp bond support in this module.
  • It is assumed that if you create a bond that you also create the slave interface(s).
  • It is assumed that if you create an alias that you also create the parent interface.
  • There is currently no IPv6 support in this module.
  • network::route requires the referenced device to also be defined via network::if or network::bond.

Issues

  • Setting ETHTOOL_OPTS, MTU, or BONDING_OPTS and then unsetting will not revert the running config to defaults.
  • Changes to /etc/sysconfig/network are global and will result in “service network restart”. This could cause network inaccessability for the host if the network configuration is incorrect.
  • Modifying or creating a slave interface after the master has been created will not change the running config.
  • There is no support for removing an interface.

TODO

  • Support /etc/sysconfig/network-scripts/rule-<interface-name>
  • Support IPv6.
  • Support for more than Ethernet links.

Release notes for version 1.0.0

Initial release.

Popular Tags

a2dismod a2enmod accelerator access acl activemq agent agnostic alerts aliases amanda amavis amazon amqp analysis and android antivirus apache apache2 apple application applications apt apticron archive asadmin Atlassian augeas auth authconfig authentication authoritative automation availability aws backup backuppc bacula balance bash basic benchmark bigtable bind blog boundary boxcar bprobe bugzilla build bzr c++ ca caching Cacti campfire capistrano cassandra ccollect CentOS cern certificate certificate_authority certificates certs cfn check chrislea ci cirrus clamav cleanup cli client cloud cloud-provisioner cloudformation cloudkick cloudwatch cluster cobbler collectd common compile compiler composite_namevars concat concatenate console control controltier create_resouces cron curl CVS cyber dashboard data database datadog db debian defaults denyhosts deployment desktop developer development device dhcp digest directory distributed dms dns dnsmasq dovecot dpkg dpm duo dynamic dynect ec2 editor elasticsearch email ENC enterprise environment ESN example42 exim experimental ext f5 face facter factor facts fail fail2ban farm fcgi fcron fedora FHS file files fileserver filesystem find firehol firewall flowdock FMRI foo foreman fpm freebsd fsck ftp func function ganglia gcc gconf gearman gearman-job-server gearmand gem generation generic Gentoo gfx git gitolite glassfish Glider gLite glusterfs gnome2 graphics greylisting grid Group groups growl ha hadoop haproxy hardware hbase hdd hdfs headless heartbeat hg hids high-availability hipchat homebew host host-keys hosts HP htdigest htpasswd HTTP httpd https icinga ignore imagemagick imap info information infrastructure initr interface inventory ip6tables iphone iproute ipset iptables ipvs irc irqbalance iscsi jabber java jdk jenkins jenkins-ci Jira joyent jre jsp keepalived kerberos kickstart krb5 kvm kwalify LANANA languages lcg lcgutil ldap library libvirt libzypp limits limits-conf linux lmsensors load load-balancing loadbalancer locale locales lock logging logical_volume logrotate logs logwatch LSB lucid LVM mac mail mailalias maintenance make manager manages_members mariadb master-election mcollective mediawiki memcached message message_bus messaging meta metche metrics mfa middleware mirror mnx mobileconfig module modules mon mongodb monit monitor monitoring Monitoring and Trending mosh motd mount mountpoint mounttab mrepo mta multi multipath multiple sites mumble munin mysql mysql-proxy mysql_proxy mysqlproxy naginator nagios namenode nameserver netinstall network network_config network_interface networking NFS nginx nmap noah node nodejs nosql notification nova nrpe ntp ntpd nullmailer OEL openfire opennebula openssh openssl openstack OpenSUSE openvpn openvz operating operating system operating systems operatingsystem operatingsystems operations opsview orchestration os ossec osx ovh pacemaker package package management packages packaging pagerduty PAM pam_access passenger password pe pear percona performance perl permissions pflogsumm php phpqa phpqatools phpsysinfo phptools physical_volume pick pkgin planet platform pop posix postfix postgres postgresql postmark ppa probe proc processor production-ready profile_d proftpd Programming Languages Proliant prosvc provider provisioner provisioning proxy psumac psumac2012 puppet puppetlabs puppetmaster puppi pure-ftpd pureftpd pushover pwgen PXE python qa queue rabbitmq rack raid rails rbenv redhat redis registry relay replication repo report reporting repositories repository request resolv resolv_conf resolvconf resolver resources rest restart rhel rhel5 rhel6 riemann role route53 RPM rpmbuild RRD rsnapshot RSpec rsync rsyslog rt ruby rubygems rundeck runtime samba satellite scm screen scribe scrumworks search SecretServer security sendmail server service services servlet settings sharding shell shortcut sieve sip sipfoundry sipx sipxecs SMF smokeping smtp snmp snmpd solaris solr sonar spam spamassassin sphinx sphinxsearch splunk sql sqlgrey sqlite ssh sshd ssl stages standard standards statistics stdlib stomp storage storeconfigs subversion subversion-client sudo SuSE SVC svn svnrepo symfony synchronisation sysctl syslog syslog-ng system systems tar tcp test Testing tftp thin thrift thycotic ticketing tidy time timezone tls tmpfs tmpwatch tomcat tomcat6 tool tools tracker" traut Trending tuning tunnel twilio twitter two type ubuntu udp unbound unconfigured untar user users utilities utils validation vcs version vhost vim virtual virtual-environment virtualhost virtualization vm vmtools vmware vmware-tools vmware_tools vnc VOIP volume volume_group voms vpn wars web web servers webapp webapp-config webserver webservers wget wiki win32 windows wordpress x x11 xen xinetd xmpp yast yum zendesk zeromq zones zookeeper zypp zypper