From f317163e8aa6abfc992df5ef65d99b0861488d41 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 13 Aug 2013 17:22:13 -0400 Subject: due to the fact that other packages (such as python-couchdb) create and manage /etc/couchdb, having a file resource that creates a symlink out of /etc/couchdb doesn't work, for example you can get this error: err: /Stage[main]/Couchdb::Bigcouch/File[/etc/couchdb]/ensure: change from directory to link failed: Could not remove existing file (Bug #3447) This commit resolves this by instead managing /opt/bigcouch (as this is where the bigcouch package is installed) and creating a symlink *from* /opt/bigcouch/etc -> /etc/couchdb before the bigcouch package is installed. This way, when the package is installed, the files will be placed in the /etc/couchdb directory and other packages that would create/manage /etc/couchdb would not get confused. --- manifests/bigcouch.pp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/manifests/bigcouch.pp b/manifests/bigcouch.pp index 9beea75..c56890b 100644 --- a/manifests/bigcouch.pp +++ b/manifests/bigcouch.pp @@ -1,9 +1,14 @@ class couchdb::bigcouch inherits couchdb::base { - file { '/etc/couchdb': - ensure => link, - target => '/opt/bigcouch/etc', - require => Package['couchdb'] + file { + '/opt/bigcouch': + ensure => directory, + mode => '0755'; + + '/opt/bigcouch/etc': + ensure => link, + target => '/etc/couchdb', + before => Package['couchdb']; } # there's no bigcouch in the official debian repo, you need -- cgit v1.2.3