Browse Source

proxy_minion fix

Change-Id: I73a4a14734651f6483fae169a2290e9c5b377d76
soa
Jiri Broulik 7 years ago
parent
commit
8827524529
4 changed files with 8 additions and 8 deletions
  1. +1
    -1
      README.rst
  2. +3
    -3
      salt/map.jinja
  3. +3
    -3
      salt/minion/proxy.sls
  4. +1
    -1
      tests/pillar/minion_proxy.sls

+ 1
- 1
README.rst View File



salt: salt:
minion: minion:
proxy:
proxy_minion:
master: localhost master: localhost
device: device:
vsrx01.mydomain.local: vsrx01.mydomain.local:

+ 3
- 3
salt/map.jinja View File

{%- set raw_minion = salt['grains.filter_by'](minion_specific, merge=salt['pillar.get']('salt:minion')) %} {%- set raw_minion = salt['grains.filter_by'](minion_specific, merge=salt['pillar.get']('salt:minion')) %}
{%- set minion = salt['grains.filter_by'](minion_common, merge=raw_minion) %} {%- set minion = salt['grains.filter_by'](minion_common, merge=raw_minion) %}


{%- if pillar.salt.minion.proxy is defined %}
{% set proxy = salt['grains.filter_by']({
{%- if pillar.salt.minion.proxy_minion is defined %}
{% set proxy_minion = salt['grains.filter_by']({
'Debian': { 'Debian': {
'napalm_pkgs': ['python-pip', 'libxml2-dev', 'libxslt1-dev', 'zlib1g-dev'], 'napalm_pkgs': ['python-pip', 'libxml2-dev', 'libxslt1-dev', 'zlib1g-dev'],
'napalm_pip_pkgs': ['napalm', 'oauth'] 'napalm_pip_pkgs': ['napalm', 'oauth']
'RedHat': { 'RedHat': {
'napalm_pkgs': ['libxml2-dev', 'libxslt1-dev', 'zlib1g-dev'] 'napalm_pkgs': ['libxml2-dev', 'libxslt1-dev', 'zlib1g-dev']
}, },
}, merge=pillar.salt.minion.get('proxy', {})) %}
}, merge=pillar.salt.minion.get('proxy_minion', {})) %}
{%- endif %} {%- endif %}


{%- endif %} {%- endif %}

+ 3
- 3
salt/minion/proxy.sls View File

{%- from "salt/map.jinja" import proxy with context %}
{%- from "salt/map.jinja" import proxy_minion with context %}


{%- set napalm = false %} {%- set napalm = false %}


{%- for proxy_name, proxy_device in proxy.get('device', {}).iteritems() %}
{%- for proxy_name, proxy_device in proxy_minion.get('device', {}).iteritems() %}


{%- if proxy_device.engine == 'napalm' %} {%- if proxy_device.engine == 'napalm' %}




{%- endif %} {%- endif %}


{%- for proxy_name, proxy_device in proxy.get('device', {}).iteritems() %}
{%- for proxy_name, proxy_device in proxy_minion.get('device', {}).iteritems() %}


salt_proxy_{{ proxy_name }}_service: salt_proxy_{{ proxy_name }}_service:
service.running: service.running:

+ 1
- 1
tests/pillar/minion_proxy.sls View File

salt: salt:
minion: minion:
enabled: true enabled: true
proxy:
proxy_minion:
master: localhost master: localhost
device: device:
vsrx01.mydomain.local: vsrx01.mydomain.local:

Loading…
Cancel
Save