kso512.mpd

mpd

Release GitHub issues GitHub repo size

made-with-bash made-with-Markdown GitHub

This is an Ansible Role designed to install the Music Player Daemon application by compiling it from the source instead of using a package manager. Some package managers might not have features like MP3 support, so building from the source could be beneficial.

This role is a complete rewrite of the previous ansible-install-mpd role I developed and maintained for many years, brought on by updates in CI/CD practices and new naming conventions in Ansible Galaxy.

I do not recommend using the default configuration if you are connecting directly to the Internet without protection, as it allows access without a password. To enhance security, you should set up a custom configuration file from outside the repository to replace mpd_conf_src, as detailed in the Example Playbook section below.

All tasks are labeled with mpd.

The following distributions were tested automatically:

Version Overview

Role Version/Tag MPD Version
1.0.19 0.23.15
1.0.18 0.23.14
1.0.16 - 1.0.17 0.23.13
1.0.14 - 1.0.15 0.23.12
1.0.13 0.23.11

Requirements

If the server has a firewall, you might need to adjust it to allow incoming traffic on TCP ports 6600/8000. This role does not include any music or playlists, so you will need to provide those yourself. Check the Role Variables section below for location details.

Role Variables

The default settings provided below should work without modification. You only need to change them if they don't suit your requirements.

Name Description Default Value
mpd_apt_prereqs List of APT packages to install (See NOTE A below)
mpd_audio_output Audio output settings (See NOTE B below)
mpd_bind_to_address Address for the control interface; e.g., "any" or "localhost" "any"
mpd_comment Comment for the MPD user "Music Player Daemon"
mpd_compile_creates Full path of the file created during MPD compilation "{{ mpd_src }}/output/release/mpd"
mpd_conf Full path of the MPD configuration file "{{ mpd_home }}/mpd.conf"
mpd_conf_mode File permissions for the MPD configuration file "0644"
mpd_conf_src Path to the source of the MPD configuration file mpd.conf.j2
mpd_configure_creates Full path of the file created during MPD configuration "{{ mpd_src }}/output/release/build.ninja"
mpd_database_plugin Type of database plugin to use; see Database plugins for options. "simple"
mpd_database_path Full path to the MPD database file "{{ mpd_home }}/tag_cache"
mpd_database_cache_directory Path of the cache directory "{{ mpd_home }}/cache"
mpd_executable Full path to the MPD executable "/usr/local/bin/mpd"
mpd_filename Name of the MPD archive file "{{ mpd_shortname }}.tar.xz"
mpd_group Owner group of the daemon process "{{ mpd_user }}"
mpd_home Main directory for the application "/home/{{ mpd_user }}"
mpd_log_file Full path to the MPD log file "{{ mpd_home }}/log"
mpd_metadata_to_use Specify tags to include; see Tags for supported tags "AlbumArtist,Artist,Album,Title,Track,Disc,Genre,Name"
mpd_mode File permissions for MPD source, music, and playlist folders "0755"
mpd_music_directory Directory for storing music "{{ mpd_home }}/music"
mpd_neighbors List of neighbor plugins to enable (See NOTE C below)
mpd_pid_file Full path to the MPD PID file "{{ mpd_home }}/pid"
mpd_pip_prereqs List of PIP packages to install "meson>0.56.0"
mpd_playlist_directory Directory for storing playlists "{{ mpd_home }}/playlist"
mpd_port TCP port for the control interface "6600"
mpd_ratings_file Full path to the MPD ratings file "{{ mpd_home }}/ratings.db"
mpd_shortname Short name of the MPD archive "mpd-0.23.15"
mpd_src Directory to extract the source code "{{ mpd_src_base }}/{{ mpd_shortname }}"
mpd_src_base Directory for the source code archive "{{ mpd_home }}/src"
mpd_state_file Full path to the MPD state file "{{ mpd_home }}/state"
mpd_sticker_file Full path to the MPD sticker file "{{ mpd_home }}/sticker.sql"
mpd_systemd_service_dest Full path to the MPD systemd service file "/etc/systemd/system/mpd.service"
mpd_systemd_service_group User group for the systemd unit file "root"
mpd_systemd_service_owner User for the systemd unit file "root"
mpd_systemd_service_mode Permissions for the systemd unit file "0644"
mpd_systemd_service_src Path to the MPD systemd service file source "systemd.mpd.service.j2"
mpd_url URL for downloading the source archive "{{ mpd_url_base }}/{{ mpd_filename }}"
mpd_url_base Base URL for downloading the source archive "http://www.musicpd.org/download/mpd/0.23"
mpd_user User that owns the daemon process "mpd"

NOTE A

mpd_apt_prereqs - List of APT packages to install:

  • meson
  • g++
  • libfmt-dev
  • libpcre2-dev
  • libmad0-dev
  • libmpg123-dev
  • libid3tag0-dev
  • libflac-dev
  • libvorbis-dev
  • libopus-dev
  • libogg-dev
  • libadplug-dev
  • libaudiofile-dev
  • libsndfile1-dev
  • libfaad-dev
  • libfluidsynth-dev
  • libgme-dev
  • libmikmod-dev
  • libmodplug-dev
  • libmpcdec-dev
  • libwavpack-dev
  • libwildmidi-dev
  • libsidplay2-dev
  • libsidutils-dev
  • libresid-builder-dev
  • libavcodec-dev
  • libavformat-dev
  • libmp3lame-dev
  • libtwolame-dev
  • libshine-dev
  • libsamplerate0-dev
  • libsoxr-dev
  • libbz2-dev
  • libcdio-paranoia-dev
  • libiso9660-dev
  • libmms-dev
  • libzzip-dev
  • libcurl4-gnutls-dev
  • libyajl-dev
  • libexpat-dev
  • libasound2-dev
  • libao-dev
  • libjack-jackd2-dev
  • libopenal-dev
  • libpulse-dev
  • libshout3-dev
  • libsndio-dev
  • libmpdclient-dev
  • libnfs-dev
  • libupnp-dev
  • libavahi-client-dev
  • libsqlite3-dev
  • libsystemd-dev
  • libgtest-dev
  • libboost-dev
  • libicu-dev
  • libchromaprint-dev
  • libgcrypt20-dev

NOTE B

mpd_audio_output - Audio output settings example:

httpd:
  type: httpd
  name: My HTTP Stream
  encoder: lame
  port: 8000
  bitrate: 128
  format: "44100:16:2"
  always_on: "yes"
  tags: "yes"

NOTE C

mpd_neighbors - List of neighbor plugins to enable; refer to Configuring Neighbor Plugins for details.

  • udisks
  • upnp

Dependencies

None specified.

Example Playbook

Set up each MPD server with a customized local mpd.conf:

- hosts: music-servers
  roles:
    - { role: kso512.mpd, mpd_conf_src: local/mpd.conf.j2 }

License

GNU General Public License version 2

Author Information

@kso512

Informazioni sul progetto

Ansible role to install Music Player Daemon from source

Installa
ansible-galaxy install kso512.mpd
Licenza
gpl-2.0
Download
218
Proprietario