{% set service = salt['grains.filter_by']({ 'Debian': { 'pkgs': ['iptables','netfilter-persistent' ], 'service': 'netfilter-persistent', }, 'RedHat': { 'pkgs': ['iptables'], 'service': 'iptables', }, }, merge=salt['grains.filter_by']({ 'trusty': { 'service': 'iptables-persistent', }, }, grain='oscodename', merge=salt['pillar.get']('iptables:service'))) %}