salt icon indicating copy to clipboard operation
salt copied to clipboard

- exclude does not exclude a watch_in

Open UtahDave opened this issue 12 years ago • 3 comments

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.

UtahDave avatar Mar 20 '14 02:03 UtahDave

I have the same problem in my environment, where I want to exclude some states for testing my deployments. Is there a workaround?

RobertFach avatar Oct 29 '14 15:10 RobertFach

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.

kwarunek avatar Sep 02 '15 06:09 kwarunek

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.

stale[bot] avatar Dec 23 '17 00:12 stale[bot]