brad
brad

Reputation: 32345

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.

Upvotes: 1

Views: 3182

Answers (1)

cmur2
cmur2

Reputation: 2624

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.

Upvotes: 5

Related Questions