From eefb89ee75510a0cd146779f79e22a2fb61af104 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 27 Oct 2019 20:14:11 +0000 Subject: [PATCH 1/3] ci(kitchen): add pre-salted `FreeBSD-12.0` box for local testing --- kitchen.vagrant.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 kitchen.vagrant.yml diff --git a/kitchen.vagrant.yml b/kitchen.vagrant.yml new file mode 100644 index 0000000..2dcd6f3 --- /dev/null +++ b/kitchen.vagrant.yml @@ -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' From 7ff798a27e29f29a29c54c014d4220c777ff776a Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 27 Oct 2019 20:17:03 +0000 Subject: [PATCH 2/3] fix(macros.jinja): use `user` kwarg for schemas (required on FreeBSD) * Not available in `2017.7`: - https://docs.saltstack.com/en/2017.7/ref/states/all/salt.states.postgres_schema.html --- postgres/macros.jinja | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/postgres/macros.jinja b/postgres/macros.jinja index e61754a..1374553 100644 --- a/postgres/macros.jinja +++ b/postgres/macros.jinja @@ -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 = False if (state == 'postgres_schema' and grains.saltversioninfo < [2018, 3]) else True %} + {%- if 'user' not in kwarg and user_available %} {%- do kwarg.update({'user': postgres.user}) %} {%- endif -%} From d606b28692a1ef480c5d4b378a940bfde79b126e Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 28 Oct 2019 09:24:04 +0000 Subject: [PATCH 3/3] fix(macros.jinja): apply suggestion from PR Co-Authored-By: Denys Havrysh --- postgres/macros.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/macros.jinja b/postgres/macros.jinja index 1374553..814f598 100644 --- a/postgres/macros.jinja +++ b/postgres/macros.jinja @@ -18,7 +18,7 @@ {%- if 'ensure' in kwarg %} {%- set ensure = kwarg.pop('ensure') %} {%- endif %} - {%- set user_available = False if (state == 'postgres_schema' and grains.saltversioninfo < [2018, 3]) else True %} + {%- 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 -%}