Skip to content

Commit

Permalink
Merge pull request voxpupuli#286 from othalla/haproxy_allow_unix_sock…
Browse files Browse the repository at this point in the history
…et_stats

Test with unix socket for scraping uri
  • Loading branch information
bastelfreak authored Jan 10, 2019
2 parents 872e68c + a98e951 commit 244dbf4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/haproxy_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# The binary release version

class prometheus::haproxy_exporter(
Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl] $cnf_scrape_uri,
Variant[Stdlib::HTTPUrl, Pattern[/unix:(?:\/.+)+/]] $cnf_scrape_uri,
String $download_extension,
Array $extra_groups,
String $group,
Expand Down
18 changes: 18 additions & 0 deletions spec/classes/haproxy_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@
it { is_expected.to contain_group('haproxy-exporter') }
it { is_expected.to contain_prometheus__daemon('haproxy_exporter') }
end

context 'with unix socket as scraping url' do
let(:params) do
{
cnf_scrape_uri: 'unix:/var/haproxy/listen.sock',
arch: 'amd64',
os: 'linux',
bin_dir: '/usr/local/bin',
install_method: 'url'
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('prometheus') }
it { is_expected.to contain_user('haproxy-user') }
it { is_expected.to contain_group('haproxy-exporter') }
it { is_expected.to contain_prometheus__daemon('haproxy_exporter') }
end
end
end
end

0 comments on commit 244dbf4

Please sign in to comment.