diff --git a/manifests/site.pp b/manifests/site.pp index 0f93705e08..8ae5747d74 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -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'), } } diff --git a/modules/openstack_project/manifests/cacti.pp b/modules/openstack_project/manifests/cacti.pp index 17fbf0e6fc..2c6a69eca1 100644 --- a/modules/openstack_project/manifests/cacti.pp +++ b/modules/openstack_project/manifests/cacti.pp @@ -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', + } + + } diff --git a/modules/openstack_project/manifests/cacti_device.pp b/modules/openstack_project/manifests/cacti_device.pp deleted file mode 100644 index 9bc980cf73..0000000000 --- a/modules/openstack_project/manifests/cacti_device.pp +++ /dev/null @@ -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'] - } -}