diff options
Diffstat (limited to 'manifests/master')
-rw-r--r-- | manifests/master/dashboard.pp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/manifests/master/dashboard.pp b/manifests/master/dashboard.pp index df8bcf8..e3d56b5 100644 --- a/manifests/master/dashboard.pp +++ b/manifests/master/dashboard.pp @@ -1,21 +1,32 @@ +# simple installation of a puppet dashboard class puppet::master::dashboard( $settings = {}, $service = true, + $mysql_host = '127.0.0.1', $mysql_password, ) { package{'puppet-dashboard': ensure => installed, - } -> mysql::default_database{ - 'dashboard': - password => mysql_password($mysql_password), - host => '127.0.0.1'; - } -> file{ + } + + if $mysql_host == '127.0.0.1' { + mysql::default_database{ + 'dashboard': + password => mysql_password($mysql_password), + host => '127.0.0.1', + require => Package['puppet-dashboard'], + before => File['/usr/share/puppet-dashboard/config/database.yml'], + } + } + + file{ '/usr/share/puppet-dashboard/config/database.yml': content => template('puppet/master/dashboard/database.yml.erb'), owner => root, group => 'puppet-dashboard', - mode => '0640'; + mode => '0640', + require => Package['puppet-dashboard']; '/usr/share/puppet-dashboard/config/settings.yml': content => template('puppet/master/dashboard/settings.yml.erb'), owner => root, @@ -33,7 +44,7 @@ class puppet::master::dashboard( } file{'/etc/cron.daily/puppet-dashboard_cleanup': - content => "#/bin/bash + content => "#/bin/bash cd /usr/share/puppet-dashboard RAILS_ENV=production /usr/bin/rake reports:prune upto=1 unit=mon >> /usr/share/puppet-dashboard/log/cron.log RAILS_ENV=production /usr/bin/rake reports:prune:orphaned >> /usr/share/puppet-dashboard/log/cron.log @@ -47,8 +58,8 @@ RAILS_ENV=production /usr/bin/rake db:raw:optimize >> /usr/share/puppet-dashboar service{'puppet-dashboard': } if $service { Service['puppet-dashboard']{ - ensure => running, - enable => true, + ensure => running, + enable => true, subscribe => File['/usr/share/puppet-dashboard/config/database.yml','/usr/share/puppet-dashboard/config/settings.yml'], } } else { |