Ansible repo for digital ocean projects
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

mpdb.yaml 2.3 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. - hosts: mpdb
  2. gather_facts: true
  3. vars:
  4. path: /var/lib/mpd
  5. playlist_directory: /playlists/
  6. db_file: tag_cache
  7. log_dir: /var/log/
  8. log_file: mpd.log
  9. pid_file: pid
  10. state_file: state
  11. sticker_file: sticker
  12. user: root
  13. group: nogroup
  14. bind_to_address: any
  15. bind_address: any
  16. mpdport: 6600
  17. log_level: default
  18. gapless_mp3_playback: yes
  19. save_absolute_paths_in_playlists: yes
  20. metadata_to_use: artist,album,title,track,name,genre,date,composer,performer,disc
  21. auto_update: no
  22. auto_update_depth: 3
  23. follow_outside_symlinks: no
  24. follow_inside_symlinks: no
  25. zeroconf_enabled: no
  26. zeroconf_name: mpd
  27. default_permissions: read,add,control,admin
  28. stream: music
  29. stream_port: 6700
  30. stream_bind_address: any
  31. mixer_type: disabled
  32. replaygain: album
  33. replaygain_preamp: 0
  34. volume_normalization: no
  35. audio_buffer_size: 2048
  36. buffer_before_play: "1%"
  37. tasks:
  38. - name: "mpdf backendhost"
  39. set_fact:
  40. backendhost: "{{ inventory_hostname |replace ('b', 'f') }}"
  41. - name: Install mpdb on hosts
  42. apt:
  43. name: mpd
  44. state: latest
  45. update_cache: yes
  46. - name: setup config on hosts
  47. template:
  48. src: mpdb.conf.j2
  49. dest: "/etc/mpd.conf"
  50. mode: 0644
  51. owner: root
  52. group: root
  53. notify:
  54. - Restart MPD
  55. - name: mpdf music directory
  56. file:
  57. path: "/var/lib/mpd/music"
  58. state: directory
  59. owner: root
  60. group: root
  61. mode: '0755'
  62. notify:
  63. - Restart MPD
  64. - name: mpdf music playlist directory
  65. file:
  66. path: "/var/lib/mpd/music/playlists/"
  67. state: directory
  68. owner: root
  69. group: root
  70. mode: '0755'
  71. notify:
  72. - Restart MPD
  73. - name: setup service on hosts
  74. template:
  75. src: mpdb.service.j2
  76. dest: "/usr/lib/systemd/system/mpd.service"
  77. mode: 0644
  78. owner: root
  79. group: root
  80. notify:
  81. - Restart MPD
  82. - name: mpd service start
  83. systemd:
  84. name: "mpd"
  85. state: started
  86. enabled: yes
  87. masked: no
  88. daemon_reload: yes
  89. handlers:
  90. - name: Restart MPD
  91. ansible.builtin.service:
  92. name: mpd
  93. state: restarted