Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting the default route on Debian #61

Closed
mmoll opened this issue Oct 24, 2013 · 3 comments
Closed

setting the default route on Debian #61

mmoll opened this issue Oct 24, 2013 · 3 comments

Comments

@mmoll
Copy link

mmoll commented Oct 24, 2013

I'm using the following manifest:

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

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

network_route { 'default':
  ensure    => 'present',
  gateway   => '10.4.0.1',
  interface => 'eth0',
  netmask   => '0.0.0.0',
  network   => 'default',
}

In /etc/network/routes the route is getting added twice:

# HEADER: This file is is being managed by puppet. Changes to
# HEADER: routes that are not being managed by puppet will persist;
# HEADER: however changes to routes that are being managed by puppet will
# HEADER: be overwritten. In addition, file order is NOT guaranteed.
# HEADER: Last generated at: 2013-10-24 16:33:34 +0200
default 0.0.0.0 10.4.0.1 eth0
default 0.0.0.0 10.4.0.1 eth0

And on every puppet run I'm getting:

Notice: /Stage[main]//Network_route[default]/ensure: created
@tzachz
Copy link

tzachz commented Oct 29, 2013

I'm seeing the same issue - the network_route resources are executed on every puppet run, and all routes end up duplicated in the routes file.

@gwarf
Copy link

gwarf commented Nov 19, 2013

Hello,
In order to avoid a resource change I had to use the following not-so-pretty syntax:

network_route { '0.0.0.0/0':
  ensure    => 'present',
  gateway   => 'xxx.xxx.xxx.xxx',
  interface => 'eth0',
  netmask   => '0.0.0.0',
  network   => '0.0.0.0',
}

@mmoll
Copy link
Author

mmoll commented Nov 19, 2013

@gwarf seems also to work for me in a quick test, thanks! 🍻

@mmoll mmoll closed this as completed Nov 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants