- exclude does not exclude a watch_in
In this example: cat /srv/salt/test.sls
mypkgs:
pkg.installed:
- pkgs:
- erlnode
- erlang
- watch_in:
- service: erlnode
erlnode:
service.running
Then in another sls file we include and exclude: cat /srv/salt/test2.sls
include:
- test
/etc/foo:
file.managed:
- source: salt://foo
exclude:
- id: mypkgs
extend:
erlnode:
service:
- require:
- file: /etc/foo
If you run
salt-call state.sls test2
Then you get an error because the watch_in gets converted to a watch before the mypkgs state gets excluded.
I have the same problem in my environment, where I want to exclude some states for testing my deployments. Is there a workaround?
It's a bit annoying problem. But in my case (IMHO @UtahDave example as well) its only shows another (common and probably main) problem - modularity of ours SLS. SLSs do not separate common states with specific (configuration) states and therefore cannot be simply reused (include). Take a look https://docs.saltstack.com/en/latest/topics/best_practices.html.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.