puppet如何創建uid和gid不一致的用戶
請教一個用戶,我用puppet創建一個tomcat用戶,要求uid=506,gid=507,tomcat屬於tomcat的組,請問應該怎麼設置啊?!
我這樣設置,好像不行:
class user::tomcat {
user {
"tomcat":
uid => 506,
group => tomcat,
ensure => present,
shell =>"/bin/bash",
home => "/home/tomcat",
#managehome => true 保證新建用戶的時候會創建該用戶的home目錄;
managehome => true,
comment =>"tomcat services",
# password => '$1$Nnh0M0$t9s7Bbwx2fFer6IP/QGdA9',
}
group {
"tomcat":
ensure => present,
gid => 507,
}
}
不知道哪位兄弟知道,謝謝了!!!
《解決方案》
請問有誰知道啊?!!
《解決方案》
沒人回答嗎!?!:shutup:
《解決方案》
我沒試過,但是你可以嘗試用puppet在遠程執行命令啊
《解決方案》
本帖最後由 nbrr 於 2012-11-29 14:12 編輯
剛剛開始學puppet, 不知道這樣可不可以
加上 require => Group['tomcat'],
class user::tomcat {
user {
"tomcat":
uid =>'506',
gid => 'tomcat',
ensure => present,
shell =>"/bin/bash",
home => "/home/tomcat",
#managehome => true 保證新建用戶的時候會創建該用戶的home目錄;
managehome => true,
comment =>"tomcat services",
# password => '$1$Nnh0M0$t9s7Bbwx2fFer6IP/QGdA9',
require => Group['tomcat'],
}
group {
"tomcat":
ensure => present,
gid => '507',
}
}
《解決方案》
在class user 裡面可以用gid