diff --git a/manifests/config.pp b/manifests/config.pp index bdd69d4..b392e8c 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -31,4 +31,13 @@ ensure => file, content => template('couchdb/local.ini.erb'), } + + # If uuid is missing from the config (as in the above local.ini template), + # couchdb will write the uuid in the last-read config file upon (re)start. + # Usually, that means puppet is going to replace the local.ini again because + # it changed. Therefore we provide this special workaround config file. + file { "${couchdb::couchdb_conf_dir}/local.d/zzz-uuid.ini": + replace => no, + content => '[couchdb]', + } } diff --git a/manifests/init.pp b/manifests/init.pp index 3ec31f1..5ffaa1a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -18,6 +18,8 @@ # # [*log_level_local*] - info # +# [*manage_epel_repo*] - true ; set to false if you are managing Yumrepo['epel'] elsewhere +# # [*max_attachment_chunk_size*] - 4294967296 ;4GB # # [*max_connections*] - 2048 @@ -28,6 +30,8 @@ # # [*os_process_timeout*] - 5000 ; 5 seconds. for view and external servers. # +# [*package_ensure*] - present ; control couchdb package version +# # [*port*] - 5984 # # [*require_valid_user*] - If you set this to true, you should also uncomment the WWW-Authenticate @@ -45,7 +49,7 @@ # # # === Requires: -# metcalfc-rpmrepos - https://github.com/metcalfc/puppet-rpmrepos +# metcalfc-rpmrepos - https://github.com/metcalfc/puppet-rpmrepos ; unless $manage_epel_repo is false # # Packaged couchdb # - RHEL/CentOS: EPEL @@ -88,11 +92,13 @@ $log_file = '/var/log/couchdb/couch.log', $log_level = 'info', $log_max_chunk_size = '1000000', + $manage_epel_repo = true, $max_attachment_chunk_size = '4294967296 ;4GB', $max_connections = '2048', $max_dbs_open = '100', $max_document_size = '4294967296', $os_process_timeout = '5000 ; 5 seconds. for view and external servers.', + $package_ensure = 'present', $port = '5984', $reduce_limit = true, $require_valid_user = false, @@ -106,7 +112,10 @@ ) { include couchdb::params - include rpmrepos::epel + + if $manage_epel_repo == true { + include rpmrepos::epel + } class { 'couchdb::package': notify => Class['couchdb::service'], diff --git a/manifests/package.pp b/manifests/package.pp index 7e852b8..5d7b5f8 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -2,7 +2,12 @@ class couchdb::package { package { 'couchdb': - ensure => installed, - require => Yumrepo['epel'], + ensure => $::couchdb::package_ensure, + } + + if $::couchdb::manage_epel_repo { + Package['couchdb'] { + require +> Yumrepo['epel'], + } } }