Comments (12)
Hi, Does the gateway get set in rc.conf
? I don't think we'll remove the DHCP option if you set a gateway, but I have bsd::network::v4gateway
set on all my systems and I get an entry in rc.conf
to match.
from puppet-bsd.
Hi,
I see my error. What I meant to say was that the default route in netstat -rn get's removed but not set to the one I define in bsd::network::v4gateway
. /etc/rc.conf has no "defaultrouter" option when setting an interface to DHCP.
Your module does the right job in setting the "defaultrouter" option in /etc/rc.conf but when restarting the routing service, I think it fails because it first does a "status" on the rc.d script and that parameter does not exist for /etc/rc.d/routing (as can be seen from the puppet client debug output).
from puppet-bsd.
I've just pushed a status
branch with a change that should disable the status lookup. Are you in a position to test that branch?
from puppet-bsd.
Let me fire up my vm's and test; will take some time.
As long as the /etc/rc.d/routing just receives a "onerestart", I think everything should work.
from puppet-bsd.
Interesting enough, nothing changes. I see the same messages in the puppet agent debug:
Debug: Executing: '/etc/rc.d/routing onestatus'
Debug: /Stage[main]/Bsd::Network/Service[routing]: Skipping restart; service is not running
As a very crude test, I did this:
'FreeBSD': { Shellvar { target => '/etc/rc.conf', notify => Exec['restart_routing'] } exec { 'restart_routing': command => '/etc/rc.d/routing onerestart', refreshonly => true }
And it works as long as in the manifest I specify a relation, like so:
bsd::network::interface { 'em0':
description => 'Primary Interface',
addresses => [ '192.168.157.133/24', '192.168.157.134/24' ]
}->
class { 'bsd::network':
v4gateway => '192.168.157.2'
}
Yes i know, my ruby/puppet skills need a lot of work...
from puppet-bsd.
The solution you've outlined makes good sense, though is there a more targeted approach that we could take to avoid any rc.conf change restarting the routing? Only route option changes would need, necessarily, to restart routing. The netif script seems to do the right thing most of the time if you're not adjusting routes.
from puppet-bsd.
@@ -73,7 +73,6 @@
'FreeBSD': {
Shellvar {
target => '/etc/rc.conf',
- notify => Service['routing'],
}
# Should we enable IPv4 forwarding?
@@ -104,6 +103,7 @@
if $v4gateway {
shellvar { 'defaultrouter':
value => $v4gateway,
+ notify => Exec['restart_routing']
}
} else {
shellvar { 'defaultrouter':
@@ -116,6 +116,7 @@
if $v6gateway {
shellvar { 'ipv6_defaultrouter':
value => $v6gateway,
+ notify => Exec['restart_routing']
}
} else {
shellvar { 'ipv6_defaultrouter':
@@ -126,6 +127,11 @@
service { 'routing':
}
+
+ exec { 'restart_routing':
+ command => '/etc/rc.d/routing onerestart',
+ refreshonly => true
+ }
}
default: {
notify { 'Not supported': }
That should be better but it still requires the "->" in the manifest. Ex:
bsd::network::interface { 'em0':
description => 'Primary Interface',
addresses => [ '192.168.157.133/24', '192.168.157.134/24' ]
}->
class { 'bsd::network':
v4gateway => '192.168.157.2'
}
And I think this breaks the design of the module. Maybe it makes sense to adjust it so that the defaultroute get's called last, after the last IP is set? (I checked the code but don't realize where this is happening).
from puppet-bsd.
any updates on this?
from puppet-bsd.
Apologies for the delay. That looks like a reasonable change to me. Were you able to test that it worked as you expected?
from puppet-bsd.
It works but only if you run the routing after setting the IP for the interface and I think this breaks the module.
from puppet-bsd.
Have another issue on FreeBSD 12 :
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: no parameter named 'value' (file: /usr/local/etc/puppet/environments/production/modules/bsd/manifests/network.pp, line: 32) on Sysctl[net.inet.ip.forwarding] (file: /usr/local/etc/puppet/environments/production/modules/bsd/manifests/network.pp, line: 32) on node rprng1.prod.hotcity.lu
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
The configuration part on my side was really simple:
class { 'bsd::network':
v4gateway => '10.194.57.1',
v4forwarding => false,
v6forwarding => false,
}
bsd::network::interface { 'vmx0':
addresses => [ '10.194.57.10/24'],
}
Puppet barf itself on the forwarding stuff... I dunno why, but is there a way to ignore it ?
Regards
from puppet-bsd.
All my hardware is on 12 and I'm not seeing this. Which version of the module are you running @xbeaudouin? This seems like a different issue than the OP.
from puppet-bsd.
Related Issues (20)
- Refresh should move to the bsd_interface provider. HOT 1
- Setting address on trunk interfaces doesn't actually set the addresses on OpenBSD HOT 1
- Should manage cloned interfaces in rc.conf on FreeBSD HOT 1
- Alias IP addresses and routes on other than bsd::network::interface interfaces HOT 2
- order of interface handling in the catalog HOT 3
- Should support kernel module load state
- sysctl dependency change problem HOT 7
- Document setting the MTU
- Ability to manage /etc/login.conf HOT 2
- Removing trunk interfaces should not require a parent interface
- link-local IPv6 addresses with %interface suffix are not matched/valid HOT 2
- FreeBSD11 uses `accept_rtadv` to enable router advertisements
- Cloned interfaces on FreeBSD HOT 1
- gre interfaces does not appear to work on freebsd 11.1 HOT 31
- Support static_routes from rc.conf on FreeBSD HOT 1
- Error: Failed to apply catalog: no parameter named 'value' HOT 16
- trunk does not manage cloned_interfaces parameter HOT 18
- feature request: hiera support for most settings HOT 3
- Seeking New Ownership
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-bsd.