Created
August 3, 2014 19:03
-
-
Save stefanjenkner/9d31c58f5d60b5b58031 to your computer and use it in GitHub Desktop.
Finishing puppet-dashboard 2.0 installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finishing puppet-dashboard 2.0 installation | |
# | |
# $ cd /usr/share/puppet-dashboard | |
# $ RAILS_ENV=production bundle exec rake db:setup | |
# $ RAILS_ENV=production bundle exec rake db:migrate | |
# $ RAILS_ENV=production bundle exec rake assets:precompile | |
$install_dir = '/usr/share/puppet-dashboard' | |
$dashboard_user = 'puppet' | |
$dashboard_group = 'puppet' | |
file { "${install_dir}/db/schema.rb" : | |
ensure => present, | |
owner => $dashboard_user, | |
group => $dashboard_group, | |
replace => false, | |
require => Vcsrepo[$install_dir], | |
} | |
~> | |
file { [ | |
"${install_dir}/log", | |
"${install_dir}/public", | |
"${install_dir}/tmp", | |
] : | |
ensure => directory, | |
owner => $dashboard_user, | |
group => $dashboard_group, | |
} | |
-> | |
exec { 'puppet_dashboard rake db:setup': | |
cwd => $install_dir, | |
environment => 'RAILS_ENV=production', | |
command => 'bundle exec rake db:setup', | |
onlyif => 'test "Current version: 0" = "$(bundle exec rake db:version)"', | |
user => $dashboard_user, | |
logoutput => 'on_failure', | |
returns => [0, 1], | |
require => [ | |
Postgresql::Server::Db['puppet_dashboard'], | |
Bundler::Install[$install_dir], | |
File["${install_dir}/config/database.yml"], | |
File["${install_dir}/log"], | |
], | |
} | |
-> | |
exec { 'puppet_dashboard rake db:migrate': | |
cwd => $install_dir, | |
environment => 'RAILS_ENV=production', | |
command => 'bundle exec rake db:migrate', | |
onlyif => 'bundle exec rake db:migrate:status |grep "[[:space:]]down[[:space:]]"', | |
user => $dashboard_user, | |
logoutput => 'on_failure', | |
require => [ | |
Postgresql::Server::Db['puppet_dashboard'], | |
Bundler::Install[$install_dir], | |
File["${install_dir}/config/database.yml"], | |
File["${install_dir}/log"], | |
], | |
} | |
-> | |
exec { 'puppet_dashboard rake assets:precompile': | |
cwd => $install_dir, | |
command => 'bundle exec rake assets:precompile', | |
creates => "${install_dir}/public/assets", | |
user => $dashboard_user, | |
logoutput => 'on_failure', | |
require => [ | |
Bundler::Install[$install_dir], | |
File["${install_dir}/public"], | |
File["${install_dir}/tmp"], | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment