rearranging god things
This commit is contained in:
parent
df6bdfc9e2
commit
61f6767c8e
@ -37,24 +37,24 @@ Capistrano::Configuration.instance.load do
|
||||
run "cd #{base_dir} && #{sudo} rm -Rf #{apps}"
|
||||
end
|
||||
|
||||
desc "Apply the configuration"
|
||||
task :apply do
|
||||
desc "Copy files to the remote server"
|
||||
task :copy_files do
|
||||
top.copy
|
||||
top.copy_shared
|
||||
top.copy_skel
|
||||
end
|
||||
|
||||
desc "Apply the configuration"
|
||||
task :apply do
|
||||
top.copy_files
|
||||
|
||||
run "cd #{puppet_dir} && #{sudo} ./apply"
|
||||
end
|
||||
|
||||
desc "Bootstrap the server"
|
||||
task :bootstrap do
|
||||
top.copy
|
||||
top.copy_shared
|
||||
top.copy_skel
|
||||
|
||||
if rename_server
|
||||
top.rename
|
||||
end
|
||||
top.copy_files
|
||||
top.rename if rename_server
|
||||
|
||||
run "cd #{puppet_dir} && #{sudo} ./bootstrap"
|
||||
end
|
||||
|
22
lib/puppet-standalone-mashup/capistrano/vagrant.rb
Normal file
22
lib/puppet-standalone-mashup/capistrano/vagrant.rb
Normal 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
|
29
shared/additional-modules/god-debian/manifests/init.pp
Normal file
29
shared/additional-modules/god-debian/manifests/init.pp
Normal 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
|
||||
}
|
||||
}
|
||||
|
@ -9,26 +9,11 @@ class god {
|
||||
$god_dir = "${base::config_path}/god.d"
|
||||
$pid_path = pid_path($name)
|
||||
|
||||
file { '/etc/init.d/god':
|
||||
content => template('god/god-init.d'),
|
||||
mode => 755
|
||||
}
|
||||
|
||||
file { $god_dir:
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
update_rc_d_defaults { $name:
|
||||
require => File['/etc/init.d/god']
|
||||
}
|
||||
|
||||
running_service { $name:
|
||||
require => Update_rc_d_defaults[$name]
|
||||
}
|
||||
|
||||
file { '/usr/local/sbin/resurrect':
|
||||
content => template('god/resurrect'),
|
||||
mode => 755
|
||||
}
|
||||
$share = "${base::share_path}/god"
|
||||
file { $share: ensure => directory }
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
class ruby($version) {
|
||||
class ruby($version, $configure = "--disable-install-doc", $build_path = '') {
|
||||
$path = bin_path($name)
|
||||
$with_ruby_path = "${path}:${base::path}"
|
||||
|
||||
build_and_install { $name:
|
||||
version => $version,
|
||||
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' ]:
|
||||
|
Loading…
Reference in New Issue
Block a user