Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 51b7124

Browse files
committed
Use a healthcheck as recommended by the docs
This implements some additional ordering of resources so that ones that require the API are not run before the API is up.
1 parent cf43825 commit 51b7124

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

.fixtures.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ fixtures:
1616
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
1717
ref: 1.0.2
1818
forge_modules:
19+
healthcheck: "puppet/healthcheck"

manifests/grafana.pp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,22 @@
5454
cwd => '/usr/share/grafana',
5555
refreshonly => true,
5656
}
57+
58+
http_conn_validator { 'grafana-conn-validator' :
59+
host => 'localhost',
60+
port => $puppet_metrics_dashboard::grafana_http_port,
61+
use_ssl => $puppet_metrics_dashboard::use_dashboard_ssl,
62+
test_url => '/public/img/grafana_icon.svg',
63+
require => [
64+
Class['grafana'],
65+
Exec['update Grafana admin password'],
66+
],
67+
}
68+
69+
Http_conn_validator <| title == 'grafana-conn-validator' |>
70+
-> Grafana_datasource <| tag == 'puppet_metrics_dashboard' |>
71+
72+
Http_conn_validator <| title == 'grafana-conn-validator' |>
73+
-> Grafana_dashboard <| tag == 'puppet_metrics_dashboard' |>
74+
5775
}

metadata.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"project_page": "https://github.com/puppetlabs/puppet_metrics_dashboard",
99
"issues_url": "https://github.com/puppetlabs/puppet_metrics_dashboard/issues",
1010
"dependencies": [
11+
{
12+
"name": "puppet-healthcheck",
13+
"version_requirement": ">= 0.4.1 < 1.0.0"
14+
},
1115
{
1216
"name": "puppetlabs-stdlib",
1317
"version_requirement": ">= 1.0.0 < 6.0.0"

spec/spec_helper_acceptance.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
end
2828

2929
on host, puppet('module', 'install', 'puppet-grafana')
30+
on host, puppet('module', 'install', 'puppet-healthcheck')
3031
on host, puppet('module', 'install', 'puppetlabs-inifile')
3132
if fact('osfamily') == 'Debian'
3233
on host, puppet('module', 'install', 'puppetlabs-apt')

0 commit comments

Comments
 (0)