diff --git a/salt/cloud.sls b/salt/cloud.sls index 41c753b..be62f5d 100644 --- a/salt/cloud.sls +++ b/salt/cloud.sls @@ -1,4 +1,4 @@ -{% from "salt/package-map.jinja" import pkgs with context %} +{% from "salt/map.jinja" import pkgs with context %} {% set salt = pillar.get('salt', {}) -%} {% set cloud = salt.get('cloud', {}) -%} diff --git a/salt/package-map.jinja b/salt/map.jinja similarity index 89% rename from salt/package-map.jinja rename to salt/map.jinja index 770de38..e342330 100644 --- a/salt/package-map.jinja +++ b/salt/map.jinja @@ -1,4 +1,4 @@ -{% set package_table = { +{% set pkgs = salt['grains.filter_by']({ 'Debian': {'salt-master': 'salt-master', 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', @@ -48,11 +48,6 @@ 'config-path': '/usr/local/etc/salt', 'minion-service': 'salt_minion', 'master-service': 'salt_master', - 'syndic-service': 'salt_syndic'} -} %} - -{% if 'package_table' in pillar %} - {% set pkgs = pillar['package_table'] %} -{% elif grains['os'] in package_table %} - {% set pkgs = package_table[grains['os']] %} -{% endif %} + 'syndic-service': 'salt_syndic'}, +}, +merge=salt['pillar.get']('salt:lookup'), base='default') %} diff --git a/salt/master.sls b/salt/master.sls index baa2e2b..2cb3bd0 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -1,4 +1,4 @@ -{% from "salt/package-map.jinja" import pkgs with context %} +{% from "salt/map.jinja" import pkgs with context %} salt-master: pkg.installed: diff --git a/salt/minion.sls b/salt/minion.sls index a80e210..a33172f 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -1,4 +1,4 @@ -{% from "salt/package-map.jinja" import pkgs with context %} +{% from "salt/map.jinja" import pkgs with context %} salt-minion: pkg.installed: diff --git a/salt/ssh.sls b/salt/ssh.sls index 2f6aece..e32f5eb 100644 --- a/salt/ssh.sls +++ b/salt/ssh.sls @@ -1,4 +1,4 @@ -{% from "salt/package-map.jinja" import pkgs with context %} +{% from "salt/map.jinja" import pkgs with context %} ensure salt-ssh is installed: pkg.installed: diff --git a/salt/standalone.sls b/salt/standalone.sls index e33da85..e4a8cd2 100644 --- a/salt/standalone.sls +++ b/salt/standalone.sls @@ -1,4 +1,4 @@ -{% from "salt/package-map.jinja" import pkgs with context %} +{% from "salt/map.jinja" import pkgs with context %} salt-minion: pkg.installed: diff --git a/salt/syndic.sls b/salt/syndic.sls index 0804d98..5af99e4 100644 --- a/salt/syndic.sls +++ b/salt/syndic.sls @@ -1,4 +1,4 @@ -{% from "salt/package-map.jinja" import pkgs with context %} +{% from "salt/map.jinja" import pkgs with context %} include: - salt.master