cant get grains.filter_by to work for some reason

This commit is contained in:
m0duspwnens
2020-07-31 13:25:37 -04:00
parent d7ad2fbfd7
commit 1e1d6a395d
2 changed files with 7 additions and 6 deletions

View File

@@ -1,10 +1,11 @@
{% import_yaml 'salt/minion.defaults.yaml' as salt %}
{% set SALTVERSION = salt.salt.minion.version %}
{% set SALTPACKAGES = salt['grains.filter_by']({
'Ubuntu': {'common': 'salt-common'},
'Centos': {'common': 'salt'},
}) %}
{% if grains.os|lower == 'ubuntu' %}
{% set COMMON = 'salt-common' %}
{% elif grains.os|lower == 'centos' %}
{% set COMMON = 'salt' %}
{% endif %}
{% if grains.saltversion|string != SALTVERSION|string %}
{% if grains.os|lower == 'centos' %}

View File

@@ -1,4 +1,4 @@
{% from 'salt/map.jinja' import SALTPACKAGES with context %}
{% from 'salt/map.jinja' import COMMON with context %}
{% from 'salt/map.jinja' import UPGRADECOMMAND with context %}
include:
@@ -16,7 +16,7 @@ install_salt_minion:
salt_minion_package:
pkg.installed:
- pkgs:
- {{ SALTPACKAGES.common }}
- {{ COMMON }}
- salt-minion
- hold: True