summaryrefslogtreecommitdiff
path: root/puppet/modules
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2014-06-23 22:04:59 +0200
committerelijah <elijah@riseup.net>2014-06-25 18:17:39 -0700
commit7778b20479d4d6789948dc24904ef9302980d983 (patch)
tree82e262e6a90035d6edb1cb3aad4fdb4389fb5b19 /puppet/modules
parent813f840cceb284c38dcedea1577d125e62e280f0 (diff)
create netrc files for all users with new puppet_couchdb
This only works with the latest patch to puppet_couchdb
Diffstat (limited to 'puppet/modules')
-rw-r--r--puppet/modules/site_couchdb/manifests/mirror.pp2
-rw-r--r--puppet/modules/site_couchdb/manifests/setup.pp11
2 files changed, 9 insertions, 4 deletions
diff --git a/puppet/modules/site_couchdb/manifests/mirror.pp b/puppet/modules/site_couchdb/manifests/mirror.pp
index 2a44b1e9..abe35c4c 100644
--- a/puppet/modules/site_couchdb/manifests/mirror.pp
+++ b/puppet/modules/site_couchdb/manifests/mirror.pp
@@ -9,8 +9,6 @@ class site_couchdb::mirror {
chttpd_bind_address => '127.0.0.1'
}
- # Couchdb databases
-
$masters = $site_couchdb::couchdb_config['replication']['masters']
$master_node_names = keys($site_couchdb::couchdb_config['replication']['masters'])
$master_node = $masters[$master_node_names[0]]
diff --git a/puppet/modules/site_couchdb/manifests/setup.pp b/puppet/modules/site_couchdb/manifests/setup.pp
index e398356b..69bd1c6a 100644
--- a/puppet/modules/site_couchdb/manifests/setup.pp
+++ b/puppet/modules/site_couchdb/manifests/setup.pp
@@ -10,11 +10,18 @@ class site_couchdb::setup {
ensure => absent
}
- # /etc/couchdb/couchdb.netrc is deployed by couchdb::query::setup
+ $user = $site_couchdb::couchdb_admin_user
+
+ # /etc/couchdb/couchdb-admin.netrc is deployed by couchdb::query::setup
+ # we symlink to couchdb.netrc for puppet commands.
# 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)
file {
+ '/etc/couchdb/couchdb.netrc':
+ ensure => link,
+ target => "/etc/couchdb/couchdb-${user}.netrc";
+
'/root/.netrc':
ensure => link,
target => '/etc/couchdb/couchdb.netrc';
@@ -24,7 +31,7 @@ class site_couchdb::setup {
}
couchdb::query::setup { 'localhost':
- user => $site_couchdb::couchdb_admin_user,
+ user => $user,
pw => $site_couchdb::couchdb_admin_pw,
}