Giter VIP home page Giter VIP logo

puppet-network's Introduction

puppet-network

Manage non-volatile network and route configuration.

Puppet Forge Puppet Forge downloads Puppet Forge score Build Status

Examples

Interface configuration

network_config { 'eth0':
  ensure  => 'present',
  family  => 'inet',
  method  => 'dhcp',
  onboot  => 'true',
  hotplug => 'true',
  options => {'pre-up' => 'sleep 2'},
}

network_config { 'lo':
  ensure => 'present',
  family => 'inet',
  method => 'loopback',
  onboot => 'true',
}

network_config { 'eth1':
  ensure    => 'present',
  family    => 'inet',
  ipaddress => '169.254.0.1',
  method    => 'static',
  netmask   => '255.255.0.0',
  onboot    => 'true',
}

Route configuration

Route resources should be named in CIDR notation. If not, they will not be properly mapped to existing routes and puppet will apply them on every run. Default routes should be named 'default'.

For Debian:

network_route { '172.17.67.0/24':
  ensure    => 'present',
  gateway   => '172.18.6.2',
  interface => 'vlan200',
  netmask   => '255.255.255.0',
  options   => 'table 200',
}

For RedHat Enterprise:

network_route { '172.17.67.0/24':
  ensure    => 'present',
  gateway   => '10.0.2.2',
  interface => 'eth0',
  netmask   => '255.255.255.0',
  network   => '172.17.67.0',
  options   => 'table 200',
}
network_route { 'default':
  ensure    => 'present',
  gateway   => '10.0.2.2',
  interface => 'eth0',
  netmask   => '0.0.0.0',
  network   => 'default'
}

Create resources on the fly with the puppet resource command:

root@debian-6:~# puppet resource network_config eth1 ensure=present family=inet method=static ipaddress=169.254.0.1 netmask=255.255.0.0
notice: /Network_config[eth1]/ensure: created
network_config { 'eth1':
  ensure    => 'present',
  family    => 'inet',
  ipaddress => '169.254.0.1',
  method    => 'static',
  netmask   => '255.255.0.0',
  onboot    => 'true',
}

# puppet resource network_route 23.23.42.0 ensure=present netmask=255.255.255.0 interface=eth0 gateway=192.168.1.1
notice: /Network_route[23.23.42.0]/ensure: created
network_route { '23.23.42.0':
  ensure    => 'present',
  gateway   => '192.168.1.1',
  interface => 'eth0',
  netmask   => '255.255.255.0',
  options   => 'table 200',
}

Dependencies

This module requires the FileMapper mixin, available at https://github.com/voxpupuli/puppet-filemapper The debian routes provider requires the package ifupdown-extra

The network_config type requires the Boolean mixin, available at https://github.com/adrienthebo/puppet-boolean. It also requires the ipaddress gem which can be installed with:

sudo gem install ipaddress --no-ri --no-rdoc

This gem needs to always be installed on the agent before a puppet agent run, otherwise a catalog error will occur.

Note: you may also need to update your master's plugins (run on your puppet master):

puppet agent -t --noop

Or on puppet 2.7/3.x:

puppet plugin download

Contact

puppet-network's People

Contributors

adrienthebo avatar igalic avatar jyaworski avatar rski avatar rnelson0 avatar ffrank avatar ericsakowski avatar jordiclariana avatar nibalizer avatar bastelfreak avatar dustyhorizon avatar jhoblitt avatar jasperla avatar codec avatar wolfspyre avatar roman-mueller avatar robbat2 avatar nanliu avatar c33s avatar jskarpe avatar fraenki avatar xylakant avatar ekohl avatar derekhiggins avatar davids avatar daenney avatar

Watchers

James Cloos avatar Fernando Alves avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.