Simple Chef cookbook that wraps database cookbook to simplify create actions. Instead of writing custom wrapper cookbook for database actions, this cookbook takes configuration instead and its recipe uses database providers
Supported databases:
Supported actions:
- create user
- create database
Chef version 0.11+
- Debian, Ubuntu
- Red Hat, CentOS, Scientific, Fedora, Amazon
The following Opscode cookbooks are dependencies:
- postgresql
- database
node['postgresql']['connection_info']- (Hash) postgresql connection information: host, port, username, passwordnode['postgresql']['users']- (Array) Array of hashes containing new user: username, passwordnode['postgresql']['databases']- (Array) Array of hashes containing new database options: name, encoding, template, tablespace, collation, connection_limit, owner
Include yo-db::postgresql as a recipe and provide json configuration
{
...
'postgresql' => {
...
'connection_info' => {
'host' => 'localhost',
'port' => '5432',
'username' => 'postgres',
'password' => 'postgres'
},
'users' => [
{
'username' => 'dbuser'
'password' => 'supersecret'
}
],
'databases' => [
{
'name' => "#{APPLICATION_NAME}_development",
'owner' => 'dbuser',
'encoding' => 'utf8',
'template' => 'template1'
'tablespace' => 'DEFAULT'
'collation' => 'DEFAULT'
'connection_limit' => '-1'
}
]
}
}- Add support for different databases
- Add support for more actions
- Fork the repository
- Submit a Pull Request
- Author:: Bob Yao (bobbyyao@gmail.com)