Page MenuHomeDevCentral

D1736.diff
No OneTemporary

D1736.diff

diff --git a/pillar/paas/docker.sls b/pillar/paas/docker.sls
--- a/pillar/paas/docker.sls
+++ b/pillar/paas/docker.sls
@@ -149,6 +149,7 @@
aliases:
- pad.wolfplex.org
- pad.wolfplex.be
+ credential: 125
mysql_link: acquisitariat
# phpBB SaaS
diff --git a/roles/paas-docker/containers/etherpad.sls b/roles/paas-docker/containers/etherpad.sls
--- a/roles/paas-docker/containers/etherpad.sls
+++ b/roles/paas-docker/containers/etherpad.sls
@@ -46,12 +46,24 @@
- port_bindings:
- {{ container['app_port'] }}:9001
-pad_deploy_api:
+# -------------------------------------------------------------
+# API key
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% set api_key_path = "/srv/" + instance + "/APIKEY.txt" %}
+
+{{ api_key_path }}:
+ file.managed:
+ - mode: 400
+ - contents: {{ salt['zr.get_password'](container['credential']) }}
+
+deploy_api_key_{{ instance }}:
cmd.run:
- - creates: /srv/{{ instance }}/.ok-apikey
- name: |
- docker cp /srv/{{ instance }}/var/APIKEY.txt {{ instance }}:opt/etherpad-lite/APIKEY.txt
+ docker cp {{ api_key_path }} {{ instance }}:opt/etherpad-lite/APIKEY.txt
docker restart {{ instance }}
- touch /srv/{{ instance }}/.ok-apikey
+ - onchanges:
+ - docker_container: {{ instance }}
+ - file: {{ api_key_path }}
{% endfor %}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 19:56 (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2263119
Default Alt Text
D1736.diff (1 KB)

Event Timeline