0

I'm attempting to differentiate between a Ubuntu box and an Arch box within my top.sls file within a Virtualbox 5.0.4 virtual machine managed by vagrant 1.7.4 using salt 2015.8.1 (Beryllium)

This doesn't work:

base:
    'os:Arch':
        - base.arch

This does work:

base:
    {% if grains['os'] == 'Arch' %}
    '*':
        - base.arch
    {% endif %}

Excerpt from salt-call grains.items:

os:
    Arch
os_family:
    Arch
osarch:
    x86_64
oscodename:
osfullname:
    Arch Linux
osrelease:

Does anyone have any insight?

lsh
  • 148
  • 1
  • 12

1 Answers1

1

This should work:

base:
  'os:Arch':
    - match: grain
    - base.arch

See https://docs.saltstack.com/en/latest/ref/states/top.html

Christophe Drevet
  • 1,962
  • 2
  • 17
  • 25
  • ah, I *completely* overlooked that next line. I did think it must be doing some pretty clever pattern matching without hinting. – lsh Oct 23 '15 at 14:05