Skip to content
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

Merged
merged 10 commits into from
Aug 19, 2024

Conversation

sallchr
Copy link
Contributor

@sallchr sallchr commented Jul 12, 2024

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

@@ -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 = {},
Copy link
Contributor

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?

@TheMeier
Copy link
Contributor

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

REFERENCE.md Show resolved Hide resolved
@@ -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 = {},
Copy link
Member

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:

Suggested change
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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@@ -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 = {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@sallchr
Copy link
Contributor Author

sallchr commented Jul 22, 2024

The last task would be to extend spec/defines/interface_spec.rb ?

@bastelfreak bastelfreak added the enhancement New feature or request label Aug 19, 2024
@bastelfreak bastelfreak merged commit cd4e8d6 into voxpupuli:master Aug 19, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants