New version of salt-formula from Saltstack
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

proxy.sls 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {%- from "salt/map.jinja" import proxy_minion with context %}
  2. {%- set napalm = false %}
  3. {%- for proxy_name, proxy_device in proxy_minion.get('device', {}).iteritems() %}
  4. {%- if proxy_device.engine == 'napalm' %}
  5. {%- set napalm = true %}
  6. {%- endif %}
  7. {%- endfor %}
  8. /etc/systemd/system/salt-proxy@.service:
  9. file.managed:
  10. - source: salt://salt/files/salt-proxy.service
  11. - template: jinja
  12. /etc/salt/proxy:
  13. file.managed:
  14. - source: salt://salt/files/proxy.conf
  15. - template: jinja
  16. - defaults:
  17. napalm: {{ napalm }}
  18. proxy_minion: {{ proxy_minion|yaml }}
  19. {%- if napalm %}
  20. network_proxy_packages:
  21. pkg.installed:
  22. - names: {{ proxy_minion.napalm_pkgs }}
  23. napalm:
  24. pip.installed:
  25. - name: {{ proxy_minion.napalm_pip_pkgs}}
  26. - require:
  27. - pkg: python-pip
  28. {%- endif %}
  29. {%- for proxy_name, proxy_device in proxy_minion.get('device', {}).iteritems() %}
  30. salt_proxy_{{ proxy_name }}_service:
  31. service.running:
  32. - enable: true
  33. - name: salt-proxy@{{ proxy_name }}
  34. - watch:
  35. - file: /etc/salt/proxy
  36. - file: /etc/systemd/system/salt-proxy@.service
  37. {%- endfor %}