You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/11/13 05:13:55 UTC

[GitHub] kpavel closed pull request #4108: Making Redis password protected

kpavel closed pull request #4108: Making Redis password protected
URL: https://github.com/apache/incubator-openwhisk/pull/4108
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index 0329c098d9..e9eccf6be5 100755
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -263,6 +263,7 @@ apigateway:
 redis:
   version: 4.0
   port: 6379
+  password: openwhisk 
 
 linux:
   version: 4.4.0-31
diff --git a/ansible/roles/apigateway/tasks/deploy.yml b/ansible/roles/apigateway/tasks/deploy.yml
index 67af893d85..5a1c169abf 100644
--- a/ansible/roles/apigateway/tasks/deploy.yml
+++ b/ansible/roles/apigateway/tasks/deploy.yml
@@ -14,6 +14,7 @@
     env:
       "REDIS_HOST": "{{ groups['redis'] | first }}"
       "REDIS_PORT": "{{ redis.port }}"
+      "REDIS_PASS": "{{ redis.password }}"
       "PUBLIC_MANAGEDURL_HOST": "{{ ansible_host }}"
       "PUBLIC_MANAGEDURL_PORT": "{{ apigateway.port.mgmt }}"
       "TZ": "{{ docker.timezone }}"
diff --git a/ansible/roles/redis/tasks/deploy.yml b/ansible/roles/redis/tasks/deploy.yml
index 9110f43758..246db670c9 100644
--- a/ansible/roles/redis/tasks/deploy.yml
+++ b/ansible/roles/redis/tasks/deploy.yml
@@ -21,10 +21,13 @@
       - "{{ redis.port }}:6379"
     env:
       TZ: "{{ docker.timezone }}"
+    command:
+      /bin/sh -c
+      "docker-entrypoint.sh --requirepass {{ redis.password }}"
 
 - name: wait until redis is up and running
-  action: shell (echo PING; sleep 1) | nc {{ ansible_host }} {{ redis.port }}
+  action: shell (printf "*2\r\n\$4\r\nAUTH\r\n\${{redis.password|length}}\r\n{{ redis.password }}\r\n*1\r\n\$4\r\nPING\r\n"; sleep 1) | nc {{ ansible_host }} {{ redis.port }}
   register: result
-  until: (result.rc == 0) and (result.stdout == '+PONG')
+  until: (result.rc == 0) and (result.stdout == '+OK\r\n+PONG')
   retries: 12
   delay: 5


 

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


With regards,
Apache Git Services