Salt: There no way to exclude SLS in calling salt.state inside orchestration

Created on 15 Aug 2018  路  4Comments  路  Source: saltstack/salt

Description of Issue/Question

I'm trying to make scenario for orchestrate and invoke it via reactor.
What I have now:
```my_state:
salt.state:
- tgt: '{{ node_name }}'
- sls: foo
- queue: True
- require:
- salt: other_state

That basically is equivalent to:
`salt -C node_name state.sls foo`

I need to apply state with exclude like:
`salt -C node_name state.sls foo exclude=foo.bar.buzz`
I tried a lot of variants(simple adding exclude: foo.bar.buzz, adding it via args, kwargs, running SLS via salt.function - no results), but after I found that in `salt/states/saltmod.py` there no arg named `exclude` or smth same.

### Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
```my_state:
  salt.state:
    - tgt: '{{ node_name }}'
    - sls: foo
    - exclude: foo.bar.buzz
    - queue: True
    - require:
      - salt: other_state

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

  1. Setup Salt
  2. Create SLS with salt.state call and add to it exclude flag
  3. Invoke it.

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Salt Version:
           Salt: 2017.7.5

Dependency Versions:
           cffi: Not Installed
       cherrypy: 3.5.0
       dateutil: 2.4.2
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: 1.0.3
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.12 (default, Dec  4 2017, 14:50:18)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: Ubuntu 16.04 xenial
         locale: UTF-8
        machine: x86_64
        release: 4.4.0-101-generic
         system: Linux
        version: Ubuntu 16.04 xenial

P.S. Yep, I know that this is a little bit old, but I'm pretty sure, that the same issue will be reproduced with latest salt.

Aluminium Feature phase-plan status-in-prog team-core

Most helpful comment

keeping this in planning but looking to get it merged in Aluminium, I need more info before I can commit this to the release, so keeping it in phase-plan for now.

All 4 comments

I found a workaround there.
Need to do the same with exclude arg https://github.com/saltstack/salt/commit/c89659537e90f9ac5897a33ebffe2f5ea4fd6be6

agreed that it would be nice to add this specification in the orch states. will approve as a feature request.

Taking a glance at the docs it looks like you should be able to specify exclude as an argument like so: salt-run state.orchestrate test exclude=foo2 but would definitely be nice to set it in the state file.

If you want to try to take a go at a PR we are more then willing to accept it :)

This have not been fixed. The PR #49227 have been merged to develop over two years ago, but have never been released. There is #58062 that ports it to master, but it have not seen any activity since it was opened two months ago. Can we reopen this issue until #58062 is merged?

keeping this in planning but looking to get it merged in Aluminium, I need more info before I can commit this to the release, so keeping it in phase-plan for now.

Was this page helpful?
0 / 5 - 0 ratings