a ton of stuff
This commit is contained in:
parent
6abf601231
commit
64c306bed8
6
README.md
Normal file
6
README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
My Puppet stuff, all collected together into one gem. Uses
|
||||||
|
Capistrano to deploy to a remote server and execute the
|
||||||
|
configs.
|
||||||
|
|
||||||
|
`require "puppet-standalone-mashup/capistrano"`
|
||||||
|
|
@ -20,6 +20,10 @@ module Puppet
|
|||||||
def sbin_path(install_path, name)
|
def sbin_path(install_path, name)
|
||||||
File.join(install_path, name, 'sbin')
|
File.join(install_path, name, 'sbin')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pid_path(pid_path, name)
|
||||||
|
File.join(pid_path, "#{name}.pid")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -27,3 +31,4 @@ end
|
|||||||
class Puppet::Parser::Scope
|
class Puppet::Parser::Scope
|
||||||
include Puppet::Modules::CommonDirectories
|
include Puppet::Modules::CommonDirectories
|
||||||
end
|
end
|
||||||
|
|
||||||
|
8
shared/lib/puppet/parser/functions/pid_path.rb
Normal file
8
shared/lib/puppet/parser/functions/pid_path.rb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
require 'puppet/modules/common_directories'
|
||||||
|
|
||||||
|
module Puppet::Parser::Functions
|
||||||
|
newfunction(:pid_path, :type => :rvalue) do |args|
|
||||||
|
pid_path(lookupvar('base::pid_path'), *args)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -4,7 +4,7 @@ Puppet::Type.type(:make_and_install).provide(:action) do
|
|||||||
desc "Configure a program to install"
|
desc "Configure a program to install"
|
||||||
|
|
||||||
def create
|
def create
|
||||||
system %{bash -c 'cd #{@resource[:build_path]} ; make && make install'}
|
system %{bash -c '#{path} cd #{@resource[:build_path]} ; make && make install'}
|
||||||
File.symlink(@resource[:install_path], symlink_path)
|
File.symlink(@resource[:install_path], symlink_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -21,4 +21,8 @@ Puppet::Type.type(:make_and_install).provide(:action) do
|
|||||||
def symlink_path
|
def symlink_path
|
||||||
File.join(File.dirname(@resource[:install_path]), @resource[:name])
|
File.join(File.dirname(@resource[:install_path]), @resource[:name])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def path
|
||||||
|
@resource[:path].empty? ? '' : "export PATH=#{@resource[:path]}:$PATH ; "
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -18,5 +18,9 @@ Puppet::Type.newtype(:make_and_install) do
|
|||||||
newparam(:options) do
|
newparam(:options) do
|
||||||
desc "Options to build the software"
|
desc "Options to build the software"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
newparam(:path) do
|
||||||
|
desc "Binary path to add"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ define build_and_install($version, $source, $path = '', $configure = '') {
|
|||||||
make_and_install { $name:
|
make_and_install { $name:
|
||||||
build_path => $build_path,
|
build_path => $build_path,
|
||||||
install_path => $install_path,
|
install_path => $install_path,
|
||||||
|
path => $path,
|
||||||
require => Configure[$name],
|
require => Configure[$name],
|
||||||
ensure => present
|
ensure => present
|
||||||
}
|
}
|
||||||
|
4
shared/modules/installed_package/manifests/init.pp
Normal file
4
shared/modules/installed_package/manifests/init.pp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
define installed_package {
|
||||||
|
package { $name: ensure => installed }
|
||||||
|
}
|
||||||
|
|
3
shared/modules/running_service/manifests/init.pp
Normal file
3
shared/modules/running_service/manifests/init.pp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
define running_service {
|
||||||
|
service { $name: ensure => running }
|
||||||
|
}
|
7
shared/modules/update_rc_d_defaults/manifests/init.pp
Normal file
7
shared/modules/update_rc_d_defaults/manifests/init.pp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
define update_rc_d_defaults {
|
||||||
|
exec { "update-rc.d-${name}":
|
||||||
|
command => "update-rc.d ${name} defaults",
|
||||||
|
path => $base::path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user