Fixes after first round of testing
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
d1d9546e50
commit
3ecc9dc5e1
|
@ -8,8 +8,10 @@
|
||||||
# Explanation of what this parameter affects and what it defaults to.
|
# Explanation of what this parameter affects and what it defaults to.
|
||||||
#
|
#
|
||||||
class grafyaml (
|
class grafyaml (
|
||||||
|
$config_dir = '',
|
||||||
$git_revision = 'master',
|
$git_revision = 'master',
|
||||||
$git_source = 'https://git.openstack.org/openstack-infra/grafyaml',
|
$git_source = 'https://git.openstack.org/openstack-infra/grafyaml',
|
||||||
|
$grafana_url = 'http://localhost:8080',
|
||||||
) {
|
) {
|
||||||
include ::pip
|
include ::pip
|
||||||
|
|
||||||
|
@ -41,15 +43,22 @@ class grafyaml (
|
||||||
force => true,
|
force => true,
|
||||||
source => $config_dir,
|
source => $config_dir,
|
||||||
require => File['/etc/grafyaml'],
|
require => File['/etc/grafyaml'],
|
||||||
notify => Exec['grafana_dashboards_update'],
|
notify => Exec['grafana_dashboard_update'],
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'grafana_dashboards_update':
|
file { '/etc/grafyaml/grafyaml.conf':
|
||||||
command => 'grafana-dashboards update /etc/grafyaml/config',
|
ensure => present,
|
||||||
|
content => template('grafyaml/grafyaml.conf.erb'),
|
||||||
|
mode => '0400',
|
||||||
|
require => File['/etc/grafyaml'],
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { 'grafana_dashboard_update':
|
||||||
|
command => 'grafana-dashboard --config-file /etc/grafyaml/grafyaml.conf update /etc/grafyaml/config',
|
||||||
path => '/bin:/usr/bin:/usr/local/bin',
|
path => '/bin:/usr/bin:/usr/local/bin',
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
require => [
|
require => [
|
||||||
Package['python-grafyaml'],
|
Exec['install_grafyaml'],
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[grafana]
|
||||||
|
url = <%= @grafana_url %>
|
Loading…
Reference in New Issue