paulbsd-salt/states/syncthing/config_old.sls

24 lines
942 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "syncthing/map.jinja" import syncthing with context %}
{%- set configdir=salt['user.info'](syncthing.user)['home'] + '/.config/syncthing' %}
#syncthing-config-dir:
# file.directory:
# - name: {{ configdir }}
2020-09-12 17:41:35 +02:00
# - makedirs: true
2020-07-10 00:58:55 +02:00
# - watch_in:
# - service: syncthing-service
#syncthing-config-file:
# file.managed:
# - name: {{ configdir }}/config.xml
# - source: salt://syncthing/config.xml.j2
# - user: root
# - group: root
# - template: jinja
# - watch_in:
# - service: syncthing-service
{%- set config = salt['http.query'](url="http://localhost:8384/rest/system/config", header_dict={"X-API-Key":syncthing.apikey},decode=True, decode_type='json') %}
#{{ config['dict']['gui'] }}
{%- do salt['http.query'](method='POST', url="http://localhost:8384/rest/system/config", header_dict={"X-API-Key":syncthing.apikey}, decode=True, decode_type='json', data=json.dumps(syncthing.config)) %}