我在 ubuntu 12.04 的 vagrant 中测试了厨师。我使用默认的 vagrant 帐户vagrant
运行knife solo bootstrap vagrant@192.168.33.10
,每次它显示以下错误:
================================================================================
Error executing action `create` on resource 'user_account[deploy]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
user[deploy] (/home/vagrant/chef-solo/cookbooks-2/user/providers/account.rb line 94) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '6'
---- Begin output of ["useradd", "-c", "deployer", "-g", "deploy", "-s", "/bin/bash", "-u", "9001", "-d", "/home/deploy", "-m", "deploy"] ----
STDOUT:
STDERR: useradd: group 'deploy' does not exist
---- End output of ["useradd", "-c", "deployer", "-g", "deploy", "-s", "/bin/bash", "-u", "9001", "-d", "/home/deploy", "-m", "deploy"] ----
Ran ["useradd", "-c", "deployer", "-g", "deploy", "-s", "/bin/bash", "-u", "9001", "-d", "/home/deploy", "-m", "deploy"] returned 6
这让我非常失望。希望可以有人帮帮我。
这是我的节点配置文件(/nodes/vagrant.json):
{
"appbox": {
"admin_keys":[ "ssh-rsa blabla" ],
"deploy_keys":[ "ssh-rsa blabla" ]
},
"databox": {
"db_root_password": "welcome!",
"databases": {
"mysql": [
{
"username": "get_real",
"password": "get_real",
"database_name": "get_real"
}
]
}
},
"github_deploys": {
"deploy_user": "deploy",
"github_api": {
"username": "xxx",
"email": "xxx@163.com",
"password": "blabla"
}
},
"rackbox": {
"ruby": {
"versions": ["2.0.0-p247"],
"global_version": "2.0.0-p247"
}
},
"run_list":[
"databox::mysql",
"nodejs",
"rackbox",
"github-deploys"
]
}