saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.18k stars 5.48k forks source link

Cannot add listen: sls requisite #53380

Open OrangeDog opened 5 years ago

OrangeDog commented 5 years ago

one.sls:

include:
  - two

ssh:
  service.running:
    - reload: true
    - listen:
      - sls: two

two.sls:

/trigger:
  file.absent: []

output:

local:
  Name: /trigger - Function: file.absent - Result: Clean Started: - 13:59:37.370668 Duration: 0.444 ms
  Name: ssh - Function: service.running - Result: Clean Started: - 13:59:38.037626 Duration: 46.214 ms
----------
          ID: listen_test.two
    Function: Listen_Error.Listen_Error
      Result: False
     Comment: Referenced state sls: test.two does not exist
     Changes:

Summary for local
------------
Succeeded: 2
Failed:    1
------------
Total states run:     3
Total run time:  46.658 ms

A require instead works fine.

Versions Report

Salt Version:
           Salt: 2018.3.4

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: 0.26.0
        libnacl: Not Installed
       M2Crypto: 0.32.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.2
         Python: 3.6.7 (default, Oct 22 2018, 11:32:17)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: ISO-8859-1
        machine: x86_64
        release: 4.15.0-50-generic
         system: Linux
        version: Ubuntu 18.04 bionic
stale[bot] commented 4 years ago

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.

OrangeDog commented 4 years ago

This issue still exists.

stale[bot] commented 4 years ago

Thank you for updating this issue. It is no longer marked as stale.

OrangeDog commented 1 year ago

An sls requisite also doesn't work with watch. There's no error, but nothing happens if a state in the target file reports changes.

That's actually documented: https://docs.saltproject.io/en/latest/ref/states/requisites.html#watch

A watch requisite has no effect on SLS requisites (watching for changes in an included SLS). Only the individual state IDs from an included SLS can be watched.

IMO, it should either work, or raise an exception, not silently fail.