rearranging god things

This commit is contained in:
John Bintz 2012-05-02 08:25:29 -04:00
parent df6bdfc9e2
commit 61f6767c8e
7 changed files with 65 additions and 28 deletions

View File

@ -37,24 +37,24 @@ Capistrano::Configuration.instance.load do
run "cd #{base_dir} && #{sudo} rm -Rf #{apps}" run "cd #{base_dir} && #{sudo} rm -Rf #{apps}"
end end
desc "Apply the configuration" desc "Copy files to the remote server"
task :apply do task :copy_files do
top.copy top.copy
top.copy_shared top.copy_shared
top.copy_skel top.copy_skel
end
desc "Apply the configuration"
task :apply do
top.copy_files
run "cd #{puppet_dir} && #{sudo} ./apply" run "cd #{puppet_dir} && #{sudo} ./apply"
end end
desc "Bootstrap the server" desc "Bootstrap the server"
task :bootstrap do task :bootstrap do
top.copy top.copy_files
top.copy_shared top.rename if rename_server
top.copy_skel
if rename_server
top.rename
end
run "cd #{puppet_dir} && #{sudo} ./bootstrap" run "cd #{puppet_dir} && #{sudo} ./bootstrap"
end end

View File

@ -0,0 +1,22 @@
Capistrano::Configuration.instance.load do
server '127.0.0.1:2222', :vagrant
set(:user) { 'vagrant' }
set(:password) { 'vagrant' }
task :ensure_puppet do
require 'socket'
begin
p = TCPSocket.new('localhost', 2222)
p.close
rescue Errno::ECONNREFUSED
system %{vagrant up}
p = TCPSocket.new('localhost', 2222)
p.close
end
end
before 'apply', 'ensure_puppet'
before 'bootstrap', 'ensure_puppet'
end

View File

@ -0,0 +1,29 @@
class god-debian {
class { god: }
$god_init_d = "${base::share_path}/god/god-init.d"
file { $god_init_d:
content => template('god/god-init.d'),
require => File[$god::share],
mode => 755
}
file { 'etc/init.d/god':
ensure => $god_init_d,
require => Class['god']
}
update_rc_d_defaults { 'god':
require => File['/etc/init.d/god']
}
running_service { 'god':
require => Update_rc_d_defaults['god']
}
file { '/usr/local/sbin/resurrect':
content => template('god-debian/resurrect'),
mode => 755
}
}

View File

@ -9,26 +9,11 @@ class god {
$god_dir = "${base::config_path}/god.d" $god_dir = "${base::config_path}/god.d"
$pid_path = pid_path($name) $pid_path = pid_path($name)
file { '/etc/init.d/god':
content => template('god/god-init.d'),
mode => 755
}
file { $god_dir: file { $god_dir:
ensure => directory ensure => directory
} }
update_rc_d_defaults { $name: $share = "${base::share_path}/god"
require => File['/etc/init.d/god'] file { $share: ensure => directory }
}
running_service { $name:
require => Update_rc_d_defaults[$name]
}
file { '/usr/local/sbin/resurrect':
content => template('god/resurrect'),
mode => 755
}
} }

View File

@ -1,11 +1,12 @@
class ruby($version) { class ruby($version, $configure = "--disable-install-doc", $build_path = '') {
$path = bin_path($name) $path = bin_path($name)
$with_ruby_path = "${path}:${base::path}" $with_ruby_path = "${path}:${base::path}"
build_and_install { $name: build_and_install { $name:
version => $version, version => $version,
source => "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-<%= version %>.tar.gz", source => "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-<%= version %>.tar.gz",
configure => "--disable-install-doc" configure => $configure,
path => $build_path
} }
gem { [ 'bundler', 'penchant' ]: gem { [ 'bundler', 'penchant' ]: