From 057420e9ceabf61d71642ab7d78a8e54d1d74ba3 Mon Sep 17 00:00:00 2001 From: varac Date: Sat, 9 Mar 2013 11:57:26 +0100 Subject: use site_couchdb::bigcouch --- puppet/manifests/site.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'puppet') diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 8cfa92ef..193a93e1 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -21,7 +21,7 @@ if 'openvpn' in $services { } if 'couchdb' in $services { - include site_couchdb + include site_couchdb::bigcouch } if 'webapp' in $services { -- cgit v1.2.3 From 82d894e5ac82752e88b193acd015e4544141eae1 Mon Sep 17 00:00:00 2001 From: varac Date: Sat, 9 Mar 2013 21:14:31 +0100 Subject: couchdb init file moved to couchdb module --- puppet/modules/site_couchdb/files/couchdb | 160 --------------------- puppet/modules/site_couchdb/manifests/configure.pp | 6 - 2 files changed, 166 deletions(-) delete mode 100755 puppet/modules/site_couchdb/files/couchdb (limited to 'puppet') diff --git a/puppet/modules/site_couchdb/files/couchdb b/puppet/modules/site_couchdb/files/couchdb deleted file mode 100755 index ccdfe716..00000000 --- a/puppet/modules/site_couchdb/files/couchdb +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/sh -e - -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -### BEGIN INIT INFO -# Provides: couchdb -# Required-Start: $local_fs $remote_fs -# Required-Stop: $local_fs $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Apache CouchDB init script -# Description: Apache CouchDB init script for the database server. -### END INIT INFO - -SCRIPT_OK=0 -SCRIPT_ERROR=1 - -DESCRIPTION="database server" -NAME=couchdb -SCRIPT_NAME=`basename $0` -COUCHDB=/usr/bin/couchdb -CONFIGURATION_FILE=/etc/default/couchdb -RUN_DIR=/var/run/couchdb -LSB_LIBRARY=/lib/lsb/init-functions - -if test ! -x $COUCHDB; then - exit $SCRIPT_ERROR -fi - -if test -r $CONFIGURATION_FILE; then - . $CONFIGURATION_FILE -fi - -log_daemon_msg () { - # Dummy function to be replaced by LSB library. - - echo $@ -} - -log_end_msg () { - # Dummy function to be replaced by LSB library. - - if test "$1" != "0"; then - echo "Error with $DESCRIPTION: $NAME" - fi - return $1 -} - -if test -r $LSB_LIBRARY; then - . $LSB_LIBRARY -fi - -run_command () { - command="$1" - if test -n "$COUCHDB_OPTIONS"; then - command="$command $COUCHDB_OPTIONS" - fi - if test -n "$COUCHDB_USER"; then - if su $COUCHDB_USER -c "$command"; then - return $SCRIPT_OK - else - return $SCRIPT_ERROR - fi - else - if $command; then - return $SCRIPT_OK - else - return $SCRIPT_ERROR - fi - fi -} - -start_couchdb () { - # Start Apache CouchDB as a background process. - - mkdir -p "$RUN_DIR" - chown -R "$COUCHDB_USER" "$RUN_DIR" - command="$COUCHDB -b" - if test -n "$COUCHDB_STDOUT_FILE"; then - command="$command -o $COUCHDB_STDOUT_FILE" - fi - if test -n "$COUCHDB_STDERR_FILE"; then - command="$command -e $COUCHDB_STDERR_FILE" - fi - if test -n "$COUCHDB_RESPAWN_TIMEOUT"; then - command="$command -r $COUCHDB_RESPAWN_TIMEOUT" - fi - run_command "$command" > /dev/null -} - -stop_couchdb () { - # Stop the running Apache CouchDB process. - - run_command "$COUCHDB -d" > /dev/null - pkill -u couchdb - # always return true even if no remaining couchdb procs got killed - /bin/true -} - -display_status () { - # Display the status of the running Apache CouchDB process. - - run_command "$COUCHDB -s" -} - -parse_script_option_list () { - # Parse arguments passed to the script and take appropriate action. - - case "$1" in - start) - log_daemon_msg "Starting $DESCRIPTION" $NAME - if start_couchdb; then - log_end_msg $SCRIPT_OK - else - log_end_msg $SCRIPT_ERROR - fi - ;; - stop) - log_daemon_msg "Stopping $DESCRIPTION" $NAME - if stop_couchdb; then - log_end_msg $SCRIPT_OK - else - log_end_msg $SCRIPT_ERROR - fi - ;; - restart|force-reload) - log_daemon_msg "Restarting $DESCRIPTION" $NAME - if stop_couchdb; then - if start_couchdb; then - log_end_msg $SCRIPT_OK - else - log_end_msg $SCRIPT_ERROR - fi - else - log_end_msg $SCRIPT_ERROR - fi - ;; - status) - display_status - ;; - *) - cat << EOF >&2 -Usage: $SCRIPT_NAME {start|stop|restart|force-reload|status} -EOF - exit $SCRIPT_ERROR - ;; - esac -} - -parse_script_option_list $@ diff --git a/puppet/modules/site_couchdb/manifests/configure.pp b/puppet/modules/site_couchdb/manifests/configure.pp index 333511b5..c921ad6a 100644 --- a/puppet/modules/site_couchdb/manifests/configure.pp +++ b/puppet/modules/site_couchdb/manifests/configure.pp @@ -1,11 +1,5 @@ class site_couchdb::configure { - file { '/etc/init.d/couchdb': - source => 'puppet:///modules/site_couchdb/couchdb', - mode => '0755', - owner => 'root', - group => 'root', - } file { '/etc/couchdb/local.d/admin.ini': content => "[admins] -- cgit v1.2.3 From 113b44d8ee21e4d9b7a678005f2536f2046ef1b2 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 15:47:31 +0100 Subject: use parameterized couchdb class instead of calling site_couchdb::bigcouch directly --- puppet/manifests/site.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'puppet') diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 193a93e1..f55e6925 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -21,7 +21,9 @@ if 'openvpn' in $services { } if 'couchdb' in $services { - include site_couchdb::bigcouch + class {'site_couchdb': + bigcouch => true + } } if 'webapp' in $services { -- cgit v1.2.3 From 0af4cb352017db95606f64f69b316d360bf2675d Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 15:50:43 +0100 Subject: increase timeout for initial_apt_update to 6 min --- puppet/modules/site_apt/manifests/dist_upgrade.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'puppet') diff --git a/puppet/modules/site_apt/manifests/dist_upgrade.pp b/puppet/modules/site_apt/manifests/dist_upgrade.pp index 91301efd..08de31bb 100644 --- a/puppet/modules/site_apt/manifests/dist_upgrade.pp +++ b/puppet/modules/site_apt/manifests/dist_upgrade.pp @@ -6,6 +6,7 @@ class site_apt::dist_upgrade { exec{'initial_apt_update': command => '/usr/bin/apt-get update', refreshonly => false, + timeout => 360, } exec{'initial_apt_dist_upgrade': command => "/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade", -- cgit v1.2.3 From 0ae8194ef3a3f8065ff455b4daddc0d62c105ace Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 15:55:35 +0100 Subject: futon is enabled by default on bigcouch in default.ini we need to find another way to disable futon, it won't work disabling it here --- puppet/modules/site_couchdb/files/local.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'puppet') diff --git a/puppet/modules/site_couchdb/files/local.ini b/puppet/modules/site_couchdb/files/local.ini index b3376cbb..22aa0177 100644 --- a/puppet/modules/site_couchdb/files/local.ini +++ b/puppet/modules/site_couchdb/files/local.ini @@ -28,8 +28,10 @@ [httpd_global_handlers] ;_google = {couch_httpd_proxy, handle_proxy_req, <<"http://www.google.com">>} +# futon is enabled by default on bigcouch in default.ini +# we need to find another way to disable futon, it won't work disabling it here # enable futon -_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "/usr/share/couchdb/www"} +#_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "/usr/share/couchdb/www"} # disable futon #_utils = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome, Futon is disabled!">>} -- cgit v1.2.3 From 46f1b83431cff1c30e7cda9bc99505d35f37f309 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 16:10:39 +0100 Subject: site_couchdb::configure moved to couchdb --- puppet/modules/site_couchdb/manifests/configure.pp | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 puppet/modules/site_couchdb/manifests/configure.pp (limited to 'puppet') diff --git a/puppet/modules/site_couchdb/manifests/configure.pp b/puppet/modules/site_couchdb/manifests/configure.pp deleted file mode 100644 index c921ad6a..00000000 --- a/puppet/modules/site_couchdb/manifests/configure.pp +++ /dev/null @@ -1,21 +0,0 @@ -class site_couchdb::configure { - - - file { '/etc/couchdb/local.d/admin.ini': - content => "[admins] -admin = $site_couchdb::couchdb_admin_pw -", - mode => '0600', - owner => 'couchdb', - group => 'couchdb', - notify => Service[couchdb] - } - - - exec { '/etc/init.d/couchdb restart; sleep 6': - path => ['/bin', '/usr/bin',], - subscribe => File['/etc/couchdb/local.d/admin.ini', - '/etc/couchdb/local.ini'], - refreshonly => true - } -} -- cgit v1.2.3 From 0f5e0b0e5102deab700d25ca4fd4845f15db8529 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 16:13:03 +0100 Subject: use bigcouch in site_couchdb --- puppet/modules/site_couchdb/manifests/init.pp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'puppet') diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp index 9ecde5e6..35470b5d 100644 --- a/puppet/modules/site_couchdb/manifests/init.pp +++ b/puppet/modules/site_couchdb/manifests/init.pp @@ -1,6 +1,5 @@ -class site_couchdb { +class site_couchdb ( $bigcouch = false ) { tag 'leap_service' - include couchdb $x509 = hiera('x509') $key = $x509['key'] @@ -17,20 +16,18 @@ class site_couchdb { $couchdb_ca_daemon_user = $couchdb_ca_daemon['username'] $couchdb_ca_daemon_pw = $couchdb_ca_daemon['password'] - Package ['couchdb'] - -> File['/etc/init.d/couchdb'] - -> File['/etc/couchdb/local.ini'] - -> File['/etc/couchdb/local.d/admin.ini'] - -> File['/etc/couchdb/couchdb.netrc'] + class {'couchdb': + bigcouch => $bigcouch, + admin_pw => $couchdb_admin_pw + } + + Service ['couchdb'] -> Couchdb::Create_db['users'] -> Couchdb::Create_db['client_certificates'] -> Couchdb::Add_user[$couchdb_webapp_user] -> Couchdb::Add_user[$couchdb_ca_daemon_user] -> Site_couchdb::Apache_ssl_proxy['apache_ssl_proxy'] - include site_couchdb::configure - include couchdb::deploy_config - site_couchdb::apache_ssl_proxy { 'apache_ssl_proxy': key => $key, cert => $cert -- cgit v1.2.3 From daef6834ad05d8516afc784b5e0cb42ecb84db92 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 16:14:02 +0100 Subject: automatic update of submodule stdlib --- puppet/modules/stdlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'puppet') diff --git a/puppet/modules/stdlib b/puppet/modules/stdlib index 2df66c04..095a5a01 160000 --- a/puppet/modules/stdlib +++ b/puppet/modules/stdlib @@ -1 +1 @@ -Subproject commit 2df66c041109ecca1099bf3977657572cc32ad24 +Subproject commit 095a5a01d5a7c7e3d95a71846220545080f7581c -- cgit v1.2.3 From 73b1d0d7e8f359ff48eab1918282eb8cd2f9afb0 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 16:14:32 +0100 Subject: automatic update of submodule apache --- puppet/modules/apache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'puppet') diff --git a/puppet/modules/apache b/puppet/modules/apache index 077d4d15..dafb060f 160000 --- a/puppet/modules/apache +++ b/puppet/modules/apache @@ -1 +1 @@ -Subproject commit 077d4d1508b9ff3355f73ff8597991043b3ba5d9 +Subproject commit dafb060fc57957dbe9e5e90698537e781cebeaf6 -- cgit v1.2.3 From 01941d905a71a2088ec080703f4e5430dec7a2ec Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 10 Mar 2013 17:29:12 +0100 Subject: pass couchdb cookie to class couchdb --- puppet/modules/site_couchdb/manifests/init.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'puppet') diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp index 35470b5d..419e4122 100644 --- a/puppet/modules/site_couchdb/manifests/init.pp +++ b/puppet/modules/site_couchdb/manifests/init.pp @@ -15,10 +15,13 @@ class site_couchdb ( $bigcouch = false ) { $couchdb_ca_daemon = $couchdb_users['ca_daemon'] $couchdb_ca_daemon_user = $couchdb_ca_daemon['username'] $couchdb_ca_daemon_pw = $couchdb_ca_daemon['password'] + $bigcouch_config = $couchdb_config['bigcouch'] + $bigcouch_cookie = $bigcouch_config['cookie'] class {'couchdb': - bigcouch => $bigcouch, - admin_pw => $couchdb_admin_pw + bigcouch => $bigcouch, + admin_pw => $couchdb_admin_pw, + bigcouch_cookie => $bigcouch_cookie } Service ['couchdb'] -- cgit v1.2.3