Vendor Galaxy Roles and Collections
Some checks failed
/ Ansible Lint (push) Failing after 5m45s
/ Ansible Lint (pull_request) Failing after 4m59s

This commit is contained in:
Stefan Bethke 2026-02-06 22:07:16 +01:00
commit 2aed20393f
3553 changed files with 387444 additions and 2 deletions

View file

@ -0,0 +1,19 @@
kodi - Setup and manage Kodi
Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
Copyright (C) 2017 DebOps <https://debops.org/>
SPDX-License-Identifier: GPL-3.0-only
This Ansible role is part of DebOps.
DebOps is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3, as
published by the Free Software Foundation.
DebOps is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DebOps. If not, see https://www.gnu.org/licenses/.

View file

@ -0,0 +1,132 @@
---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
# .. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
# .. Copyright (C) 2017 DebOps <https://debops.org/>
# .. SPDX-License-Identifier: GPL-3.0-only
# .. _kodi__ref_defaults:
# debops-contrib.kodi default variables [[[
# ==========================================
# .. contents:: Sections
# :local:
#
# .. include:: includes/all.rst
# Packages and installation [[[
# -----------------------------
# .. envvar:: kodi__base_packages [[[
#
# List of base packages to install.
# Suggested packages:
# libasound2-plugins alsa-utils libbluray-bdj firmware-crystalhd libfftw3-bin libfftw3-dev alsa-base glew-utils opus-tools pulseaudio speex
# Recommended packages:
# kodi-visualization-spectrum libcec4 libmodplug1 libnfs8 libplist3 udisks2 libaacs0 libgl1-mesa-dri javascript-common va-driver-all | va-driver vdpau-driver-all | vdpau-driver
kodi__base_packages:
- 'kodi'
- 'xorg'
- 'xserver-xorg'
- 'dbus-x11'
- 'xinit'
## https://askubuntu.com/questions/761893/xserver-permission-denied-tty7/806459#806459
- 'xserver-xorg-legacy'
- 'python-dbus'
- 'python3-dbus'
## dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
- 'accountsservice'
- 'pulseaudio'
- 'libasound2-plugins'
- 'alsa-utils'
- 'libfftw3-bin'
- 'libfftw3-dev'
- 'glew-utils'
- 'opus-tools'
- 'speex'
## https://kodi.wiki/view/HOW-TO:Suspend_and_wake_in_Ubuntu#Enabling_Suspend_.2F_Wake_.2F_Shutdown_.2F_Power_off_on_Ubuntu_Linux
# - 'upower'
# - 'acpi-support'
- '{{ ["policykit-1"]
if (kodi__polkit_action | d())
else [] }}'
# ]]]
# .. envvar:: kodi__deploy_state [[[
#
# What is the desired state which this role should achieve? Possible options:
#
# ``present``
# Default. Ensure that `changeme/FIXME** is installed and configured as requested.
#
# ``absent``
# Ensure that `changeme/FIXME** is uninstalled and it's configuration is removed.
#
kodi__deploy_state: 'present'
# ]]]
# ]]]
# System user and group [[[
# -------------------------
# .. envvar:: kodi__user [[[
#
# System UNIX account used by the Kodi.
kodi__user: 'kodi'
# ]]]
# .. envvar:: kodi__group [[[
#
# System UNIX group used by Kodi.
kodi__group: 'kodi'
# ]]]
# .. envvar:: kodi__groups [[[
#
# List of additional system groups of the system UNIX account.
kodi__groups:
- 'cdrom'
- 'floppy'
- 'audio'
- 'video'
- 'plugdev'
# ]]]
# .. envvar:: kodi__home_path [[[
#
# The Home Assistant system account home directory.
kodi__home_path: '{{ (ansible_local.fhs.home | d("/var/local"))
+ "/" + kodi__user }}'
# ]]]
# .. envvar:: kodi__gecos [[[
#
# Contents of the GECOS field set for the Kodi account.
kodi__gecos: 'kodi.org'
# ]]]
# .. envvar:: kodi__shell [[[
#
# The default shell set on the Kodi account.
kodi__shell: '/usr/sbin/nologin'
# ]]]
# ]]]
# Kodi permissions [[[
# --------------------
# .. envvar:: kodi__group [[[
#
# What Polkit actions to allow to the Kodi. Set to ``False`` to not grant any
# Polkit permissions.
#
# https://kodi.wiki/view/HOW-TO:Suspend_and_wake_in_Ubuntu#Enabling_Suspend_.2F_Wake_.2F_Shutdown_.2F_Power_off_on_Ubuntu_Linux
kodi__polkit_action: 'org.freedesktop.login1.*'
# ]]]
# ]]]
# ]]]

View file

@ -0,0 +1,5 @@
.. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
.. Copyright (C) 2017 DebOps <https://debops.org/>
.. SPDX-License-Identifier: GPL-3.0-only
.. include:: ../CHANGES.rst

View file

@ -0,0 +1,8 @@
.. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
.. Copyright (C) 2017 DebOps <https://debops.org/>
.. SPDX-License-Identifier: GPL-3.0-only
Copyright
=========
.. literalinclude:: ../COPYRIGHT

View file

@ -0,0 +1,67 @@
.. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
.. Copyright (C) 2017 DebOps <https://debops.org/>
.. SPDX-License-Identifier: GPL-3.0-only
.. _kodi__ref_getting_started:
Getting started
===============
.. include:: includes/all.rst
.. contents::
:local:
Example inventory
-----------------
To manage `changeme/FIXME** on a given host or set of hosts, they need to
be added to the ``[debops_service_kodi]`` Ansible group in the inventory:
.. code:: ini
[debops_service_kodi]
hostname
Window manager support
----------------------
.. code-block:: none
[ypid_service_dm]
hostname
Example playbook
----------------
If you are using this role without DebOps, here's an example Ansible playbook
that uses the ``debops-contrib.kodi`` role:
.. literalinclude:: playbooks/kodi.yml
:language: yaml
:lines: 1,5-
The playbook is shipped with this role under
:file:`./docs/playbooks/kodi.yml` from which you can symlink it to your
playbook directory.
In case you use multiple `DebOps Contrib`_ roles, consider using the
`DebOps Contrib playbooks`_.
Ansible tags
------------
You can use Ansible ``--tags`` or ``--skip-tags`` parameters to limit what
tasks are performed during Ansible run. This can be used after a host was first
configured to speed up playbook execution, when you are sure that most of the
configuration is already in the desired state.
Available role tags:
``role::kodi``
Main role tag, should be used in the playbook to execute all of the role
tasks as well as role dependencies.
``role::kodi:pkgs``
Tasks related to system package management like installing or
removing packages.

View file

@ -0,0 +1,6 @@
.. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
.. Copyright (C) 2017 DebOps <https://debops.org/>
.. SPDX-License-Identifier: GPL-3.0-only
.. include:: includes/global.rst
.. include:: includes/role.rst

View file

@ -0,0 +1,5 @@
.. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
.. Copyright (C) 2017 DebOps <https://debops.org/>
.. SPDX-License-Identifier: GPL-3.0-only
.. _Kodi: https://en.wikipedia.org/wiki/Kodi_%28software%29

View file

@ -0,0 +1,23 @@
.. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
.. Copyright (C) 2017 DebOps <https://debops.org/>
.. SPDX-License-Identifier: GPL-3.0-only
.. _debops-contrib.kodi:
Ansible role: debops-contrib.kodi
===============================
.. toctree::
:maxdepth: 2
introduction
getting-started
defaults
copyright
changelog
..
Local Variables:
mode: rst
ispell-local-dictionary: "american"
End:

View file

@ -0,0 +1,26 @@
.. Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
.. Copyright (C) 2017 DebOps <https://debops.org/>
.. SPDX-License-Identifier: GPL-3.0-only
Introduction
============
.. include:: includes/all.rst
The ``debops-contrib.kodi`` role allows you to setup and manage the Kodi_ media center software.
Installation
~~~~~~~~~~~~
This role requires at least Ansible ``v2.1.5``. To install it, run:
.. code-block:: console
ansible-galaxy install debops-contrib.kodi
..
Local Variables:
mode: rst
ispell-local-dictionary: "american"
End:

View file

@ -0,0 +1,32 @@
---
# Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
# Copyright (C) 2017 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# Ensure that custom Ansible plugins and modules included in the main DebOps
# collection are available to roles in other collections.
collections: [ 'debops.debops' ]
dependencies: []
galaxy_info:
company: 'DebOps'
author: 'Robin Schneider'
description: 'Setup and manage Kodi'
license: 'GPL-3.0-only'
min_ansible_version: '2.1.5'
platforms:
- name: Debian
versions:
- buster
galaxy_tags:
- kodi
- home
- htpc
- mediacenter
- media
- player

View file

@ -0,0 +1,49 @@
---
# Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
# Copyright (C) 2017 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# http://kodi.wiki/view/HOW-TO:Autostart_Kodi_for_Linux
- name: Ensure specified packages are in there desired state
ansible.builtin.package:
name: '{{ q("flattened", kodi__base_packages) }}'
state: '{{ "present" if (kodi__deploy_state == "present") else "absent" }}'
register: kodi__register_packages
until: kodi__register_packages is succeeded
tags: [ 'role::kodi:pkgs' ]
# System user and group [[[
- name: Create Kodi system group
ansible.builtin.group:
name: '{{ kodi__group }}'
state: '{{ "present" if (kodi__deploy_state == "present") else "absent" }}'
system: True
- name: Create Kodi system user
ansible.builtin.user:
name: '{{ kodi__user }}'
group: '{{ kodi__group }}'
groups: '{{ kodi__groups | join(",") | default(omit) }}'
append: False
home: '{{ kodi__home_path }}'
comment: '{{ kodi__gecos }}'
shell: '{{ kodi__shell }}'
state: '{{ "present" if (kodi__deploy_state == "present") else "absent" }}'
system: True
# ]]]
- name: Create polkit configuration
ansible.builtin.template:
src: 'etc/polkit-1/localauthority/50-local.d/kodi-actions.pkla.j2'
dest: '/etc/polkit-1/localauthority/50-local.d/kodi-actions.pkla'
owner: 'root'
group: 'root'
mode: '0644'
when: kodi__polkit_action | d()
- name: Remove polkit configuration
ansible.builtin.file:
path: '/etc/polkit-1/localauthority/50-local.d/kodi-actions.pkla'
state: 'absent'
when: not kodi__polkit_action | d()

View file

@ -0,0 +1,12 @@
{# Copyright (C) 2017 Robin Schneider <ypid@riseup.net>
# Copyright (C) 2017 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
#}
# {{ ansible_managed }}
[Actions for kodi user]
Identity=unix-user:{{ kodi__user }}
Action={{ kodi__polkit_action }}
ResultAny=yes
ResultInactive=yes
ResultActive=yes