From 835cffb430719f04a403d528f058073fe1673682 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Mon, 16 Jan 2023 12:01:24 +0100 Subject: [PATCH] updated transmission state --- states/transmission/defaults.yaml | 1 + states/transmission/service.sls | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/states/transmission/defaults.yaml b/states/transmission/defaults.yaml index 0fb7ff8..b44ce18 100644 --- a/states/transmission/defaults.yaml +++ b/states/transmission/defaults.yaml @@ -1,5 +1,6 @@ --- transmission: + url: https://torrent.example.com config: alt-speed-down: 50 alt-speed-enabled: false diff --git a/states/transmission/service.sls b/states/transmission/service.sls index da7f805..c1a20ef 100644 --- a/states/transmission/service.sls +++ b/states/transmission/service.sls @@ -1,5 +1,13 @@ --- +{%- from "transmission/map.jinja" import transmission with context %} + +{%- if salt['http.query'](transmission.url)['status'] == 503 %} +transmission-service-stop: + service.dead: + - name: transmission-daemon +{%- endif %} + transmission-service: service.running: - name: transmission-daemon - - enable: true \ No newline at end of file + - enable: true