Use SSL for database connection when zabbix_server_dbtlsconnect is set #951
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
I am setting up Zabbix with a database where SSL is enforced. Zabbix itself works fine with this, thanks to the
zabbix_server_dbtlsconnect
parameter, but a few of the playbook's setup tasks try to connect without TLS, which fails. This adds a parameter to enable TLS if the server would also be set to use it.This isn't a perfect solution, but the
community.mysql
collection doesn't provide a way to use a TLS connection without setting one ofcheck_hostname
,ca_cert
,client_key
, orclient_hostname
, and we don't (can't, in our case) specify a cert/key. This will potentially fail when the host presents a cert with the wrong hostname (which can happen ifzabbix_server_dbtlsconnect
is set torequired
rather thanverify_ca
orverify_full
). However, there's not a way to enable TLS without setting one of these options without also changing the MySQL collection.There's some more background on this issue in the
community.mysql
collection: ansible-collections/community.mysql#90(I'm not convinced this is the right approach, though it does fix our particular use case! If there's another way to fix this that would be better, I'd appreciate the feedback and can try to update the PR if desired.)
ISSUE TYPE
COMPONENT NAME
zabbix_server role