From 12c2d1dc635a03ce798324e21f4fb13630a01d67 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 17 Apr 2022 20:27:57 +0200 Subject: [PATCH] added ytdlp state --- states/ytdlp/defaults.yaml | 4 ++++ states/ytdlp/init.sls | 11 +++++++++++ states/ytdlp/map.jinja | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 states/ytdlp/defaults.yaml create mode 100644 states/ytdlp/init.sls create mode 100644 states/ytdlp/map.jinja diff --git a/states/ytdlp/defaults.yaml b/states/ytdlp/defaults.yaml new file mode 100644 index 0000000..3e37ca7 --- /dev/null +++ b/states/ytdlp/defaults.yaml @@ -0,0 +1,4 @@ +--- +ytdlp: + install_dir: /usr/bin + version: 2022.04.08 diff --git a/states/ytdlp/init.sls b/states/ytdlp/init.sls new file mode 100644 index 0000000..7c2de59 --- /dev/null +++ b/states/ytdlp/init.sls @@ -0,0 +1,11 @@ +--- +{%- from "ytdlp/map.jinja" import ytdlp with context %} +ytdlp-bin: + file.managed: + - name: {{ ytdlp.install_dir }}/yt-dlp + - source: https://github.com/yt-dlp/yt-dlp/releases/download/{{ ytdlp.version }}/yt-dlp + - user: root + - group: root + - mode: 0775 + - template: jinja + - skip_verify: true diff --git a/states/ytdlp/map.jinja b/states/ytdlp/map.jinja new file mode 100644 index 0000000..c81f96a --- /dev/null +++ b/states/ytdlp/map.jinja @@ -0,0 +1,3 @@ +{%- import_yaml "ytdlp/defaults.yaml" as defaults %} + +{%- set ytdlp = salt['pillar.get']('ytdlp', default=defaults.ytdlp, merge=True) %} \ No newline at end of file