Initial commit for puppet logic

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2015-10-07 14:15:51 -04:00
parent 3bbab2cd67
commit d1d9546e50
1 changed files with 46 additions and 1 deletions

View File

@ -7,4 +7,49 @@
# [*sample_parameter*]
# Explanation of what this parameter affects and what it defaults to.
#
class grafyaml {}
class grafyaml (
$git_revision = 'master',
$git_source = 'https://git.openstack.org/openstack-infra/grafyaml',
) {
include ::pip
vcsrepo { '/opt/grafyaml':
ensure => latest,
provider => git,
revision => $git_revision,
source => $git_source,
}
exec { 'install_grafyaml':
command => 'pip install /opt/grafyaml',
path => '/usr/local/bin:/usr/bin:/bin/',
refreshonly => true,
subscribe => Vcsrepo['/opt/grafyaml'],
}
file { '/etc/grafyaml':
ensure => directory,
}
file { '/etc/grafyaml/config':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
recurse => true,
purge => true,
force => true,
source => $config_dir,
require => File['/etc/grafyaml'],
notify => Exec['grafana_dashboards_update'],
}
exec { 'grafana_dashboards_update':
command => 'grafana-dashboards update /etc/grafyaml/config',
path => '/bin:/usr/bin:/usr/local/bin',
refreshonly => true,
require => [
Package['python-grafyaml'],
],
}
}