This work updates the library code to utilize the namespace that was
recently put in place. This helps unify the configuration validation
for all the library code, and ensure consistent data types for options.
Updates to tests as necessary to accommodate these changes.
Here a some updates to move the configuration and validation into a
common PuppetInterface class that will allow easier extensibility, yet
stil put the authority for which config values are optional, required,
exclusive, etc. Shifts tests for this work, and updates the parameter
names and value type checking on params as well as library code. Native
Puppet4 defaults, though only type checking at this point. Drop support
for casing the IPv6 rtsol autoconf on older OpenBSD. Improves
readability and testability of code generally. Renames 'values' to
'raw_values' everywhere. The use of 'raw_values' still turns out to
be useful for cases where network configuration requirements are not
exposed through the module where users still wish to take advantage of
the addresses param on the relevant classes.
Fixes MTU detection on FreeBSD and surfaces the MTU of an interface to
be managed using the bsd_interface type. Begin interfacing with
ifconfig to handle the live mtu.
This module now has three extra module dependencies, and drops
shell_config as a requirement. The augeas providers are under active
development, and the providers are growing for a number of other types.
As such, to avoid needing two different modules that fundamentally do
the same thing, this change is my preference.
To update, simply have a look at the new dependencies and install the
needed modules. If you are currently using shell_config elsewhere in
your environment, there will be no conflict, so you may go about your
day. If you are not using shell_config elsewhere in your environment,
updating to this module would prove a reasonable time to remove stop
including it on your module list.
bsd::network::interface::pfsync
This new type makes use of the parent interface of
bsd::network::interface, setting the value of the syncdev
parameter to the parent.
README.md updated, and spec tests added for the new defined
type and the corresponding hostname_if function.
This defined type is a bit special compared to the others,
since, when no parameters given, it explicitly sets the defaults
i.e. just create a pfsync0 interface, without parameters will end
up with a /etc/hostname.pfsync0 with:
-syncdev -syncpeer maxupd 128 -defer
up
What is default anyways is taken from the pfsync manual page.
This has the advantage that interfaces are easier to reconfigure.
Instead of ensuring its absense, and re-creating it, a parameter
can just be removed, and it will be reset to the default value.
can be a string or an array. The value of that parameter
is passed to Bsd_interface.rb when the interface is started.
Add a parents parameter to bsd_interface.rb, and autorequire
the parents. A bit of validation etc. of the interface name
done.
In bsd::network::interface, require the creation of hostname.if
for OpenBSD or the shell_config for FreeBSD to be done before
the Bsd_interface is created.
The subclasses in bsd::network::interface::* where parent interfaces
make sense to set, i.e. bridge, carp, trunk and vlan, deduct the
parent interface based on the interface or device parameter, and
hand that over to the parents parameter of bsd::network::interface.
Specs added for bsd::network::interface::* defined types, and
the parents defined types.
Further added some flesh to the README.md mentioning the interface
ordering and the parents parameter of the bsd::network::interface
defined type.
hash, and process those given IP address information via
PuppetX::BSD::Hostname_if::Inet
Add addresses parameter to manifests::network::interface, and pass it
to get_openbsd_hostname_if_content function
Add a spec test using the addresses parameter in the bsd_network_interface_spec.rb
and update README.md
Add addresses parameter handling for FreeBSD too
Merge values into addresses in FreeBSD case in rc_conf.rb, since
it doesn't seem that other values than IP addresses are evaluated at
all on FreeBSD.
Add deprecation warning to hostname_if.rb if IP address info is set
via values parameter, but no addresses parameter is given.
Bail out, when trying to set IP info via values parameter and an
addresses parameter is given too.
This enables refresh for the bsd_interface in a platform specific way.
Resources may now use the notify/subscribe meta-params. If a resource is
notified, the provider will execute the platform specific method for
restarting an interface.
i.e. allow unencrypted wifi network configuration.
Update specs to reflect that change, add a few more wifi interfaces
I own and reorder them alphabetically. Add a little test.
Without this, the name of the requested interface is ignored. It makes
for a better user experience as a user to avoid situations where a user
tries to manage /etc/hostname.trunk0 as a, say, bridge interface.
Implement the same logic for vlan and carp interfaces.
Simplify some some of the content code for maintainability and
testability. Add notes for clarity about what is happening and why.
Should result in more consistent files on disk.
Add necessary code to create and join wireless networks using wpa.
Edge cases are sure to exist here, though this has been tested on my
home network to create and join a wireless access point on OpenBSD.
Before this, to create a vlan interface, the user had to specify at
least one IP address. This is not actually a hard requirement. As
such, the updates here reflect the fact that addresses on vlan(4)
interfaces are optional.
Here also adds support for FreeBSD vlan(4) interfaces, which has lagged
behind the OpenBSD support.
In here are also some improvements on the tests, and syntax deprecation
cleaning.
Previously, we relied on the specific implementation of an interface to
append either 'up' or 'down' to the interface configuration. This
became hard to work with because all of the logic for the interface
configuration was no longer in one place. This was a problem because we
would set the interface state before we were finished working with the
content of the file.
This code begins to support setting an interface state on the main
bsd::interface type and appends the values after the file text is built.
This is only supported on a selection of interface drivers, so we
default to undef here and expect that if the value is set, it will only
be either a string of 'up' or 'down'.
This work converts the implementation for FreeBSD network interface
management in the puppet-freebsd module into ruby and imported into this
module.
Now the bsd::network::interface has a mostly consistent interface
between freebsd and openbsd. There are small items that may need
adjusting, so still not ready for primetime until the api interface
solidifies, but its getting there.
For some reason it seems that a newline is required for some of the
interfaces to come up when executed by /etc/netstart. This code ensures
that the implementation of bsd::network::interface for openbsd will
append a newline to the config files.
The following begins the work needed to flush out the virtual interfaces
that OpenBSD supports.
The first is, CARP. We beign with a a wrapper class
bsd::network::interface::carp that has the needed paramaters. We chew
on the inputs, before we spit out the ifconfig lines that we can pass to
the bsd::network::interface define to create the carp interface. Works
like a charm.
Next up is the GRE interface managemnt. We just piggy back on the
bsd::network::interface type here, and enable GRE when its needed. I
expec that this interface will change in the future. Ideally, pass in
the needed values similar to how the carp interface is done. For now
this works, and is worth commiting. Example has been inclued in the
tests/ directory.
Sysctl classes for enablement of each of the above has been included.
Add some basic testing for the above as well.