At the top of my State file, I have:
{% if grains['os'] == 'Ubuntu' %}
{% set ubuntu = True %}
{% set arch = False %}
{% elif grains['os'] == 'Arch' %}
{% set ubuntu = False %}
{% set arch = True %}
{% endif %}
Later on,
{% if ubuntu %}
cron:
{% elif arch %}
cronie:
{% endif %}
pkg.installed
service.running:
- enable: True
But this isn't working; my conditionals are rendering nothing (empty strings). Even if a small refactoring would get the job done, this smells to me.
Is there a more idiomatic way to alternate small details like this with Salt without so much templating boilerplate?