Ansible repo for digital ocean projects
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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