-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Support multiple values in TLSAccept #947
Conversation
I am sorry for so many commits. I am neither ruby nor puppet developer 😞 If you understand, what I mean, could you please fix the "if"? I need join array values or just insert single string (Enum) value. Thank you. |
templates/zabbix_agentd.conf.erb
Outdated
@@ -310,7 +310,7 @@ LoadModulePath=<%= @loadmodulepath %> | |||
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection) | |||
# Default: | |||
# TLSAccept=unencrypted | |||
<% if @tlsaccept %>TLSAccept=<%= @tlsaccept %><% end %> | |||
<% if @tlsaccept and ( @tlsaccept.instance_of?(Array) or @tlsaccept.instance_of?(String) ) %>TLSAccept=<% if @tlsaccept.instance_of?(Array) %><%= scope.call_function('join', [@tlsaccept, ',']) %><% elsif @tlsaccept.instance_of?(String) %><%= @tlsaccept %><% end %><% end %> |
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.
Something like this (not tested)?
<% if @tlsaccept and ( @tlsaccept.instance_of?(Array) or @tlsaccept.instance_of?(String) ) %>TLSAccept=<% if @tlsaccept.instance_of?(Array) %><%= scope.call_function('join', [@tlsaccept, ',']) %><% elsif @tlsaccept.instance_of?(String) %><%= @tlsaccept %><% end %><% end %> | |
<% if @tlsaccept %>TLSAccept=<%= [@tlsaccept].flatten.join(',') %><% end %> |
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.
@smortex of course it works, thank you very much, it's simple and nice 👍
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.
Hi Robert, can you add the same datatype to the tlsaccept on the proxy?
Hello @Valantin, I hope it's correct. |
ok, now I can you add spec test for the classes? for agent exist
|
@wolfaba can you squash in one commit with good message? |
@Valantin is it better now? I hope I haven't broke it 😬 |
Pull Request (PR) description
Option TLSAccept in zabbix_agentd.conf accepts list of values separated with comma. But the module define tlsaccept as Enum of those three values. The string as comma separated list of values is not allowed anymore. Therefore the tlsaccept should be array of that enum and in the template the array should be joined with comma.
BTW: the same option TLSAccept is in zabbix_proxy.conf, but in the module the tlsaccept in proxy.pp is still simple string value.
Thank you.