Defined Type: openiosds::oioproxy
- Defined in:
- manifests/oioproxy.pp
Overview
Configure and install an OpenIO oioproxy service
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'manifests/oioproxy.pp', line 2
define openiosds::oioproxy (
$action = 'create',
$type = 'oioproxy',
$num = '0',
$ns = undef,
$ipaddress = $::ipaddress,
$port = $::openiosds::params::oioproxy_port,
$debug = false,
$no_exec = false,
) {
if ! defined(Class['openiosds']) {
include openiosds
}
# Validation
$actions = ['create','remove']
validate_re($action,$actions,"${action} is invalid.")
validate_string($type)
validate_integer($num)
validate_string($ns)
if ! has_interface_with('ipaddress',$ipaddress) { fail("${ipaddress} is invalid.") }
validate_integer($port)
validate_bool($debug)
if $debug { $verbose = '-v ' }
# Namespace
if $action == 'create' {
if ! defined(Openiosds::Namespace[$ns]) {
fail('You must include the namespace class before using OpenIO defined types.')
}
}
# Service
openiosds::service {"${ns}-${type}-${num}":
action => $action,
type => $type,
num => $num,
ns => $ns,
} ->
# Init
gridinit::program { "${ns}-${type}-${num}":
action => $action,
command => "${openiosds::bindir}/oio-proxy ${verbose} -p ${openiosds::runstatedir}/${ns}-${type}-${num}.pid -s OIO,${ns},${type},${num} ${ipaddress}:${port} ${ns}",
group => "${ns},${type},${type}-${num}",
uid => $openiosds::user,
gid => $openiosds::group,
no_exec => $no_exec,
}
}
|