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
commit fbd8f65561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 %}
{%- set ensure = kwarg.pop('ensure') %}
{%- 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}) %}
{%- endif -%}