Closed Thracky closed 9 years ago
May I see the manifest that you are using? If you are trying to go in through bsd::network::interface
, than I think I'm expecting this. If you are using bsd::network::interface::vlan
, the values passed to the bsd::network::interface
class should already be 'processed' and formatted correctly.
Here's how I was attempting to create VLAN interfaces:
class { 'bsd::network':
v4forwarding => true,
}
bsd::network::interface { 'em0':
description => 'Primary Interface',
values => [ '10.0.0.1/24' ],
}
bsd::network::interface::vlan { 'vlan101':
id => '101',
device => 'em0',
address => '10.0.101.1/24',
}
bsd::network::interface::vlan { 'vlan102':
id => '102',
device => 'em0',
address => '10.0.102.1/24',
}
Yep, that manifest is the expected approach. I'll try to give some evening time this week to get a test this out. I've been neglecting tests for FreeBSD and plan to rectify this soon once I get my test lab online.
https://github.com/xaque208/puppet-bsd/pull/63
This should be in a better state now, though I need to add a test to make sure I've not broken OpenBSD in the process. I'll come back.
In the meantime, if you'd like to test this out, I'd appreciate it. I've also modified the interface refreshing so when the values in rc.conf change, the interface is restarted. I'd like feedback on this approach if you have it.
I'm not yet handling cloned interfaces, and I'm not quite sure how to model that in Puppet.
Much appreciated Zach. I'll be testing it out in the next couple days.
Regarding the cloned interfaces, for my hacked together solution I just added another variable in the network class that takes an array of interface names then added a shell_config item for adding it into rc.conf. Maybe it's not the most elegant solution but it works for the time being.
@Thracky How'd the testing go? I'll close this out if its working for you.
Everything worked great. The cloned_interfaces still had to be done separately but the actual interface configuration worked flawlessly otherwise.
Thanks again!
Currently the vlan support for FreeBSD appears to be broken when going to instantiate the standard interface class for two reasons.
1. How the values array is treated.
In lib/puppet/parser/functions/get_freebsd_rc_conf_shellconfig.rb line 12:
And in lib/puppet_x/bsd/rc_conf.rb the address array is explicitly treated as an array of addresses and
process_addresses()
is called on each of the array items, which includes vlan id and vlandev values.This results in the following error:
A potential solution is to pass
$vlan_values
to options and$address
to values in vlan.pp.2. No cloned_interfaces in rc.conf
In order for the VLAN interface to function, there needs to be a
cloned_interfaces
line in rc.conf as per http://people.freebsd.org/~arved/vlan/vlan_en.htmlFor example:
I imagine at least the first issue may affect other interface types, but I have not tested any of them yet.