Skip to content

Instantly share code, notes, and snippets.

@jakshi
Last active June 6, 2016 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakshi/0c2dd28020991b6d575176e4ab5132fa to your computer and use it in GitHub Desktop.
Save jakshi/0c2dd28020991b6d575176e4ab5132fa to your computer and use it in GitHub Desktop.
salt issue
in state I have:
top.sls:
base:
'*':
- common
'G@roles:postgresql-slave and G@environment:test':
- match: compound
- database.postgresql-slave
database/postgresql.sls:
postgresql:
pkg.installed:
- pkgs:
- dev-db/postgresql
- dev-db/postgis
- dev-db/postgres-pg_modules
database/postgresql-slave.sls:
include postgresql
{% for conf_file in 'pg_hba.conf', 'pg_ident.conf', 'postgresql.conf', 'recovery.conf' %}
{{ conf_file }}:
file.managed:
- name: /etc/postgresql-9.5/{{ conf_file }}
- source: salt://database/files/{{ conf_file }}
- user: postgres
- group: postgres
- mode: 644
- template: jinja
- defaults:
replication_password: {{ pillar['postgresql']['replication_password'] }}
{% endfor %}
salt shows this error:
[CRITICAL] Rendering SLS 'base:database.postgresql-slave' failed: mapping values are not allowed here; line 4
---
include postgresql
pg_hba.conf: <======================
file.managed:
- name: /etc/postgresql-9.5/pg_hba.conf
- source: salt://database/files/pg_hba.conf
- user: postgres
- group: postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment