rabbah commented on a change in pull request #3106: Couchdb persistency
URL: 
https://github.com/apache/incubator-openwhisk/pull/3106#discussion_r160171998
 
 

 ##########
 File path: ansible/roles/couchdb/tasks/deploy.yml
 ##########
 @@ -9,17 +9,23 @@
   fail: msg="The db provider in your {{ inventory_dir }}/group_vars/all is {{ 
db_provider }}, it has to be CouchDB, pls double check"
   when: db_provider != "CouchDB"
 
-- name: check for persistent disk
-  shell: df -h
-  register: disk_status
-  when: block_device is defined
-
 - name: "set the volume_dir"
-  vars:
-    instance: "{{instances | selectattr('name', 'equalto', 'db') | list | 
first}}"
   set_fact:
-    volume_dir: "{{ instance.volume.fsmount | default( '/mnt/' + 
group_names|first, true ) }}:/usr/local/var/lib/couchdb"
-  when: (block_device is defined) and (block_device in disk_status.stdout)
+    volume_dir: "{% if db_datadir is defined and db_confdir is defined  %}[ 
'{{ db_confdir }}:/opt/couchdb/etc', '{{ db_datadir }}:/opt/couchdb/data' ]{% 
elif db_datadir is undefined  %}{{ db_confdir }}:/opt/couchdb/etca{% else %}{{ 
db_datadir }}:/opt/couchdb/data{%- endif %}"
+  when: db_datadir is defined or db_confdir is defined
+
+- name: ensure CouchDB config directory exists
+  file:
+    path: "{{ db_confdir }}"
+    state: directory
+  become: "{{ db.dir.become }}"
+  when: db_confdir is defined
+
+- name: copy default configuration files from local to remote in CouchDB 
config directory
+  copy:
+    src: "files/"
+    dest: "{{ db_confdir }}"
+  when: db_confdir is defined
 
 Review comment:
   if this is predicated on the existence of the files, should we bother 
checking in template files at all if they're coming from couchdb templates as 
is?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to