igsol / mpd_rpi

Ansible role for installation and tuning MPD on Raspberry Pi 2 + HiFiberry DAC+.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MPD on Raspberry Pi

The role and playbook are intended for:

  • Installation MPD on Raspberry Pi 2.
  • Setup HiFiberry DAC+ on brand new Raspbian installation.
  • Tuning MPD for bit perfect output.
  • Setup MPD to consume audio data from SMB share.
  • Original Raspbian installation is "minimized", i.e. redundant packages are deleted (e.g. xserver-xorg, etc.).

Requirements

  1. Ansible itself.
  2. Well, Ansible works perfectly on the Linux, so Linux control host is required as well 😄
  3. Running Raspberry Pi 2 machine with brand new Raspbian installed.
  4. Ansible inventory file with your Raspberry Pi 2 machine.
  5. SMB server with shared audio files for all users (i.e. without password).

Role Variables

These variables are all situated in the vars/main.yml and have to be adjusted by you.

Name Type Description
mpdrpi_media_share_name string The full path top SMB share (example: //nas/media)
mpdrpi_music_directory string It represents the audio files directory relative to the mounted SMB share (example: audio/).

Inventory

The inventory file file has to contain mpd_hosts group, which is used in the role. You have to add your Raspberry Pi host name into this group. Example of inventory file:

[mpd_hosts]
my_rpi_for_mpd

Dependencies

RPI Mini role is used to reduce bloating of intact Raspbian installation.

Example Playbook

- hosts:
    - mpd_hosts
  roles:
    - rpi_mini
    - mpd_rpi

Usage examples

  1. It's a good practice to reset default SSH host keys. It's useful to apply once only. Note the "rpimini_ssh_reset=true" usage.

     ansible-playbook -i hosts mpd_rpi.yml -u root --tags=ssh_reset --extra-vars "rpimini_ssh_reset=true" 
    
  2. To make all role tasks except SSH host keys resetting run following command.

     ansible-playbook -i hosts mpd_rpi.yml -u root 
    
  3. If the MPD configuration (i.e. mpd.conf.j2) was changed, it can be deployed by following command. Note the "--tags=mpd" usage. Other tasks are not executed.

     ansible-playbook -i hosts mpd_rpi.yml -u root --tags=mpd
    

Notes

After first complete (i.e. without any applied tags) role execution the Raspberry Pi host should be restarted. It's necessary to load all modules required by HiFiberry DAC+.

License

GPLv3

References

About

Ansible role for installation and tuning MPD on Raspberry Pi 2 + HiFiberry DAC+.

License:GNU General Public License v3.0