Skip to content

Instantly share code, notes, and snippets.

@onlyanegg
Last active October 11, 2017 20:11
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 onlyanegg/bb758a63f9ce232911b422801e10628e to your computer and use it in GitHub Desktop.
Save onlyanegg/bb758a63f9ce232911b422801e10628e to your computer and use it in GitHub Desktop.
cie:
config:
kafka:
zookepperUrl: 'localhost:2181'
brokers: 'localhost:9092'
services:
account:
description: Account Service
config_sections:
- kafka
- eureka
config:
eureka:
vipAddress: 'account'
kafka:
handlers:
- 'com.cie.account.handler.RegistrationImportFinishHandler'
- 'com.cie.account.handler.BulkAccountCreateHandler'
audit:
description: Audit Service
config_sections:
- eureka
config:
eureka:
vipAddress: 'audit'
{%- from 'cie/settings.sls' import cie with context -%}
{% for service, attributes in cie.services.iteritems() %}
{% set config = cie.config %}
{% for section in attributes.config_sections | default([]) %}
manage_{{ service }}_{{ section }}_configuration:
file.serialize:
- name: /usr/local/{{ service }}/etc/{{ service }}.yml
- dataset: {{ '{' ~ section ~ ': ' ~ salt.slsutil.update(config.get(section, {}), attributes.config.get(section, {})) ~ '}' }}
- formatter: yaml
- merge_if_exists: True
- user: {{ pillar.sys_users.cie.user }}
- group: {{ pillar.sys_users.cie.group }}
- mode: 640
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment