From dd526f1de294b640dad7c51ef09aae3834858a3f Mon Sep 17 00:00:00 2001 From: Marius Kotsbak Date: Wed, 2 May 2018 15:54:53 +0200 Subject: [PATCH] Make formula relative to actual directory by using 'tpldir' --- postgres/client/init.sls | 2 +- postgres/dev.sls | 6 +++--- postgres/dropped.sls | 2 +- postgres/macos/init.sls | 2 +- postgres/macos/postgresapp.sls | 2 +- postgres/manage.sls | 4 ++-- postgres/python.sls | 2 +- postgres/server/image.sls | 2 +- postgres/server/init.sls | 2 +- postgres/upstream.sls | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/postgres/client/init.sls b/postgres/client/init.sls index d315ea1..c20ecad 100644 --- a/postgres/client/init.sls +++ b/postgres/client/init.sls @@ -1,4 +1,4 @@ -{%- from "postgres/map.jinja" import postgres with context -%} +{%- from salt.file.dirname(tpldir) ~ "/map.jinja" import postgres with context -%} {%- set pkgs = [] %} {%- for pkg in (postgres.pkg_client, postgres.pkg_libpq_dev) %} diff --git a/postgres/dev.sls b/postgres/dev.sls index 7473171..7171b1f 100644 --- a/postgres/dev.sls +++ b/postgres/dev.sls @@ -1,4 +1,4 @@ -{% from "postgres/map.jinja" import postgres with context %} +{% from tpldir + "/map.jinja" import postgres with context %} {% if grains.os not in ('Windows', 'MacOS',) %} @@ -44,7 +44,7 @@ postgresql-{{ bin }}-altinstall: postgres_maxfiles_limits_conf: file.managed: - name: /Library/LaunchDaemons/limit.maxfiles.plist - - source: salt://postgres/templates/limit.maxfiles.plist + - source: salt://{{ tpldir }}/templates/limit.maxfiles.plist - context: soft_limit: {{ postgres.limits.soft or postgres.limits.hard }} hard_limit: {{ postgres.limits.hard or postgres.limits.soft }} @@ -62,7 +62,7 @@ postgres-desktop-shortcut-clean: postgres-desktop-shortcut-add: file.managed: - name: /tmp/mac_shortcut.sh - - source: salt://postgres/templates/mac_shortcut.sh + - source: salt://{{ tpldir }}/templates/mac_shortcut.sh - mode: 755 - template: jinja - context: diff --git a/postgres/dropped.sls b/postgres/dropped.sls index 8c88d7b..ffac550 100644 --- a/postgres/dropped.sls +++ b/postgres/dropped.sls @@ -1,4 +1,4 @@ -{% from "postgres/map.jinja" import postgres with context %} +{% from tpldir + "/map.jinja" import postgres with context %} postgresql-dead: service.dead: diff --git a/postgres/macos/init.sls b/postgres/macos/init.sls index ed332ad..33d33ed 100644 --- a/postgres/macos/init.sls +++ b/postgres/macos/init.sls @@ -1,4 +1,4 @@ -{% from "postgres/map.jinja" import postgres with context %} +{%- from salt.file.dirname(tpldir) ~ "/map.jinja" import postgres with context -%} include: {% if postgres.use_upstream_repo == 'postgresapp' %} diff --git a/postgres/macos/postgresapp.sls b/postgres/macos/postgresapp.sls index cb4cd4f..b1a10b3 100644 --- a/postgres/macos/postgresapp.sls +++ b/postgres/macos/postgresapp.sls @@ -1,4 +1,4 @@ -{% from "postgres/map.jinja" import postgres as pg with context %} +{%- from salt.file.dirname(tpldir) ~ "/map.jinja" import postgres as pg with context -%} # Cleanup first pg-remove-prev-archive: diff --git a/postgres/manage.sls b/postgres/manage.sls index 20a7309..1931155 100644 --- a/postgres/manage.sls +++ b/postgres/manage.sls @@ -1,5 +1,5 @@ -{%- from "postgres/map.jinja" import postgres with context -%} -{%- from "postgres/macros.jinja" import format_state with context -%} +{%- from tpldir + "/map.jinja" import postgres with context -%} +{%- from tpldir + "/macros.jinja" import format_state with context -%} {%- if salt['postgres.user_create']|default(none) is not callable %} diff --git a/postgres/python.sls b/postgres/python.sls index 171062c..e007264 100644 --- a/postgres/python.sls +++ b/postgres/python.sls @@ -1,4 +1,4 @@ -{% from "postgres/map.jinja" import postgres with context %} +{% from tpldir + "/map.jinja" import postgres with context %} postgresql-python: pkg.installed: diff --git a/postgres/server/image.sls b/postgres/server/image.sls index 95838e7..711347f 100644 --- a/postgres/server/image.sls +++ b/postgres/server/image.sls @@ -1,4 +1,4 @@ -{%- from "postgres/map.jinja" import postgres with context -%} +{%- from salt.file.dirname(tpldir) ~ "/map.jinja" import postgres with context -%} # This state is used to launch PostgreSQL with ``pg_ctl`` command and enable it # on "boot" during an image (Docker, Virtual Appliance, AMI) preparation diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 60934c3..ace913d 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -1,4 +1,4 @@ -{%- from "postgres/map.jinja" import postgres with context %} +{%- from salt.file.dirname(tpldir) ~ "/map.jinja" import postgres with context -%} {%- set includes = [] %} {%- if postgres.bake_image %} diff --git a/postgres/upstream.sls b/postgres/upstream.sls index 2fae147..45605c4 100644 --- a/postgres/upstream.sls +++ b/postgres/upstream.sls @@ -1,5 +1,5 @@ -{%- from "postgres/map.jinja" import postgres with context -%} -{%- from "postgres/macros.jinja" import format_kwargs with context -%} +{%- from tpldir + "/map.jinja" import postgres with context -%} +{%- from tpldir + "/macros.jinja" import format_kwargs with context -%} {%- if 'pkg_repo' in postgres -%}