Last active
August 29, 2015 14:01
-
-
Save sohooo/fd8e12531d6e70387ea1 to your computer and use it in GitHub Desktop.
Creating jailed users based on my jailkit module; interfacing with common::shelluser.
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
common::jailuser { 'nova': | |
sections => ['jk_lsh', 'basicshell'], | |
binds => ['/var/log => log', '/opt => opt'], | |
keys => ['funky', 'george'], | |
} | |
define common::jailuser( | |
$user = $title, | |
$sections = [], | |
$binds = [], | |
$keys = [], | |
) { | |
validate_array($sections) | |
validate_array($binds) | |
validate_array($keys) | |
$jailroot = '/opt/jails' | |
$userjail = "${jailroot}/${user}" | |
$userhome = "${userjail}/./home/${user}" | |
common::shelluser { $user: | |
keys => $keys, | |
homepath => $userhome, | |
} | |
require jailkit | |
jail { $userjail: | |
ensure => present, | |
sections => $sections, | |
} | |
jailuser { $user: | |
ensure => present, | |
jail => $userjail, | |
} | |
# common::jailuser::bind stuff... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment