salt icon indicating copy to clipboard operation
salt copied to clipboard

implement ignore_missing for /srv/salt/top.sls as well

Open tampakrap opened this issue 7 years ago • 10 comments

Description of Issue/Question

The ignore_missing: True option at the pillar top.sls file allows us to include a file only if it exists. Such an option would be useful to have for the salt top.sls file as well.

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

/srv/salt/top.sls

{% set roles = salt['grains.get']('roles', []) %}

base:
  '*':
    - role.base
  {% for role in roles %}
  'role:{{ role }}':
    - match: grain
    #- ignore_missing: True
    - role.{{ role }}
  {% endfor %}

tampakrap avatar Nov 19 '17 21:11 tampakrap