Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # orch/orch_new_thingworx_instance.sls
- {% set post_data = salt.pillar.get('event_data') %}
- {% set instance_name = post_data.get("region") ~ '-' ~ post_data.get("cust_name") ~ '-' ~ post_data.get("ext_dns") ~ '-' ~ post_data.get("instance_type") %}
- {% set secure_minion = salt['config.get']('salt:secure_minion') %}
- orch_start_slack_notify:
- salt.function:
- - name: slack.post_message
- - tgt: {{ secure_minion }}
- - kwarg:
- channel: '#experimental'
- message: 'Deployment Orchestration Started: Salt Cloud Deploying AWS Instance: {{ instance_name }}.'
- from_name: salt
- api_key: {{ salt['config.get']('slack:api_key') }}
- icon: 'http://i.imgur.com/n5I6apg.png'
- deploy_salt_cloud_instance:
- salt.runner:
- - name: cloud.profile
- - prof: SALT_CLOUD_PROFILE
- - instances:
- - {{ instance_name }}
- - require:
- - salt: orch_start_slack_notify
- sync_all:
- salt.function:
- - name: saltutil.sync_all
- - tgt: {{ instance_name }}
- - require:
- - salt: deploy_salt_cloud_instance
- set_minion_grains:
- salt.state:
- - tgt: {{ instance_name }}
- - sls:
- - application.setup_grains
- - pillar:
- new_instance_ext_dns: {{ post_data.ext_dns }}.example.com
- new_instance_customer: {{ post_data.cust_name }}
- new_instance_type: {{ post_data.instance_type }}
- new_environment_id: {{ post_data.environmentId }}
- - require:
- - salt: sync_all
- prov_cust_cert:
- salt.state:
- - tgt: {{ secure_minion }}
- - sls:
- - application.provision_ssl_cert
- - pillar:
- new_instance_ext_dns: {{ post_data.ext_dns }}.example.com
- - require:
- - salt: set_minion_grains
- refresh_s3fs:
- salt.runner:
- - name: fileserver.update
- - backend: s3fs
- - require:
- - salt: prov_cust_cert
- add_host_to_ldap:
- salt.state:
- - tgt: {{ instance_name }}
- - sls: common.hostldap
- - require:
- - salt: refresh_s3fs
- run_initial_highstate:
- salt.state:
- - tgt: {{ instance_name }}
- - highstate: True
- - require:
- - salt: add_host_to_ldap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement