Skip to content

Commit

Permalink
Merge pull request #722 from voxpupuli/issue/226
Browse files Browse the repository at this point in the history
change path or my.cnf for mysqld_exporter
  • Loading branch information
bastelfreak committed May 19, 2024
2 parents 450441f + d27b82c commit 5a42167
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6678,7 +6678,7 @@ Data type: `Stdlib::Absolutepath`

The path to put the my.cnf file

Default value: `'/etc/.my.cnf'`
Default value: `'/etc/mysqld_exporter-my.cnf'`

##### <a name="-prometheus--mysqld_exporter--cnf_host"></a>`cnf_host`

Expand Down
2 changes: 1 addition & 1 deletion manifests/mysqld_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
String[1] $service_name,
String[1] $user,
String[1] $version,
Stdlib::Absolutepath $cnf_config_path = '/etc/.my.cnf',
Stdlib::Absolutepath $cnf_config_path = '/etc/mysqld_exporter-my.cnf',
Stdlib::Host $cnf_host = localhost,
Stdlib::Port $cnf_port = 3306,
String[1] $cnf_user = login,
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/mysqld_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

context 'default' do
describe 'options is correct' do
it { is_expected.to contain_prometheus__daemon('mysqld_exporter').with('options' => '--config.my-cnf=/etc/.my.cnf') }
it { is_expected.to contain_prometheus__daemon('mysqld_exporter').with('options' => '--config.my-cnf=/etc/mysqld_exporter-my.cnf') }
end
end

Expand All @@ -23,7 +23,7 @@
end

describe 'options is correct' do
it { is_expected.to contain_prometheus__daemon('mysqld_exporter').with('options' => '-config.my-cnf=/etc/.my.cnf') }
it { is_expected.to contain_prometheus__daemon('mysqld_exporter').with('options' => '-config.my-cnf=/etc/mysqld_exporter-my.cnf') }
end
end

Expand All @@ -35,7 +35,7 @@
end

it do
content = catalogue.resource('file', '/etc/.my.cnf').send(:parameters)[:content]
content = catalogue.resource('file', '/etc/mysqld_exporter-my.cnf').send(:parameters)[:content]
expect(content).to include('secret')
end
end
Expand All @@ -55,7 +55,7 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/etc/mysqld_exporter_web-config.yml').with(ensure: 'file') }

it { is_expected.to contain_prometheus__daemon('mysqld_exporter').with(options: '--config.my-cnf=/etc/.my.cnf --web.config.file=/etc/mysqld_exporter_web-config.yml') }
it { is_expected.to contain_prometheus__daemon('mysqld_exporter').with(options: '--config.my-cnf=/etc/mysqld_exporter-my.cnf --web.config.file=/etc/mysqld_exporter_web-config.yml') }
end
end
end
Expand Down

0 comments on commit 5a42167

Please sign in to comment.