saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.15k stars 5.48k forks source link

Feature request - Optional glob matching in requisites #61492

Open udf2457 opened 2 years ago

udf2457 commented 2 years ago

Given the below:

foo:
  cmd.run:
    - name: bar
    - watch:
      - /foo/bar/*

In the present Salt behaviour, /foo/bar/* is a hard glob (i.e. if no state ID or name matches, it will result in an error).

It makes a lot of sense to allow optional globbing. i.e. in pseudo-code...

if exists(/foo/bar/*) {
    do it
} else {
    continue
}
OrangeDog commented 1 year ago

I'm not so sure. Then people will miss the fact that they've not included the states they expect.