diff options
author | Micah Anderson <micah@leap.se> | 2013-11-26 16:25:14 -0500 |
---|---|---|
committer | Micah Anderson <micah@leap.se> | 2013-11-27 14:48:00 -0500 |
commit | 92d68c912d0de44ec9e88f7327303cc0fce7114b (patch) | |
tree | e02c6955aa63bcaab9345dd4f73e7e8295dd3809 /puppet/modules/site_couchdb/manifests/init.pp | |
parent | dc6c48cbc25216417a02304ec2c23663688cd99d (diff) |
break out the database creation, user creation and design document loading into different classes
Change-Id: Idd126d69e1fbe9c9794ad50337307dcc5dd635f4
Diffstat (limited to 'puppet/modules/site_couchdb/manifests/init.pp')
-rw-r--r-- | puppet/modules/site_couchdb/manifests/init.pp | 56 |
1 files changed, 8 insertions, 48 deletions
diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp index dcf7f48a..0f839997 100644 --- a/puppet/modules/site_couchdb/manifests/init.pp +++ b/puppet/modules/site_couchdb/manifests/init.pp @@ -52,69 +52,29 @@ class site_couchdb { # we symlink this to /root/.netrc for couchdb_scripts (eg. backup) # and makes life easier for the admin (i.e. using curl/wget without # passing credentials) - couchdb::query::setup { 'localhost': - user => $couchdb_admin_user, - pw => $couchdb_admin_pw, - } - file { '/root/.netrc': ensure => link, target => '/etc/couchdb/couchdb.netrc', require => Couchdb::Query::Setup['localhost'] } - # Populate couchdb - couchdb::add_user { $couchdb_webapp_user: - roles => '["auth"]', - pw => $couchdb_webapp_pw, - salt => $couchdb_webapp_salt, - require => Couchdb::Query::Setup['localhost'] - } - - couchdb::add_user { $couchdb_soledad_user: - roles => '["auth"]', - pw => $couchdb_soledad_pw, - salt => $couchdb_soledad_salt, - require => Couchdb::Query::Setup['localhost'] - } - - couchdb::create_db { 'users': - members => "{ \"names\": [\"$couchdb_webapp_user\"], \"roles\": [] }", - require => Couchdb::Query::Setup['localhost'] - } - - couchdb::create_db { 'tokens': - members => "{ \"names\": [], \"roles\": [\"auth\"] }", - require => Couchdb::Query::Setup['localhost'] - } - - couchdb::create_db { 'sessions': - members => "{ \"names\": [\"$couchdb_webapp_user\"], \"roles\": [] }", - require => Couchdb::Query::Setup['localhost'] - } - - couchdb::create_db { 'tickets': - members => "{ \"names\": [\"$couchdb_webapp_user\"], \"roles\": [] }", - require => Couchdb::Query::Setup['localhost'] + file { '/srv/leap/couchdb': + ensure => directory } - # leap_mx will want access to this. Granting access to the soledad user - # via the auth group for now. - # leap_mx could use that for a start. - couchdb::create_db { 'identities': - members => "{ \"names\": [], \"roles\": [\"auth\"] }", - require => Couchdb::Query::Setup['localhost'] + couchdb::query::setup { 'localhost': + user => $couchdb_admin_user, + pw => $couchdb_admin_pw, } + include site_couchdb::create_dbs + include site_couchdb::add_users + include site_couchdb::designs include site_couchdb::logrotate include site_shorewall::couchdb include site_shorewall::couchdb::bigcouch - file { '/srv/leap/couchdb': - ensure => directory - } - vcsrepo { '/srv/leap/couchdb/scripts': ensure => present, provider => git, |