Procházet zdrojové kódy

Merge pull request #312 from netmanagers/master

Allow to specify reactors separatedly for master and minions
tags/v0.57.0
Niels Abspoel před 7 roky
rodič
revize
83433c8dd8
5 změnil soubory, kde provedl 31 přidání a 7 odebrání
  1. +19
    -3
      pillar.example
  2. +1
    -1
      salt/files/master.d/f_defaults.conf
  3. +5
    -1
      salt/files/master.d/reactor.conf
  4. +1
    -1
      salt/files/minion.d/f_defaults.conf
  5. +5
    -1
      salt/files/minion.d/reactor.conf

+ 19
- 3
pillar.example Zobrazit soubor

type: runner type: runner
cmd: jobs.list_jobs cmd: jobs.list_jobs


# optional: these reactors will be configured on the master
# They override reactors configured in
# 'salt:reactors' or the old 'salt:reactor' parameters
reactors:
- 'master/deploy':
- /srv/salt/reactors/deploy.sls

# salt minion config: # salt minion config:
minion: minion:


- 1.0 - 1.0
interval: 10 interval: 10


# Optional reactors: these reactors will be configured on the minion
# They override reactors configured in
# 'salt:reactors' or the old 'salt:reactor' parameters
reactors:
- 'minion/deploy':
- /srv/salt/reactors/deploy.sls


# salt cloud config # salt cloud config
cloud: cloud:
- IAD - IAD
- SYD - SYD
- HKG - HKG
reactor:
- 'deploy':
- /srv/salt/reactors/deploy.sls

ssh_roster: ssh_roster:
prod1: prod1:
host: host.example.com host: host.example.com
pub: | pub: |
........... ...........


# These reactors will be configured both in the minion and the master
reactors:
- 'deploy':
- /srv/salt/reactors/deploy.sls

salt_cloud_certs: salt_cloud_certs:
aws: aws:
pem: | pem: |

+ 1
- 1
salt/files/master.d/f_defaults.conf Zobrazit soubor

# This file managed by Salt, do not edit by hand!! # This file managed by Salt, do not edit by hand!!
# Based on salt version 2016.11 default config # Based on salt version 2016.11 default config
{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs', 'engines', 'lxc.network_profile', 'lxc.container_profile'] -%}
{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs', 'engines', 'lxc.network_profile', 'lxc.container_profile', 'reactors'] -%}
{% set cfg_salt = pillar.get('salt', {}) -%} {% set cfg_salt = pillar.get('salt', {}) -%}
{% set cfg_master = cfg_salt.get('master', {}) -%} {% set cfg_master = cfg_salt.get('master', {}) -%}
{% set default_keys = [] -%} {% set default_keys = [] -%}

+ 5
- 1
salt/files/master.d/reactor.conf Zobrazit soubor

# #
# This file is managed by Salt! Do not edit by hand! # This file is managed by Salt! Do not edit by hand!
# #
{%- set reactors = salt['pillar.get']('salt:reactor') -%}
{# The parameter reactor is kept for backward compatibility -#}
{%- set reactors = salt['pillar.get']('salt:reactor', []) -%}
{%- set reactors = salt['pillar.get']('salt:reactors', default=reactors, merge=True) -%}
{%- set reactors = salt['pillar.get']('salt:master:reactors', default=reactors, merge=True) -%}

{%- if reactors %} {%- if reactors %}
reactor: reactor:
{%- for reactor in reactors %} {%- for reactor in reactors %}

+ 1
- 1
salt/files/minion.d/f_defaults.conf Zobrazit soubor

# This file managed by Salt, do not edit by hand!! # This file managed by Salt, do not edit by hand!!
# Based on salt version 2016.11 default config # Based on salt version 2016.11 default config
# #
{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs', 'engines', 'beacons'] -%}
{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs', 'engines', 'beacons', 'reactors'] -%}
{% set cfg_salt = pillar.get('salt', {}) -%} {% set cfg_salt = pillar.get('salt', {}) -%}
{% set cfg_minion = cfg_salt.get('minion', {}) -%} {% set cfg_minion = cfg_salt.get('minion', {}) -%}
{% set default_keys = [] -%} {% set default_keys = [] -%}

+ 5
- 1
salt/files/minion.d/reactor.conf Zobrazit soubor

# #
# This file is managed by Salt! Do not edit by hand! # This file is managed by Salt! Do not edit by hand!
# #
{%- set reactors = salt['pillar.get']('salt:reactor') -%}
{# The parameter reactor is kept for backward compatibility -#}
{%- set reactors = salt['pillar.get']('salt:reactor', []) -%}
{%- set reactors = salt['pillar.get']('salt:reactors', default=reactors, merge=True) -%}
{%- set reactors = salt['pillar.get']('salt:minion:reactors', default=reactors, merge=True) -%}

{%- if reactors %} {%- if reactors %}
reactor: reactor:
{%- for reactor in reactors %} {%- for reactor in reactors %}

Načítá se…
Zrušit
Uložit