more changes

This commit is contained in:
John Bintz 2012-06-22 22:02:08 -04:00
parent 73e76766f1
commit 9b33e9dd17
5 changed files with 80 additions and 36 deletions

View File

@ -2,10 +2,10 @@ class god {
gem { 'god': gem { 'god':
path => "${ruby::path}:${base::path}", path => "${ruby::path}:${base::path}",
ensure => present, ensure => present,
require => Make_and_install['ruby'] require => Class['ruby']
} }
$bin = "${base::install_path}/ruby/bin/god" $bin = "${ruby::path}//god"
$dir = config_path("god.d") $dir = config_path("god.d")
$pid = pid_path($name) $pid = pid_path($name)
$log = log_path($name) $log = log_path($name)

View File

@ -1,6 +1,20 @@
class ruby($version, $configure = "--disable-install-doc", $build_path = '') { class ruby($version, $deb_url = '', $configure = "--disable-install-doc", $build_path = '') {
gem { [ 'bundler', 'penchant' ]:
path => "${path}:${base::path}",
ensure => present
}
if ($deb_url) {
$path = '/usr/bin'
remotedeb { ruby:
url => $deb_url,
version => $version
}
Remotedeb[ruby] -> Gem['bundler', 'penchant']
} else {
$path = bin_path($name) $path = bin_path($name)
$with_ruby_path = "${path}:${base::path}"
build_and_install { $name: build_and_install { $name:
version => $version, version => $version,
@ -29,10 +43,7 @@ class ruby($version, $configure = "--disable-install-doc", $build_path = '') {
} }
} }
gem { [ 'bundler', 'penchant' ]: Build_and_install[ruby] -> Gem['bundler', 'penchant']
require => Build_and_install[$name],
path => $with_ruby_path,
ensure => present
} }
} }

View File

@ -0,0 +1,23 @@
define debsource($apt_source, $keyfile = '', $host = '', $hash = '') {
$file = "/etc/apt/sources.list.d/${name}.list"
file { $file: content => $apt_source }
if ($host != '') {
exec { "debsource-${name}":
command => "apt-key adv --keyserver ${host} --recv ${hash} && apt-get update",
unless => "test $(apt-key list | grep ${hash} | wc -l) -ne 0",
path => $base::path,
require => File[$file]
}
}
if ($keyfile != '') {
exec { "debsource-${name}":
command => "curl $keyfile | apt-key add -",
path => $base::path,
require => File[$file],
unless => "test $(apt-key list | grep ${hash} | wc -l) -ne 0"
}
}
}

View File

@ -0,0 +1,10 @@
define remotedeb($url, $version) {
$deb = "/tmp/${name}.deb"
exec { "remotedeb-${name}":
command => "curl -o ${deb} ${url} && dpkg -i ${deb}",
unless => "test $(dpkg -l ${name} | grep ${version} | wc -l) -ne 0",
path => $base::path
}
}

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
mkdir -p ~/.puppet mkdir -p ~/.puppet
<%= use_sudo ? "sudo env" : "" %> RUBYLIB="${PWD}/shared/lib" \ <%= use_sudo ? "sudo env" : "" %> RUBYLIB="${PWD}/lib:${PWD}/shared/lib" \
<%= with_additional_puppet_bin_path %> \ <%= with_additional_puppet_bin_path %> \
puppet apply <%= additional_puppet_options %> \ puppet apply <%= additional_puppet_options %> \
--confdir=$PWD \ --confdir=$PWD \