-
-
Notifications
You must be signed in to change notification settings - Fork 17
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 custom sections to systemd network #117
Conversation
manifests/provider/systemd.pp
Outdated
@@ -12,6 +12,7 @@ | |||
Optional[String[1]] $description = undef, | |||
Optional[Integer[1200, 9000]] $mtu = undef, | |||
Array[Hash[String[1], Variant[String[1], Boolean]]] $routes = [], | |||
Hash $sections = {}, |
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.
Can this be a more specific custom type?
Not sure how you updated the REFERENCE.md but the validation is not valid. See https://voxpupuli.org/docs/how_to_run_tests/#referencemd-update |
manifests/interface.pp
Outdated
@@ -112,6 +130,7 @@ | |||
Optional[Integer[1200, 9000]] $mtu = undef, | |||
Optional[String[1]] $public_key = undef, | |||
Array[Hash[String[1], Variant[String[1], Boolean]]] $routes = [], | |||
Hash[String, Hash[Any, String]] $sections = {}, |
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.
According to your example, this seems to be:
Hash[String, Hash[Any, String]] $sections = {}, | |
Hash[String, Hash[String, Any]] $sections = {}, |
IIRC, there is also a Data
type that will only accept actual data and may be more suitable that Any
.
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.
Also, some modules use a parameter name like $custom_foo
or $extra_foo
to add custom config. Maybe somethig to think about before introducing this parameter.
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.
Thanks for your feedback. The pipeline is now successful.
manifests/provider/systemd.pp
Outdated
@@ -12,6 +12,7 @@ | |||
Optional[String[1]] $description = undef, | |||
Optional[Integer[1200, 9000]] $mtu = undef, | |||
Array[Hash[String[1], Variant[String[1], Boolean]]] $routes = [], | |||
Hash[String, Hash[Any, String]] $sections = {}, |
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.
Same
The last task would be to extend spec/defines/interface_spec.rb ? |
Pull Request (PR) description
Make it possible to define custom sections and settings via hash for systemd network interfaces
This Pull Request (PR) fixes the following issues
None, feature-request