-
Notifications
You must be signed in to change notification settings - Fork 11
route does not get set on FreeBSD #121
Comments
Hi, Does the gateway get set in |
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 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). |
I've just pushed a |
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. |
Interesting enough, nothing changes. I see the same messages in the puppet agent debug:
As a very crude test, I did this:
And it works as long as in the manifest I specify a relation, like so:
Yes i know, my ruby/puppet skills need a lot of work... |
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. |
@@ -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:
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). |
any updates on this? |
Apologies for the delay. That looks like a reasonable change to me. Were you able to test that it worked as you expected? |
It works but only if you run the routing after setting the IP for the interface and I think this breaks the module. |
Have another issue on FreeBSD 12 :
The configuration part on my side was really simple:
Puppet barf itself on the forwarding stuff... I dunno why, but is there a way to ignore it ? Regards |
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. |
Hello,
I'm trying to set a static IP and default route on a FreeBSD 11.1 machine with:
on a machine the previously received and IP over DHCP.
The interesting thing that happens is that the default route gets removed but not added back again by the puppet agent run. This in turn leaves the server not accessible.
From what I can gather, it's because the routing service on FreeBSD has no "status" command and also does not need to be running. As can be seen from below, the restart is never issued.
Am I missing some option in my node definition?
The text was updated successfully, but these errors were encountered: