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':
path => "${ruby::path}:${base::path}",
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")
$pid = pid_path($name)
$log = log_path($name)

View File

@ -1,38 +1,49 @@
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 => $configure,
preconfigure => "LDFLAGS='-rdynamic -Wl,-export-dynamic'",
path => "${build_path}:${with_ruby_path}"
}
if ($osfamily == 'debian') {
$packages = [
'libyaml-dev', 'libreadline-dev', 'libssl-dev', 'libffi-dev',
'libncurses5-dev', 'libcurl4-openssl-dev', 'zlib1g-dev',
'libxml2', 'libxml2-dev', 'libxslt1.1', 'libxslt1-dev'
]
package { $packages:
ensure => installed,
before => Build_and_install[$name]
}
bash_rc_d { 'ruby':
ensure => present,
path => $base::local_path,
require => Build_and_install[$name]
}
}
class ruby($version, $deb_url = '', $configure = "--disable-install-doc", $build_path = '') {
gem { [ 'bundler', 'penchant' ]:
require => Build_and_install[$name],
path => $with_ruby_path,
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)
build_and_install { $name:
version => $version,
source => "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-<%= version %>.tar.gz",
configure => $configure,
preconfigure => "LDFLAGS='-rdynamic -Wl,-export-dynamic'",
path => "${build_path}:${with_ruby_path}"
}
if ($osfamily == 'debian') {
$packages = [
'libyaml-dev', 'libreadline-dev', 'libssl-dev', 'libffi-dev',
'libncurses5-dev', 'libcurl4-openssl-dev', 'zlib1g-dev',
'libxml2', 'libxml2-dev', 'libxslt1.1', 'libxslt1-dev'
]
package { $packages:
ensure => installed,
before => Build_and_install[$name]
}
bash_rc_d { 'ruby':
ensure => present,
path => $base::local_path,
require => Build_and_install[$name]
}
}
Build_and_install[ruby] -> Gem['bundler', 'penchant']
}
}

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
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 %> \
puppet apply <%= additional_puppet_options %> \
--confdir=$PWD \