Add salt state and pillar data for gvaweb

This commit is contained in:
Jan Dittberner 2017-08-20 13:34:17 +02:00
parent 87d2af1a8a
commit 9a557fa69f
6 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,9 @@
include:
- gnuviechadmin
- gnuviechadmin.queues.common
- gnuviechadmin.queues.gvaweb
gnuviechadmin:
component:
name: gvaweb
amqp_user: web

View file

@ -0,0 +1,14 @@
include:
- gnuviechadmin.base
- gnuviechadmin.celery
sudo:
pkg.installed
/etc/sudoers.d/gvaweb:
file.managed:
- user: root
- group: root
- source: salt://gnuviechadmin/gvaweb/sudoers
- require:
- pkg: sudo

View file

@ -0,0 +1,12 @@
#!/bin/sh
set -ex
. {{ home }}/gvasettings.sh
unset LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \
LC_IDENTIFICATION LC_ALL
cd {{ appdir }}
{{ virtualenv }}/bin/celery worker -A gvaweb -Q web --loglevel=INFO

View file

@ -0,0 +1,8 @@
#!/bin/sh
export GVAWEB_BROKER_URL='{{ broker_url }}'
export GVAWEB_RESULTS_REDIS_URL="redis://:{{ salt['pillar.get']('gnuviechadmin:redis_password') }}@{{ salt['pillar.get']('gnuviechadmin:redis_host') }}/0"
export GVAWEB_NGINX_SITES_AVAILABLE="{{ salt['pillar.get']('gnuviechadmin:nginx_sites_available', '/etc/nginx/sites-available') }}"
export GVAWEB_NGINX_SITES_ENABLED="{{ salt['pillar.get']('gnuviechadmin:nginx_sites_enabled', '/etc/nginx/sites-enabled') }}"
export GVAWEB_PHPFPM_POOL="{{ salt['pillar.get']('gnuviechadmin:phpfpm_pool', '/etc/php5/fpm/pool.d') }}"
export GVAWEB_WWWUSER_MOUNT="{{ salt['pillar.get']('gnuviechadmin:wwwuser_mount', '/srv/wwwfiles') }}"

View file

@ -0,0 +1,3 @@
Cmnd_Alias GVAWEB_CMDS = /usr/bin/install, /bin/rm, /bin/ln, /usr/sbin/service
gvaweb ALL = (root) NOPASSWD: GVAWEB_CMDS

View file

@ -19,6 +19,8 @@ generate-dhparam-nginx:
- name: openssl dhparam -out {{ ssldir }}/dhparams.pem 2048
- umask: 022
- runas: root
- timeout: 300
- output_loglevel: debug
- creates: {{ ssldir }}/dhparams.pem
- require_in:
- file: /etc/nginx/conf.d/ssl.conf