Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Nathan Souza
@nathanpsouza
hey guys
i wanto to setup a postgresql server with replication through chef
Phil Cohen
@phlipper
hello @nathanpsouza, you should be able to use this cookbook to set that up
let me know if you have any specific questions
Ivo von Putzer Reibegg
@ivoputzer
hi, just wanted to ask if its possibile to fetch this cookbook directly from chef's supermarket through metadata.rb.. thanks in advance ;)
Phil Cohen
@phlipper
@ivoputzer this cookbook is not available through the supermarket at the moment, sorry. there is already another postgresql cookbook and i didn't want to rename/namespace everything. you can use Berkshelf or Librarian or similar to include the dependency from the git repo.
kenny-evitt
@kenny-evitt
I had a trouble trying to get PostgreSQL installed with the 'official' cookbook on some Ubuntu boxes a while ago so I've been using this cookbook instead – it works great. I'm setting up a Mac OS X box now and I realized this cookbook only supports Ubuntu; and neither do any others on the Supermarket. Any interest in helping me add support for Mac OS X?
Mike
@mverderese

How do I grant privileges to a user using chef-postgresql? ie:

 Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 mort      | mort     | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres

normally i'd run this command

GRANT ALL PRIVILEGES ON DATABASE :dbname TO :user;

but I figure there's gotta be some attribute I can set to do that. right now I have

{
    "postgresql": {
        "users": [{
            "username": "mort",
            "password": "mort",
            "superuser": true,
            "replication": false,
            "createdb": false,
            "createrole": true,
            "inherit": true,
            "replication": false,
            "login": true
        }],
        "databases": [{
            "name": "mort",
            "owner": "mort",
            "template": "template0",
            "encoding": "UTF-8",
            "locale": "en_US.UTF-8",
            "postgis": true
        }],
        "listen_addresses": "*"
    }
}

thanks!

kenny-evitt
@kenny-evitt
@mverderese Your user is already a superuser so they shouldn't need any additional privileges or permissions. Or is that what you want to change? I don't think this cookbook covers privileges for specific databases.
Mike
@mverderese
@kenny-evitt Yeah exactly. I wanna avoid making the user a super user. I figured that wasn't covered in this cookbook from what I was seeing in the source code and docs