diff options
author | Micah Anderson <micah@riseup.net> | 2013-08-13 17:22:13 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-08-13 17:22:13 -0400 |
commit | f317163e8aa6abfc992df5ef65d99b0861488d41 (patch) | |
tree | 732bb93dceefee562a868b52781a675cc1f061ad | |
parent | 20deb0652ccfe105eddec6ba2ad32b8d633705f6 (diff) |
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.
-rw-r--r-- | manifests/bigcouch.pp | 13 |
1 files 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 |