Ansible repo for digital ocean projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 regels
1.5 KiB

  1. - hosts: all
  2. gather_facts: false
  3. vars:
  4. #we need to loop over the /var/lib/mpd{{ count }} directory for the files/folders below. we need to loop over the stream ports as well
  5. count: 5
  6. path: /var/lib
  7. mpd: mpd
  8. service_name: "{{ mpd + item }}"
  9. playlist_directory: "{{ '%s/%s/playlist/' % (path, service_name) }}"
  10. db_file: tag_cache
  11. log_file: mpd.log
  12. pid_file: pid
  13. state_file: state
  14. sticker_file: sticker.sql
  15. user: mpd
  16. group: nogroup
  17. bind_to_address: any
  18. bind_address: any
  19. port_start: 6600
  20. port: "{{ port_start + item }}"
  21. log_level:
  22. gapless_mp3_playback: yes
  23. save_absolute_paths_in_playlists: yes
  24. metadata_to_use: artist,album,title,track,name,genre,date,composer,performer,disc
  25. auto_update: no
  26. auto_update_depth: 3
  27. follow_outside_symlinks: no
  28. follow_inside_symlinks: no
  29. zeroconf_enabled: no
  30. zeroconf_name: mpd
  31. default_permissions: red,add,control,admin
  32. stream: music
  33. stream_port: 6700
  34. stream_bind_address: any
  35. mixer_type: disabled
  36. replaygain: album
  37. replaygain_preamp: 0
  38. volume_normalization: no
  39. audio_buffer_size: 2048
  40. buffer_before_play: 1%
  41. tasks:
  42. - name: Install mpdf on hosts
  43. apt:
  44. name: mpd
  45. state: present
  46. - name: setup config on hosts
  47. template:
  48. src: mpdf.conf.j2
  49. dest: /etc/mpdf{{ item }}.conf
  50. mode: 0644
  51. owner: root
  52. group: root
  53. notify:
  54. - restart mpd
  55. loop: "{{ range(1,count|int + 1) }}"