简体   繁体   中英

Setting postgresql password with Vagrant/Chef-solo

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM