Setting postgresql password with Vagrant/Chef-solo

这一生的挚爱 提交于 2019-12-13 18:56:18

问题


I'm trying my hand at a bit of chef-solo for the first time on a Vagrant box for my open source project apartment so that contributors can more easily get a dev env up and running.

One thing I'm as of yet unable to achieve though is override the default password set by the postgresql recipe from this cookbook

The docs mention setting the json config with something like:

postgresql: {
  password: {
    postgres: ''
  }
}

which I've done here but I can't seem to get it to override the default encrypted password that's set by the recipe.

I'm brand new (as of today) to chef/vagrant so I'm a bit lost as to where I should even look next.

Any help is greatly appreciated.


回答1:


I cloned your gem and fired up Vagrant (but using a Debian Squeeze image I already downloaded and with all recipes disabled except postgresql and postgresql::server, and using PostgreSQL 8.4 instead of 9.1) and it seems that the empty password was a bad choice, using

  postgresql: {
    password: {
      postgres: 'foo'
    }
  }

works with the command PGPASSWORD="foo" psql --username=postgres -h localhost so I suspect that the empty password has some problems.



来源:https://stackoverflow.com/questions/15324385/setting-postgresql-password-with-vagrant-chef-solo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!