可以从另一个业务流程中调用业务流程运行器吗?

时间:2017-08-23 12:09:32

标签: salt-stack

我试图从另一个业务流程运行中调用一些复杂的业务流程。

与盐一样,在doc https://docs.saltstack.com/en/latest/ref/states/all/salt.states.saltmod.html#salt.states.saltmod.runner

中没有示例

有可能吗?如何传递参数?
我在简单的例子中测试这个以简化,但它以错误结束:

 test_ping_all_servers_runner:
   salt.runner:
    - name:
      - state.orchestrate
    - kwargs: {
        name: orch.test_all_servers
      }

文件orch.test_all_servers.sls看起来像这样,它可以单独调用:

test_ping_sld:
  module.run:
    - name: test.ping
    - tgt: 'G@role:sld and G@sld:mode:admin'
    - tgt_type: compound

我收到此错误消息:

[DEBUG   ] Unable to fire args event due to missing __orchestration_jid__
[DEBUG   ] LazyLoaded saltutil.runner
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 1746, in call
    **cdata['kwargs'])
  File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1704, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/states/saltmod.py", line 654, in runner
    **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/saltutil.py", line 1218, in runner
    full_return=full_return)
  File "/usr/lib/python2.7/site-packages/salt/runner.py", line 141, in cmd
    full_return)
  File "/usr/lib/python2.7/site-packages/salt/client/mixins.py", line 225, in cmd
    self.functions[fun], arglist, pub_data
  File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1087, in __getitem__
    func = super(LazyLoader, self).__getitem__(item)
  File "/usr/lib/python2.7/site-packages/salt/utils/lazy.py", line 96, in __getitem__
    if self._load(key):
  File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1494, in _load
    raise KeyError
KeyError

0 个答案:

没有答案