-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add additional option support #74
Conversation
@@ -61,4 +61,8 @@ | |||
isrequired | |||
desc "The interface to use for the route" | |||
end | |||
|
|||
newproperty(:additional_options) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got a few comments on how this property behaves.
First off, the network_config type uses options
for setting arbitrary options, I would like to match that convention here for the sake of consistency. Would you be amenable to renaming this to options
?
Secondly, right now only redhat and debian are supported but it's possible to add more route providers, and those may not necessarily support additional options. Could you pull out a feature for this property like the options property does for network_config 9https://github.com/adrienthebo/puppet-network/blob/master/lib/puppet/type/network_config.rb#L93)?
Lastly, what sort of values should this be? Should it be a string, hash, or something else? Can we do some sort of validation to make sure we only set reasonable route options? And could you add some documentation of how this could be used and in what cases?
| Would you be amenable to renaming this to options? | Can we do some sort of validation to make sure we only set reasonable route options? Route section from man page:
|
If by "validation" you're talking about using a hash and doing validation as in the |
If the possible combinations of values are too complex to validate without going nuts, then just validating that the input is a String would suffice. |
See what you think of the changes. |
Squashed commits. |
Add additional option support
Thanks for the contribution! |
In RedHat there are many more options that can be specified after the interface. For example, you can specify a routing table such as
default via 10.0.0.1 dev eth1 table 200
. Everything after the interface is so fluid it doesn't make sense to add specific properties for everything. A simpleadditional_options
property is most flexible.I don't know what or if any additional options are available in Debian but I added support anyway. It certainly shouldn't hurt. If someone else can test the Debian side to see if it's needed that'd be great.
Please let me know if you have any questions.