Ansible repo for digital ocean projects
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

103 řádky
2.5 KiB

  1. - hosts: mpdb
  2. gather_facts: true
  3. vars:
  4. path: /var/lib/mpd
  5. playlist_directory: /playlist/
  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: mpd
  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. apt:
  47. name: davfs
  48. state: latest
  49. - name: setup config on hosts
  50. template:
  51. src: mpdb.conf.j2
  52. dest: "/etc/mpd.conf"
  53. mode: 0644
  54. owner: root
  55. group: root
  56. notify:
  57. - Restart MPD
  58. - name: mpdf music directory
  59. file:
  60. path: "/var/lib/mpd/music"
  61. state: directory
  62. owner: root
  63. group: root
  64. mode: '0755'
  65. notify:
  66. - Restart MPD
  67. - name: setup service davfs on host
  68. template:
  69. src: davfs.service.j2
  70. dest: "/usr/lib/systemd/system/davfs.service"
  71. mode: 0644
  72. owner: root
  73. group: root
  74. - name: setup service on hosts
  75. template:
  76. src: mpdb.service.j2
  77. dest: "/usr/lib/systemd/system/mpd.service"
  78. mode: 0644
  79. owner: root
  80. group: root
  81. notify:
  82. - Restart MPD
  83. - name: davfs service start
  84. systemd:
  85. name: "davfs"
  86. state: started
  87. enabled: yes
  88. masked: no
  89. daemon_reload: yes
  90. - name: mpd service start
  91. systemd:
  92. name: "mpd"
  93. state: started
  94. enabled: yes
  95. masked: no
  96. daemon_reload: yes
  97. handlers:
  98. - name: Restart MPD
  99. ansible.builtin.service:
  100. name: mpd
  101. state: restarted