Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Salt orchestration
{% set branch = pillar.name.split('.', 1)[0] %}
{{ branch }} db:
salt.function:
- name: state.apply
- tgt: salt.example.local
- arg:
- projects.test.dbs.generate_from_template
- kwarg:
pillar:
db_name: {{ branch }}
{{ pillar.name }}:
salt.function:
- name: cloud.profile
- tgt: salt.es.local
- kwarg:
profile: lxc_test
names:
- {{ pillar.name }}
config_dir: /etc/salt
{{ pillar.name }} up:
salt.function:
- name: test.ping
- tgt: {{ pillar.name }}
limit {{ pillar.name }} memory:
salt.function:
- tgt: test.es.local
- name: lxc.set_parameter
- arg:
- {{ pillar.name }}
- memory.soft_limit_in_bytes
- 3G
{{ pillar.name }} DNS:
salt.function:
- tgt: salt.es.local
- name: cmd.run
- arg:
- /usr/local/sbin/update-internal-dns {{ pillar.name }}
- require:
- salt: {{ pillar.name }} up
{{ pillar.name }} grains:
salt.function:
- tgt: {{ pillar.name }}
- name: grains.set
- arg:
- branch
- {{ branch }}
- require:
- salt: {{ pillar.name }} up
{{ pillar.name }} highstate:
salt.state:
- tgt: {{ pillar.name }}
- highstate: True
- require:
- salt: {{ pillar.name }} grains
/etc/haproxy/haproxy.cfg:
salt.state:
- tgt: test.example.local
- sls:
- packages.haproxy
- test.haproxy_config
- require:
- salt: {{ pillar.name }} up
- {{ pillar.name }} DNS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.