-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add features needed to support more grid services
- Loading branch information
Showing
11 changed files
with
151 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# | ||
# | ||
module Puppet::Parser::Functions | ||
newfunction(:expandpoollist, :type => :rvalue, :doc =><<-EOS | ||
This function returns the expanded list of pool accounts. Use with care ... | ||
EOS | ||
) do |args| | ||
from=args[0] | ||
number=args[1] | ||
prefix=args[2] | ||
digits=args[3] | ||
expanded = [] | ||
if ("0" == digits.to_s) | ||
expanded.push(prefix) | ||
else | ||
(from.to_s.to_i() .. (from.to_s.to_i()+number.to_s.to_i()-1)).each { |c| | ||
format = '%.'+digits.to_s()+'d' | ||
name=prefix + (format % c).to_s() | ||
expanded.push(name) | ||
} | ||
end | ||
return expanded | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
define vosupport::setupsandbox ( | ||
$prefix=$name, | ||
$group='', | ||
$voname='', | ||
) | ||
{ | ||
if ! defined(File["/var/cream_sandbox/$group"]) { | ||
file{"/var/cream_sandbox/$group": | ||
ensure => 'directory', | ||
owner => 'tomcat', | ||
group => $group, | ||
mode => 0770, | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define vosupport::setupsudoers ( | ||
$prefix=$name, | ||
$number, | ||
$start=1, | ||
$digits=3, | ||
$voname='', | ||
) | ||
{ | ||
$list=expandpoollist($start,$number,$prefix,$digits) | ||
file{"/etc/sudoers.d/glexec_${prefix}": | ||
content => template('vosupport/sudoers_forcecream.erb'), | ||
ensure => present, | ||
owner => "root", | ||
group => "root", | ||
mode => 0640, | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
define vosupport::virtual_setupsandbox ( | ||
$prefix=$name, | ||
$group='', | ||
$prefix='', | ||
$services='', | ||
$static='', | ||
$voname='', | ||
) | ||
{ | ||
@vosupport::setupsandbox {$name: | ||
group => $group, | ||
voname => $voname, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
define vosupport::virtual_setupsudoers ( | ||
$prefix=$name, | ||
$number, | ||
$start=1, | ||
$digits=3, | ||
$voname='', | ||
) | ||
{ | ||
@vosupport::setupsudoers {$name: | ||
prefix => $prefix, | ||
number => $number, | ||
start => $start, | ||
digits => $digits, | ||
voname => $voname, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class vosupport::vo_sandboxdir { | ||
|
||
if ! defined(File['/var/cream_sandbox']) { | ||
file{'/var/cream_sandbox': | ||
ensure => 'directory', | ||
owner => 'tomcat', | ||
group => 'tomcat', | ||
mode => 0775 | ||
} | ||
} | ||
# | ||
# we only need the group ID here for each vo name | ||
# just loop over the mappings hash which has all the information which we need | ||
|
||
$mappings = hiera_hash('vosupport::mappings',undef) | ||
create_resources('vosupport::virtual_setupsandbox',$mappings) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class vosupport::vo_sudoers { | ||
$poolaccounts = hiera_hash('vosupport::poolaccounts',undef) | ||
create_resources('vosupport::virtual_setupsudoers',$poolaccounts) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Runas_Alias GLEXEC_<%=prefix.upcase%> = \ | ||
<%= list.join(", ")%> | ||
|
||
Cmnd_Alias GLEXEC_CMDS_<%=prefix.upcase%> = /bin/echo, /bin/mkdir, /bin/cp, /bin/cat, /usr/bin/groups, /usr/bin/whoami, /bin/dd, /bin/mv, /usr/bin/id, /bin/kill, /usr/libexec/lsf_submit.sh, /usr/libexec/lsf_status.sh, /usr/libexec/lsf_cancel.sh, /usr/libexec/lsf_hold.sh, /usr/libexec/lsf_resume.sh, /usr/bin/glite-cream-copyProxyToSandboxDir.sh, /usr/bin/glite-cream-createsandboxdir, /usr/bin/glite-ce-cream-purge-sandbox, /usr/bin/glite-ce-cream-purge-proxy, /usr/bin/glite-ce-cream-create-wrapper, /bin/ls | ||
|
||
|
||
# Defaults specification (for cream) | ||
|
||
|
||
Defaults>GLEXEC_<%=prefix.upcase%> !requiretty # Added for cream | ||
Defaults>GLEXEC_<%=prefix.upcase%> env_keep += "BLAHPD_LOCATION BLAHPD_CONFIG_LOCATION" | ||
# User privilege specification (for cream) | ||
root ALL=(ALL) ALL # Added for cream | ||
tomcat ALL=(GLEXEC_<%=prefix.upcase%>) NOPASSWD: GLEXEC_CMDS_<%=prefix.upcase%> # Added for cream |