diff options
author | elijah <elijah@riseup.net> | 2015-04-08 13:59:18 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-04-08 13:59:18 -0700 |
commit | 35df265409732086402dfa172356448d1a5d315b (patch) | |
tree | b93afc9a9003bef439a4a733ee426e4a056bf32e /puppet/modules/site_couchdb/manifests/upload_design.pp | |
parent | 7bb8b2e0685b3738c7842e86c09b826c2732e8bd (diff) | |
parent | e3cfc2e1e7055ce2640fcce5bf810d6bd7930d2f (diff) |
Merge branch 'bugfix/rotatedb' into develop
Diffstat (limited to 'puppet/modules/site_couchdb/manifests/upload_design.pp')
-rw-r--r-- | puppet/modules/site_couchdb/manifests/upload_design.pp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/puppet/modules/site_couchdb/manifests/upload_design.pp b/puppet/modules/site_couchdb/manifests/upload_design.pp new file mode 100644 index 00000000..7b0cabd7 --- /dev/null +++ b/puppet/modules/site_couchdb/manifests/upload_design.pp @@ -0,0 +1,13 @@ +define site_couchdb::upload_design($db = $title, $design) { + $design_name = regsubst($design, '^.*\/(.*)\.json$', '\1') + $id = "_design/${design_name}" + $file = "/srv/leap/couchdb/designs/${design}" + exec { + "upload_design_${name}": + command => "/usr/local/bin/couch-doc-update --host 127.0.0.1:5984 --db '${db}' --id '${id}' --data '{}' --file '${file}'", + refreshonly => false, + loglevel => debug, + logoutput => on_failure, + require => File['/srv/leap/couchdb/designs']; + } +} |