Conversation
ekohl
left a comment
There was a problem hiding this comment.
Thanks for the PR. It looks good, just some minor comments.
It would be great if you could add a test or 2 in https://github.com/theforeman/puppet-dns/blob/master/spec/defines/dns_view_spec.rb.
| # Optional. An array of response policy configurations for the view in the | ||
| # following format: | ||
| # [{'zone' => '<ZONE_NAME>', 'policy' => '<POLICY_ACTION>', 'log' => true|false, | ||
| # 'max_policy_ttl' => <TTL_VALUE>, 'cname_domain' => '<CNAME_DOMAIN>'}] |
There was a problem hiding this comment.
puppet-strings should link to the type alias, so explaining the format is probably redundant.
| # Example: [{'zone' => 'example.com', 'policy' => 'passthru', 'log' => true, | ||
| # 'max_policy_ttl' => 3600}, {'zone' => 'example.net', | ||
| # 'policy' => 'cname', 'cname_domain' => 'example.com'}] |
There was a problem hiding this comment.
Perhaps add a full @example instead?
There was a problem hiding this comment.
How about this
# @param response_policy
# Optional. An array of response policy configurations for the view in the
# following format:
# @example
# dns::view { 'example':
# response_policy => [
# {'zone' => 'example', 'policy' => 'passthru', 'log' => true, 'max_policy_ttl' => 3600},
# {'zone' => 'example.net', 'policy' => 'cname', 'cname_domain' => 'example.com'}
# ],
# }
#
There was a problem hiding this comment.
I think that's good, but @example takes a description of the example. This allows puppet-strings to correctly list multiple examples and link to them.
There was a problem hiding this comment.
Yes, a brief description is important. Further, I would like to add multiple examples for separate use cases like below.
# @param response_policy
# Optional. An array of response policy configurations for the view.
#
# @example Complex response policy with multiple zones and policies
# dns::view { 'complex_example':
# response_policy => [
# {
# 'zone' => 'example',
# 'policy' => 'passthru',
# 'log' => true,
# 'max_policy_ttl' => 3600
# },
# {
# 'zone' => 'example.net',
# 'policy' => 'cname',
# 'cname_domain' => 'example.com'
# }
# ],
# }
#
# @example Simple response policy with a single zone
# dns::view { 'simple_example':
# response_policy => [
# {
# 'zone' => 'rpz.example.com'
# }
# ],
# }
There was a problem hiding this comment.
Hi,
kindly review this and please proceed if everything is okay
|
For the test case, I have added most of the possible combinations below. However, I am not much familliar with this :) |
|
Hi, please let me know how to proceed with the changes. |
Implemented as suggested Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
Implemented as suggested Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
Implementing as suggested Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
|
The commit suggestion actions failed due to outdated changes and CI pipeline issues. I’ve added a test case to address the feedback as well. Could you please review it when you get a chance? |
This PR, try to addresses the issue #251, which involves adding a response-policy to the
dns::view.Below example shows how to use the
dns::viewdefined type with theresponse-policyparameter:It will generate the following
BINDconfiguration:The
response-policymay support a few other parameters, which I have not included for simplicity.