Преглед на файлове

Add support for salt master engines

Change-Id: Ic9decbeaf57e9aba2f95c3dd616393dc32763fcc
pull/56/head
Ales Komarek преди 7 години
родител
ревизия
a9fc6e7d21
променени са 5 файла, в които са добавени 76 реда и са изтрити 0 реда
  1. +26
    -0
      README.rst
  2. +6
    -0
      salt/files/_engine.conf
  3. +12
    -0
      salt/master/env.sls
  4. +14
    -0
      salt/master/service.sls
  5. +18
    -0
      salt/master/test.sls

+ 26
- 0
README.rst Целия файл

@@ -145,6 +145,32 @@ Salt master with logging handlers
host: 127.0.0.1
port: 9999


Salt engine definition for saltgraph metadata collector

.. code-block:: yaml

salt:
master:
engine:
graph_metadata:
engine: saltgraph
host: 127.0.0.1
port: 5432
user: salt
password: salt
database: salt

Salt engine definition for sending events from docker events

.. code-block:: yaml

salt:
master:
engine:
docker_events:
docker_url: unix://var/run/docker.sock

Salt master peer setup for remote certificate signing

.. code-block:: yaml

+ 6
- 0
salt/files/_engine.conf Целия файл

@@ -0,0 +1,6 @@
{% from "salt/map.jinja" import master with context %}

engines:
{%- for engine_name, engine in master.engine.items() %}
- {{ engine.get('engine', engine_name) }}: {{ engine|yaml }}
{%- endfor %}

+ 12
- 0
salt/master/env.sls Целия файл

@@ -13,6 +13,7 @@ salt_env_{{ master.system.environment }}_dirs_obsolete:
- /srv/salt/env/{{ master.system.environment }}/_modules
- /srv/salt/env/{{ master.system.environment }}/_states
- /srv/salt/env/{{ master.system.environment }}/_grains
- /srv/salt/env/{{ master.system.environment }}/_engines
- /srv/salt/env/{{ master.system.environment }}
- makedirs: True

@@ -329,6 +330,17 @@ salt_master_{{ environment_name }}_{{ state_name }}_state:

{%- endfor %}

{%- for engine_name, engine in formula.get('engine', {}).iteritems() %}

salt_master_{{ environment_name }}_{{ engine_name }}_state:
file.symlink:
- name: /srv/salt/env/{{ environment_name }}/_engines/{{ engine_name }}
- target: /srv/salt/env/{{ environment_name }}/_formulas/{{ formula_name }}/_engines/{{ engine_name }}
- force: True
- makedirs: True

{%- endfor %}

{%- endif %}

{%- endif %}

+ 14
- 0
salt/master/service.sls Целия файл

@@ -42,6 +42,20 @@ salt_master_packages:

{%- endif %}

{%- if master.engine is defined %}

/etc/salt/master.d/_engine.conf:
file.managed:
- source: salt://salt/files/_engine.conf
- user: root
- template: jinja
- require:
- {{ master.install_state }}
- watch_in:
- service: salt_master_service

{%- endif %}

{%- if master.peer is defined %}

/etc/salt/master.d/_peer.conf:

+ 18
- 0
salt/master/test.sls Целия файл

@@ -0,0 +1,18 @@
{%- from "salt/map.jinja" import master with context %}
{%- if master.enabled %}

salt_master_test_packages:
pkg.latest:
- names: {{ master.test_pkgs }}

/etc/salt/roster:
file.managed:
- source: salt://salt/files/roster
- user: root
- template: jinja
- require:
- {{ master.install_state }}
- watch_in:
- service: salt_master_service

{%- endif %}

Loading…
Отказ
Запис