[GitHub] jiangpengcheng commented on a change in pull request #3853: Set erlang magic cookie for couchdb

2018-07-11 Thread GitBox
jiangpengcheng commented on a change in pull request #3853: Set erlang magic 
cookie for couchdb
URL: 
https://github.com/apache/incubator-openwhisk/pull/3853#discussion_r201897842
 
 

 ##
 File path: ansible/roles/couchdb/tasks/deploy.yml
 ##
 @@ -23,6 +23,35 @@
 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)
 
+- name: "generate erlang cookie"
+  local_action: command openssl rand -base64 32op
+  register: random_stdout
+  run_once: true
+  when: erlang_cookie is not defined
+
+- set_fact:
+erlang_cookie: "{{ random_stdout.stdout }}"
+  when: erlang_cookie is not defined
+
+- name: "ensure config root dir exists"
+  file:
+path: "{{ config_root_dir }}"
+state: directory
+
+# when enable uid namespace mode, couchdb container doesn't have permission to 
change the owner of files which mounted
+# from host, so the container will be failed to start. Use a temporary 
container here to create the file erlang.cookie
+# with the correct user 'couchdb' as its owner
+- name: "create the erlang cookie file on remote"
+  vars:
+couchdb_image: "{{ couchdb.docker_image | default('apache/couchdb:' ~ 
couchdb.version ) }}"
+  command: "docker run --rm -v /tmp:/tmp -u couchdb {{ couchdb_image }} sh -c 
'echo {{ erlang_cookie }} >> /tmp/erlang.cookie'"
 
 Review comment:
   updated


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiangpengcheng commented on a change in pull request #3853: Set erlang magic cookie for couchdb

2018-07-09 Thread GitBox
jiangpengcheng commented on a change in pull request #3853: Set erlang magic 
cookie for couchdb
URL: 
https://github.com/apache/incubator-openwhisk/pull/3853#discussion_r201202487
 
 

 ##
 File path: ansible/roles/couchdb/tasks/deploy.yml
 ##
 @@ -23,6 +23,22 @@
 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)
 
+- name: "generate erlang cookie"
 
 Review comment:
   ~don't need to~
   when extend the couchdb cluster, we still need to set the cookie, so it's 
better to generate the cookie even there is only one node


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiangpengcheng commented on a change in pull request #3853: Set erlang magic cookie for couchdb

2018-07-09 Thread GitBox
jiangpengcheng commented on a change in pull request #3853: Set erlang magic 
cookie for couchdb
URL: 
https://github.com/apache/incubator-openwhisk/pull/3853#discussion_r201202487
 
 

 ##
 File path: ansible/roles/couchdb/tasks/deploy.yml
 ##
 @@ -23,6 +23,22 @@
 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)
 
+- name: "generate erlang cookie"
 
 Review comment:
   don't need to


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jiangpengcheng commented on a change in pull request #3853: Set erlang magic cookie for couchdb

2018-07-09 Thread GitBox
jiangpengcheng commented on a change in pull request #3853: Set erlang magic 
cookie for couchdb
URL: 
https://github.com/apache/incubator-openwhisk/pull/3853#discussion_r200919571
 
 

 ##
 File path: ansible/roles/couchdb/tasks/deploy.yml
 ##
 @@ -23,6 +23,22 @@
 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)
 
+- name: "generate erlang cookie"
+  local_action: command openssl rand -base64 32op
+  register: erlang_cookie
+  run_once: true
+
+- name: ensuer config root dir exists
 
 Review comment:
   thanks, corrected


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:
us...@infra.apache.org


With regards,
Apache Git Services