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

issue #604 : compatibility for ssl connections to the database #658

Closed
wants to merge 2 commits into from
Closed

issue #604 : compatibility for ssl connections to the database #658

wants to merge 2 commits into from

Conversation

moon-hawk
Copy link

@moon-hawk moon-hawk commented Apr 3, 2023

e.g. azure database for mysql

Pull Request (PR) description

Added the possibility to provide ssl ca, cert and key paths for ssl connection to the database.
Due to the fact that mysqld_exporter determines this on the ssl-ca variable in exporter my cnf file, this variable is needed at least.

This Pull Request (PR) fixes the following issues

Fixes #604

Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

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

Managing the system wide configuration of MySQL looks like a responsibility for the mysql module, and not this one… but it is another story.

The unit tests in spec/classes/mysqld_exporter_spec.rb do not make much sense, but can you add some for these parameters?

      context 'with TLS encryted connexion to MySQL' do
        let(:params) do
          {
            cnf_ssl_ca: '/tmp/ca.pem',
            cnf_ssl_cert: '/tmp/cert.pem',
            cnf_ssl_key: '/tmp/key.pem',
          }
        end

        it { is_expected.to contain_file('/etc/.my.cnf').with_content(%r{^ssl-ca = /tmp/ca.pem$}) }
        # ...
      end

@moon-hawk moon-hawk closed this by deleting the head repository Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mysqld_exporter configuration for ssl not possible
4 participants