Skip to content

Instantly share code, notes, and snippets.

@tom--
Last active November 17, 2017 14:12
Show Gist options
  • Save tom--/e121361b12b6615bd5447fe944cccb58 to your computer and use it in GitHub Desktop.
Save tom--/e121361b12b6615bd5447fe944cccb58 to your computer and use it in GitHub Desktop.
Salt orchestration—start a container and wait for its minion
start {{ container }}:
salt.function:
- tgt: {{ host }}
- name: lxc.start
- arg:
- {{ container }}
wait for {{ container }} minion:
salt.wait_for_event:
- name: salt/minion/*/start
- id_list:
- {{ container }}.{{ host }}
- require:
- salt: start {{ container }}
run utility:
salt.function:
- tgt: '{{ container }}.{{ host }}'
- name: cmd.run
- arg:
- /path/to/utility
- require:
- salt: wait for {{ container }} minion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment