Added basic package install and service running checks
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2023-12-12 13:21:14 -05:00
parent dc230e5449
commit 53c160d56a
7 changed files with 76 additions and 0 deletions

8
jellyfin/defaults.yaml Normal file
View File

@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
jellyfin:
pkg_name: 'jellyfin'
service_name: 'jellyfin'
service_enabled: True

4
jellyfin/init.sls Normal file
View File

@ -0,0 +1,4 @@
include:
- .package
- .service

28
jellyfin/map.jinja Normal file
View File

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja
{%- set tplroot = tpldir.split('/')[0] %}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{#- Retrieve the config dict only once #}
{%- set _config = salt['config.get'](tplroot, default={}) %}
{%- set defaults = salt['grains.filter_by'](
default_settings,
default=tplroot,
merge=salt['grains.filter_by'](
_config,
default='lookup'
)
)
%}
{%- set config = salt['grains.filter_by'](
{'defaults': defaults},
default='defaults',
merge=_config
)
%}
{%- set jellyfin = config %}

View File

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
include:
- .install

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import jellyfin with context %}
jellyfin_pkg_install:
pkg.installed:
- name: {{ jellyfin.pkg_name }}

View File

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
include:
- .running

View File

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- from tplroot ~ "/map.jinja" import jellyfin with context %}
include:
- {{ sls_config_file }}
jellyfin_service:
service.running:
- name: {{ jellyfin.service_name }}
- enable: {{ jellyfin.service_enabled }}