mikesager / salt_openwrt

Saltstack openwrt proxy minion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

salt_openwrt

Saltstack openwrt proxy minion

Only works when multiprocessing is set in /etc/salt/proxy as follow:

multiprocessing: False

Example

Pillar config

---

proxy:
  proxytype: openwrt
  host: a.b.c.d
  username: root
  password: SuperPassword!

openwrt_config:
  config:
    system.ntp.server: 10.33.0.1

Password should be encrypted with GPG salt-master public key for security reasons

Sample SLS state

---

{% set openwrt_config = salt['pillar.get']('openwrt_config', default={}) %}

{% for c in openwrt_config.config|default({}) %}
openwrt-config-{{loop.index}}:
  openwrt.config_set:
    - name: {{c}}
    - value: {{openwrt_config.config[c]}}
    - watch_in:
        - openwrt-reload
{% endfor %}

openwrt-reload:
  module.wait:
    - name: openwrt.config_reload

About

Saltstack openwrt proxy minion


Languages

Language:Python 100.0%