Setting postgresql password with Vagrant/Chef-solo

2019-08-01 03: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条回答
戒情不戒烟
2楼-- · 2019-08-01 04:04

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.

查看更多
登录 后发表回答