Salt-Stack requirement

I started playing with Solta. I couldn't find any information on how to make a state depend on several other states.

state_a:
  module.run:
    - name: my.module
    - m_name: name_a

state_b:
  module.run:
    - name: my.module
    - m_name: name_b

state_c:
  module.run:
    - name: my.module
    - m_name: name_c

    - require:
      - module: ...

      

How can I do state_c

up to require

both state_a

and state_b

?

Bonus question . What is the rationale for using a structure Key: Single Value

to define dependencies in Salt?

+3


source to share


1 answer


This should work in most cases:

state_c:
  module.run:
    - name: my.module
    - m_name: name_c
    - require:
      - module: state_a
      - module: state_b

      



Also, as far as using salts of unambiguous dictation lists instead of flat dictionaries: I think this is partly because of cases like this where you need multiple identical keys, and partly as a way to simulate an ordered disk for when ordering issues. However, I am not a salt developer.

+6


source







All Articles