gvasalt/states/gnuviechadmin/gvapgsql.sls

27 lines
822 B
Text
Raw Normal View History

2020-03-04 17:47:24 +01:00
{% set gvaappname = salt['pillar.get']('gnuviechadmin:appname') %}
{% set purpose = "for PostgreSQL configuration management" %}
{% from 'gnuviechadmin/gvaapp_macros.sls' import create_celery_worker with context %}
2017-08-20 12:55:04 +02:00
include:
- python.poetry
2020-03-04 17:47:24 +01:00
- postgresql-server
2017-08-20 12:55:04 +02:00
2020-03-04 17:47:24 +01:00
{{ create_celery_worker(gvaappname, purpose) }}
2017-08-20 12:55:04 +02:00
2020-03-04 17:47:24 +01:00
{{ gvaappname }}-dependencies:
2017-08-20 12:55:04 +02:00
pkg.installed:
- pkgs:
- python3-dev
2017-08-20 12:55:04 +02:00
- libpq-dev
- require_in:
2020-03-04 17:47:24 +01:00
- cmd: {{ gvaappname }}-requirements
gvapgsql-pgsql-user:
postgres_user.present:
- name: {{ salt['pillar.get']('gnuviechadmin:{}:pgsql_admin_user'.format(gvaappname), 'gvapgsql') }}
- password: {{ salt['pillar.get']('gnuviechadmin:{}:pgsql_admin_password'.format(gvaappname)) }}
- user: postgres
- superuser: True
- login: True
- require:
- pkg: postgresql