How to call one salt-orchestration state in another orchestration state

457 views
Skip to first unread message

Raja Vairaashtak

unread,
Jan 23, 2018, 2:13:37 AM1/23/18
to Salt-users
Hi,

Is there any example of using calling one salt-orchestration into another salt-orchestration?

I have a scenario where there are 2 orchestration states:

1. Minion_add.sls

{% set data = {
  'account_type': 'local',
  'StabilityZone': '1',
  'Cluster': 'cluster1',
  'region': 'region1',
  'account_user': 'account1',
  'minion_id': 'myminion1.corp.company.com',
} %}


run_minion_after_firstboot_orch:
    salt.runner:
      - name: state.orchestrate
      - args: orch.minion_after_firstboot
      - pillar:
            event_data: {{data}}


2. minion_after_first_boot.sls

{% set data = salt.pillar.get('event_data') %}
test_cmd_echo:
    module.run:
      - name: test.echo
      - tgt: 'myminion2.corp.company.com'
      - text: {{ data }}

Here tried various things but always get keyError i.e. SaltInvocationError: The following keyword arguments are not valid: args=orch.minion_after_firstboot

My question is what is the correct syntax of invoking one orchestration from another orchestration and also pass arguments? I have tried looking this documentation, but there is no such example listed here https://docs.saltstack.com/en/latest/topics/orchestrate/orchestrate_runner.html.

Thanks






Thomas Phipps

unread,
Jan 23, 2018, 2:35:12 AM1/23/18
to salt-...@googlegroups.com
You were close

run_minion_after_firstboot_orch:
  salt.runner:
    - name: state.orchestrate
    - mods: orch.minion_after_firstboot
    - pillar:
        event_data: {{data}}


I tend to use this for calling my gitfs reload script before i put it into a websocket. such as this example here. https://github.com/whytewolf/salt-phase0-orch/blob/master/orch/packs/mysql/install.sls




--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/95d3a34b-7f3c-4746-8483-8c4c6afa5f32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raja Vairaashtak

unread,
Jan 23, 2018, 2:44:18 AM1/23/18
to Salt-users
Thanks a lot for your response. This worked.
Reply all
Reply to author
Forward
0 new messages