From 43df79ed21379e8f2f795ab3a5ae4b9b74346779 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 8 Jun 2020 23:11:22 -0400 Subject: allow watching twitch via partofme --- manifests/partofme.pp | 1 + modules/base/manifests/users.pp | 2 +- modules/partofme/files/twitch | 3 +++ modules/partofme/manifests/twitch.pp | 10 ++++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 modules/partofme/files/twitch create mode 100644 modules/partofme/manifests/twitch.pp diff --git a/manifests/partofme.pp b/manifests/partofme.pp index a8056f1..a86df6a 100644 --- a/manifests/partofme.pp +++ b/manifests/partofme.pp @@ -14,4 +14,5 @@ node 'partofme', 'partofme.localdomain' { include partofme::mdadm include partofme::monitoring include partofme::persistent + include partofme::twitch } diff --git a/modules/base/manifests/users.pp b/modules/base/manifests/users.pp index 964c02e..b6df04d 100644 --- a/modules/base/manifests/users.pp +++ b/modules/base/manifests/users.pp @@ -5,7 +5,7 @@ class base::users { base::user { $::default_user: pwhash => secret::value("passwd/$default_user"), - extra_groups => ['wheel'], + extra_groups => ['wheel', 'video', 'audio'], homedir_mode => '0701'; } diff --git a/modules/partofme/files/twitch b/modules/partofme/files/twitch new file mode 100644 index 0000000..c28b80b --- /dev/null +++ b/modules/partofme/files/twitch @@ -0,0 +1,3 @@ +#!/bin/sh + +streamlink -p "cvlc -A alsa --alsa-audio-device hdmi:CARD=PCH,DEV=2 -V fb --no-fb-tty" twitch.tv/"${1}" best diff --git a/modules/partofme/manifests/twitch.pp b/modules/partofme/manifests/twitch.pp new file mode 100644 index 0000000..13bd824 --- /dev/null +++ b/modules/partofme/manifests/twitch.pp @@ -0,0 +1,10 @@ +class partofme::twitch { + package { ["streamlink", "vlc"]: + ensure => installed; + } + + file { "/usr/local/bin/twitch": + mode => "0755", + source => 'puppet:///modules/partofme/twitch'; + } +} -- cgit v1.2.3-54-g00ecf