DEBOPS.MINIDLNA(5)

NAME
debops.minidlna - Manage DLNA with Ansible

SYNOPSIS

debops run service/minidlna [--limit group,host,...] [--diff] [--check] [--tags tag1,tag2,...] [--skip-tags tag1,tag2,...] [<ansible-playbook options>] ...

DESCRIPTION

The debops.minidlna Ansible role can be used to configure a MiniDLNA server on Debian/Ubuntu hosts.

GETTING STARTED

  Default configuration

The service will be configured to serve media files from the /var/lib/minidlna directory. You might want to include additional media directories in the configuration, see minidlna__configuration variable documentation for details and examples.

MiniDLNA uses Simple Service Discovery Protocol <https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol> to advertise its presence on the network. The service is advertised via the 239.255.255.250 multicast address over 1900/udp port and clients that want to use the DLNA service need to have this port opened in their firewalls to receive the advertisements.

Keep in mind that SSDP protocol might be used for DDoS reflection attacks if not properly secured; you should grant access to this port only from trusted networks.

  Example inventory

To enable MiniDLNA service on a host it needs to be included in the specific Ansible inventory group:

[debops_service_minidlna]
hostname

  Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.minidlna role:

---
- name: Install and manage MiniDLNA
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_minidlna' ]
  become: True
  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'
  roles:
    - role: etc_services
      tags: [ 'role::etc_services', 'skip::etc_services' ]
      etc_services__dependent_list:
        - '{{ minidlna_server__etc_services__dependent_list }}'
    - role: ferm
      tags: [ 'role::ferm', 'skip::ferm' ]
      ferm__dependent_rules:
        - '{{ minidlna__ferm__dependent_rules }}'
    - role: minidlna
      tags: [ 'role::minidlna', 'skip::minidlna' ]

DEFAULT VARIABLE DETAILS

Some of debops.minidlna default variables have more extensive configuration than simple strings or lists, here you can find documentation and examples for them.

  minidlna__configuration

The minidlna__*_configuration variables define the contents of the /etc/minidlna.conf configuration file. The variables are combined in order defined in the minidlna__combined_configuration variable and can affect each other.

  Examples

Define a set of media dirs to be scanned by MiniDLNA service:

minidlna__configuration:
  # Reset the default option to not include the '/var/lib/minidlna'
  # directory (optional)
  - media_dir: ''
  # Define a new set of media directories separated by type
  - name: 'media_dir'
    value:
      - 'A,/home/user/Music'
      - 'P,/home/user/Pictures'
      - 'V,/home/user/Videos'

You can see more examples in the default set of configuration options defined by the role.

  Syntax

The configuration is defined as a list of YAML dictionaries, using the Universal Configuration format. The configuration entries can be specified as simple "key: value" dictionaries, or if the name parameter is used, can be defined using specific parameters:

name
    Required. The name of the configuration option. See minidlna.conf(5) <https://manpages.debian.org/minidlna.conf(5)> to see more details about MiniDLNA configuration file and available options. Multiple entries with the same name parameter are merged together in order of appearance and can affect each other.

value
    The value of a given configuration option. It can be a string, a number, a boolean value or a YAML list of strings - this is used to specify selected configuration options more than once. Empty strings and lists are allowed. Lists in multiple configuration entries with the same name parameter are merged together; to "reset" a list, specify a configuration entry with an empty string.

state
    Optional. If not specified or present, a given configuration option will be included in the generated config file. If absent, a given configuration option will not be included in the file. If comment, the option will be included, but commented out. If ignore, a given configuration entry will not be processed during role execution.

comment
    Optional. A comment about a given configuration option.

AUTHOR
Julien Lecomte

COPYRIGHT
2014-2024, Maciej Delmanowski, Nick Janetakis, Robin Schneider and others