Add support for docker

Change-Id: I699cf694fe360a86d809d0c3a3d6435660d0509b
This commit is contained in:
marco 2016-06-22 23:39:43 +02:00
parent 932d365728
commit f2f318b4a3
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,24 @@
{%- from "horizon/map.jinja" import server with context -%}
#!/bin/bash -e
cat /srv/salt/pillar/horizon-server.sls | envsubst > /tmp/horizon-server.sls
mv /tmp/horizon-server.sls /srv/salt/pillar/horizon-server.sls
salt-call --local --retcode-passthrough state.highstate
{% for service in server.services %}
service {{ service }} stop || true
{% endfor %}
export APACHE_RUN_USER=horizon
export APACHE_RUN_GROUP=horizon
export APACHE_PID_FILE=/var/run/apache2/apache2.pid
export APACHE_RUN_DIR=/var/run/apache2
export APACHE_LOCK_DIR=/var/lock/apache2
export APACHE_LOG_DIR=/var/log/apache2
su horizon --shell=/bin/sh -c 'apachectl -DFOREGROUND'
{#-
vim: syntax=jinja
-#}

View File

@ -83,4 +83,15 @@ horizon_log_file:
- require:
- file: horizon_log_dir
{%- if grains.get('virtual_subtype', None) == "Docker" %}
horizon_entrypoint:
file.managed:
- name: /entrypoint.sh
- template: jinja
- source: salt://horizon/files/entrypoint.sh
- mode: 755
{%- endif %}
{%- endif %}