这里的傀儡很新。
假设:
define add_user ($shell) {
$username = $title
user { $username:
shell = $shell,
}
group { $username:
require => User[$username]
}
}
和
class zsh {
package { 'zsh': ensure => 'installed' }
}
class bash {
package { 'bash': ensure => 'installed' }
}
最后:
node default {
add_user { 'foo':
shell => '/bin/zsh'
}
}
如何设置用户对shell的要求?
答案 0 :(得分:0)
尝试在add_user函数中添加类似的内容:
define add_user ($shell) {
case $shell {
'/bin/zsh': { include zsh }
'/bin/bash': { include bash }
default: { fail('Unknown Shell') }
}
...
}