×
Difference between require and require_in in SaltStack
Automation Blog

Requisites: difference between require and require_in in SaltStack:

Requisites: difference between require and require_in in SaltStack

Lets see require vs require_in SaltStack. The Salt requisite system is used to create relationships between states. You can find more details about Requisites on here

require vs require_in SaltStack:

require:

  • This is the most basic requisite which allows us to specify that one state requires another state to be run successfully first.
  • Also ensures correct ordering and the requiring states runs only if the required state ran successfully.

Ex:
# cat req.sls
require_check: # REQUIRING STATE
cmd.run:
– name: echo FIRST
– require:
– cmd: require_check1
require_check1: # REQUIRED STATE
cmd.run:
– name: echo SECOND

require vs require_in SaltStack

If the REQUIRED STATE not successful:

require vs require_in SaltStack

 

require_in:

  • Requisites of this form( _in ) force other states to depend on the state that contains the requisite.
  • The requiring states run first and then run the required state if requiring state run successful.

Ex:
# cat req.sls
require_check: # REQUIRING STATE
cmd.run:
– name: echo FIRST
– require_in:
– cmd: require_check1
require_check1: # REQUIRED STATE
cmd.run:
– name: echo SECOND

 

require vs require_in SaltStack

If the REQUIRING STATE not successful:

require vs require_in SaltStack

One thought on “Requisites: difference between require and require_in in SaltStack:”

  1. Thank you for this amazing article. Its contents are well written and is very helpful.This is very important blog , thanks for sharing with us. It is very interesting blog which is helpful for all students as well as employee. Do keep Posting .Thanks alot!!!!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.