Merge "Run cacti's node generation from cron"

This commit is contained in:
Jenkins 2016-04-08 22:50:27 +00:00 committed by Gerrit Code Review
commit 7d3981bcf4
3 changed files with 17 additions and 11 deletions

View File

@ -211,7 +211,7 @@ node 'cacti.openstack.org' {
include openstack_project::ssl_cert_check
class { 'openstack_project::cacti':
sysadmins => hiera('sysadmins', []),
cacti_hosts => hiera('cacti_hosts'),
cacti_hosts => hiera_array('cacti_hosts'),
}
}

View File

@ -73,5 +73,20 @@ class openstack_project::cacti (
require => File['/var/lib/cacti/linux_host.xml'],
}
openstack_project::cacti_device { $cacti_hosts: }
file { '/var/lib/cacti/devices':
ensure => present,
content => join($cacti_hosts, " "),
mode => '0744',
owner => 'root',
group => 'root',
}
cron { 'add cacti hosts':
ensure => present,
user => root,
command => 'for host in $(cat /var/lib/cacti/devices); do /usr/local/bin/create_graphs.sh $host; done',
minute => '0',
}
}

View File

@ -1,9 +0,0 @@
# Define that adds a host to a cacti installation.
# Takes the fqdn of the host as the namevar for this define.
define openstack_project::cacti_device()
{
exec { "cacti_create_${name}":
command => "/usr/local/bin/create_graphs.sh ${name}",
require => Exec['cacti_import_xml']
}
}