[英]FATAL: You must set node['postgresql']['password']['postgres'] in chef-solo mode when using posgtresql cookbook
So I included the cookbook 'postgresql', {}
in my Cheffile. 因此,我在Cheffile中加入了
cookbook 'postgresql', {}
。 Now I have the box downloaded and installed with Vagrant, but when I run vagrant provision
, it gives me the error: 现在,我已经下载了该盒并随Vagrant一起安装,但是当我运行
vagrant provision
,出现了以下错误:
FATAL: You must set node['postgresql']['password']['postgres'] in chef-solo mode
I saw somewhere that I should add this line: 我看到应该添加以下行:
default['postgresql']['password']['postgres'] = "myPassword"
in my default.rb
file which is in the postgresql
cookbook. 在
postgresql
食谱中的default.rb
文件中。 But if I add this and do vagrant provision
again, the line gets deleted and I run into the same error again. 但是,如果我添加此代码并再次执行
vagrant provision
,则该行将被删除,并且我再次遇到相同的错误。
What is the problem here? 这里有什么问题?
You can set node data in Vagrantfile using chef.json
. 您可以使用
chef.json
在Vagrantfile中设置节点数据。 For example: 例如:
Vagrant.configure("2") do |config|
# ...
config.vm.provision "chef_solo" do |chef|
# ...
chef.json = {
postgresql: {
password: {
postgres: "myPassword"
}
}
}
end
end
See the Vagrant docs for more information. 有关更多信息,请参见Vagrant文档 。
I fixed the problem. 我解决了这个问题。 I had two
chef.json
defined in my Vagrantfile. 我在
chef.json
定义了两个Chef.json。 Stacking everything under one fixed the problem. 将所有内容堆叠在一起可以解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.