Skip to content

Instantly share code, notes, and snippets.

@onlyanegg
Created January 19, 2017 00:57
Show Gist options
  • Save onlyanegg/f78efe1adfa1ed34690349f3f028f699 to your computer and use it in GitHub Desktop.
Save onlyanegg/f78efe1adfa1ed34690349f3f028f699 to your computer and use it in GitHub Desktop.
{% set environment = grains.id.split('.')[2] %}
{% for pod in pillar.deploy.pods %}
{% if pillar.deploy.services.app is defined %}
deploy_{{ pod }}_app_master:
salt.state:
- tgt: {{ pillar.pods[pod].app_master }}
- tgt_type: pcre
- saltenv: common
- failhard: True
- sls:
- deploy.app
deploy_{{ pod }}_app:
salt.state:
- tgt: E@app[0-9]{2,3}.{{ pod }}.{{ environment }}.* and not E@{{ pillar.pods[pod].app_master }}
- tgt_type: compound
- saltenv: common
- batch: 25%
- failhard: True
- sls:
- deploy.app
deploy_{{ pod }}_api:
salt.state:
- tgt: api[0-9]{2,3}.{{ pod }}.{{ environment }}.*
- tgt_type: pcre
- saltenv: common
- batch: 25%
- failhard: True
- sls:
- deploy.app
{% endif %}
{% if pillar.deploy.services.internal_services is defined and pillar.deploy.services.external_services is defined %}
deploy_{{ pod }}_internal_and_external_services:
salt.state:
- tgt: plat[0-9]{2,3}.{{ pod }}.{{ environment }}.*
- tgt_type: pcre
- saltenv: common
- batch: 25%
- failhard: True
- sls:
- deploy.internal_services
- deploy.external_services
{% elif pillar.deploy.services.internal_services is defined %}
deploy_{{ pod }}_internal_services:
salt.state:
- tgt: plat[0-9]{2,3}.{{ pod }}.{{ environment }}.*
- tgt_type: pcre
- saltenv: common
- batch: 25%
- failhard: True
- sls:
- deploy.internal_services
{% elif pillar.deploy.services.external_services is defined %}
deploy_{{ pod }}_external_services:
salt.state:
- tgt: plat[0-9]{2,3}.{{ pod }}.{{ environment }}.*
- tgt_type: pcre
- saltenv: common
- batch: 25%
- failhard: True
- sls:
- deploy.external_services
{% endif %}
{% if pillar.deploy.services.jahia is defined %}
deploy_{{ pod }}_jahia:
salt.state:
- tgt: jahia[0-9]{2,3}.{{ pod }}.{{ environment }}.*
- tgt_type: pcre
- saltenv: common
- batch: 25%
- failhard: True
- sls:
- deploy.jahia
{% endif %}
{% if pillar.deploy.services.ame is defined %}
deploy_{{ pod }}_ame:
salt.state:
- tgt: ame[0-9]{2,3}.{{ pod }}.{{ environment }}.*
- tgt_type: pcre
- saltenv: common
- batch: 25%
- sls:
- deploy.ame
{% endif %}
{% if pillar.deploy.services.etl is defined %}
deploy_{{ pod }}_etl:
salt.state:
- tgt: (etl|ame)[0-9]{2,3}.{{ pod }}.{{ environment }}.*
- tgt_type: pcre
- saltenv: common
- batch: 25%
- sls:
- deploy.etl
{% endif %}
{% endfor %}
deploy:
ticket: SA-1779
pods:
- pod0
- pod1
services:
app:
revision: 322
branch: trunk
internal_services:
revision: 282
branch: trunk
external_services:
revision: 282
branch: trunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment