Skip to content

Instantly share code, notes, and snippets.

@jalons
Created October 22, 2014 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalons/63466ce310dc3627743b to your computer and use it in GitHub Desktop.
Save jalons/63466ce310dc3627743b to your computer and use it in GitHub Desktop.
salt SERVER state.sls dep.port "pillar={deployment:{'Application':'AppName', 'destination':'/opt/local/AppName', 'foo':'baz', 'version':'somestring', 'application_directory':'/opt/local/'}}" env=Staging
{% set application_name = pillar['deployment']['Application'] %}
{{ application_name }}_sync_states:
module.run:
- name: saltutil.sync_states
- env: Staging
{{ application_name }}_sync_modules:
module.run:
- name: saltutil.sync_modules
- env: Staging
port_{{ application_name }}:
deploy_port.deploy:
- name: {{ application_name }}
- version: {{ salt['pillar.get']('deployment:version') }}
- destination: {{ salt['pillar.get']('deployment:destination', '/opt/local/') }}
- user: {{ salt['pillar.get']('deployment:user', 'root') }}
- current: {{ salt['pillar.get']('deployment:set_current_directory', 'True') }}
So, rather than repeat AppName at both Application and destination, I'd like to beable to append Application value to the end of destination, something like:
port_{{ application_name }}:
deploy_port.deploy:
- name: {{ application_name }}
- destination: {{ salt['pillar.get']('deployment:destination')salt['pillar.get']('deployment:application') }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment