Merge pull request #293 from myii/fix/postgres_schema-on-FreeBSD

fix(macros.jinja): use `user` kwarg for schemas (required on FreeBSD)
This commit is contained in:
Niels Abspoel
2019-10-28 20:59:38 +01:00
committed by GitHub
2 changed files with 19 additions and 1 deletions

17
kitchen.vagrant.yml Normal file
View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
driver:
name: vagrant
platforms:
- name: freebsd-120-2019-2-py3
driver:
box_url: https://freebsd.z.vstack.com/FreeBSD-12.0.box
cache_directory: false
customize:
usbxhci: 'off'
gui: false
linked_clone: true
ssh:
shell: '/bin/sh'

View File

@@ -18,7 +18,8 @@
{%- if 'ensure' in kwarg %} {%- if 'ensure' in kwarg %}
{%- set ensure = kwarg.pop('ensure') %} {%- set ensure = kwarg.pop('ensure') %}
{%- endif %} {%- endif %}
{%- if 'user' not in kwarg and state != 'postgres_schema' %} {%- set user_available = not (state == 'postgres_schema' and grains.saltversioninfo < [2018, 3]) %}
{%- if 'user' not in kwarg and user_available %}
{%- do kwarg.update({'user': postgres.user}) %} {%- do kwarg.update({'user': postgres.user}) %}
{%- endif -%} {%- endif -%}