Search code examples
salt-project

SaltStack: How to depend on a ID in a sls file?


I want to depend on id monitoring__user of base.sls in optional.sls:

base.sls

monitoring__user:
  user.present:
    - name: {{...}}

optional.sls

monitoring_user_in_group_foo:
  group.present:
    - name: foo
    - addusers:
      - {{...}}
    - require:
       ###### how to depend on monitoring__user?

In the docs require looks like this - pkg: vim. Is there a way to only depend on the id?


Solution

  • You can specify either the id or the name. So your require would look like this:

    - require:
      - user: monitoring__user