diff --git a/salt/api.sls b/salt/api.sls index 4681c43..994212d 100644 --- a/salt/api.sls +++ b/salt/api.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath + "/map.jinja" import salt_settings with context %} include: - salt.master diff --git a/salt/cloud.sls b/salt/cloud.sls index fec735e..6c1f06f 100644 --- a/salt/cloud.sls +++ b/salt/cloud.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath + "/map.jinja" import salt_settings with context %} python-pip: pkg.installed diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf index 0f35b2a..5dca2ad 100644 --- a/salt/files/master.d/f_defaults.conf +++ b/salt/files/master.d/f_defaults.conf @@ -12,7 +12,7 @@ #{{ configname }}: {{ default_value }} {%- endif -%} {%- endmacro -%} -{%- from 'salt/formulas.jinja' import file_roots, formulas with context -%} +{%- from uri_formulas_jinja import file_roots, formulas with context -%} ##### Primary configuration settings ##### ########################################## # This configuration file is used to manage the behavior of the Salt Master. diff --git a/salt/files/minion.d/f_defaults.conf b/salt/files/minion.d/f_defaults.conf index 9c65ce3..d2c2391 100644 --- a/salt/files/minion.d/f_defaults.conf +++ b/salt/files/minion.d/f_defaults.conf @@ -13,7 +13,7 @@ #{{ configname }}: {{ default_value }} {%- endif -%} {%- endmacro -%} -{%- from 'salt/formulas.jinja' import file_roots, formulas with context -%} +{%- from uri_formulas_jinja import file_roots, formulas with context -%} ##### Primary configuration settings ##### ########################################## diff --git a/salt/formulas.sls b/salt/formulas.sls index b433bb5..1d7485e 100644 --- a/salt/formulas.sls +++ b/salt/formulas.sls @@ -1,7 +1,7 @@ {% set processed_gitdirs = [] %} {% set processed_basedirs = [] %} -{% from "salt/formulas.jinja" import formulas_git_opt with context %} +{% from slspath + "/formulas.jinja" import formulas_git_opt with context %} # Loop over all formulas listed in pillar data {% for env, entries in salt['pillar.get']('salt_formulas:list', {}).items() %} diff --git a/salt/gitfs/dulwich.sls b/salt/gitfs/dulwich.sls index b5c2589..d929a69 100644 --- a/salt/gitfs/dulwich.sls +++ b/salt/gitfs/dulwich.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath.split('/')[:-1] + "/map.jinja" import salt_settings with context %} # issue 34 {% if salt_settings.gitfs.dulwich.install_from_source %} diff --git a/salt/gitfs/gitpython.sls b/salt/gitfs/gitpython.sls index f1a48e6..c673a02 100644 --- a/salt/gitfs/gitpython.sls +++ b/salt/gitfs/gitpython.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath.split('/')[:-1] + "/map.jinja" import salt_settings with context %} {% if salt_settings.gitfs.gitpython.install_from_source %} diff --git a/salt/gitfs/pygit2.sls b/salt/gitfs/pygit2.sls index 9fce72b..1c4d715 100644 --- a/salt/gitfs/pygit2.sls +++ b/salt/gitfs/pygit2.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath.split('/')[:-1] + "/map.jinja" import salt_settings with context %} {% set pygit2_settings = salt_settings.gitfs.pygit2 %} {% if pygit2_settings.git.get('require_state', False) %} diff --git a/salt/map.jinja b/salt/map.jinja index 368b5e6..8561305 100644 --- a/salt/map.jinja +++ b/salt/map.jinja @@ -2,7 +2,7 @@ # vim: ft=jinja {## Start with defaults from defaults.yaml ##} -{% import_yaml "salt/defaults.yaml" as default_settings %} +{% import_yaml slspath + "/defaults.yaml" as default_settings %} {## Setup variable using grains['os_family'] based logic, only add key:values here diff --git a/salt/master.sls b/salt/master.sls index 3352353..2e5a3ba 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath + "/map.jinja" import salt_settings with context %} salt-master: {% if salt_settings.install_packages %} @@ -11,6 +11,8 @@ salt-master: - source: salt://{{ slspath }}/files/master.d - clean: {{ salt_settings.clean_config_d_dir }} - exclude_pat: _* + - defaults: + uri_formulas: {{ slspath + "/formulas.jinja" }} service.running: - enable: True - name: {{ salt_settings.master_service }} diff --git a/salt/minion.sls b/salt/minion.sls index 2097abe..49b40f7 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath + "/map.jinja" import salt_settings with context %} salt-minion: {% if salt_settings.install_packages %} diff --git a/salt/pkgrepo/debian/absent.sls b/salt/pkgrepo/debian/absent.sls index a3eb838..ffebf89 100644 --- a/salt/pkgrepo/debian/absent.sls +++ b/salt/pkgrepo/debian/absent.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath.split('/')[:-1] + "/map.jinja" import salt_settings with context %} drop-saltstack-pkgrepo: pkgrepo.absent: diff --git a/salt/pkgrepo/debian/init.sls b/salt/pkgrepo/debian/init.sls index 350713f..930da11 100644 --- a/salt/pkgrepo/debian/init.sls +++ b/salt/pkgrepo/debian/init.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath.split('/')[:-1] + "/map.jinja" import salt_settings with context %} saltstack-pkgrepo: pkgrepo.managed: diff --git a/salt/pkgrepo/redhat/init.sls b/salt/pkgrepo/redhat/init.sls index a99827a..ad91c6a 100644 --- a/salt/pkgrepo/redhat/init.sls +++ b/salt/pkgrepo/redhat/init.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath.splt('/')[:-1] + "/map.jinja" import salt_settings with context %} saltstack-pkgrepo: pkgrepo.managed: diff --git a/salt/ssh.sls b/salt/ssh.sls index fad6463..e4a58ae 100644 --- a/salt/ssh.sls +++ b/salt/ssh.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath + "/map.jinja" import salt_settings with context %} {% if salt_settings.install_packages %} ensure-salt-ssh-is-installed: diff --git a/salt/standalone.sls b/salt/standalone.sls index e98a58c..a7528dc 100644 --- a/salt/standalone.sls +++ b/salt/standalone.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath + "/map.jinja" import salt_settings with context %} salt-minion: {% if salt_settings.install_packages %} diff --git a/salt/syndic.sls b/salt/syndic.sls index e372b2e..14eba2a 100644 --- a/salt/syndic.sls +++ b/salt/syndic.sls @@ -1,4 +1,4 @@ -{% from "salt/map.jinja" import salt_settings with context %} +{% from slspath + "/map.jinja" import salt_settings with context %} include: - salt.master