Ansible repo for digital ocean projects
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

mpdf.yaml 2.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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/mpd
  7. playlist_directory: /playlist/
  8. db_file: tag_cache
  9. log_dir: /var/log/
  10. log_file: mpd.log
  11. pid_file: pid
  12. state_file: state
  13. sticker_file: sticker
  14. user: mpd
  15. group: nogroup
  16. bind_to_address: any
  17. bind_address: any
  18. mpdport: 6600
  19. log_level:
  20. gapless_mp3_playback: yes
  21. save_absolute_paths_in_playlists: yes
  22. metadata_to_use: artist,album,title,track,name,genre,date,composer,performer,disc
  23. auto_update: no
  24. auto_update_depth: 3
  25. follow_outside_symlinks: no
  26. follow_inside_symlinks: no
  27. zeroconf_enabled: no
  28. zeroconf_name: mpd
  29. default_permissions: read,add,control,admin
  30. stream: music
  31. stream_port: 6700
  32. stream_bind_address: any
  33. mixer_type: disabled
  34. replaygain: album
  35. replaygain_preamp: 0
  36. volume_normalization: no
  37. audio_buffer_size: 2048
  38. buffer_before_play: "1%"
  39. tasks:
  40. - name: Install mpdf on hosts
  41. apt:
  42. name: mpd
  43. state: present
  44. - name: setup config on hosts
  45. template:
  46. src: mpdf.conf.j2
  47. dest: "/etc/mpdf{{ item }}.conf"
  48. mode: 0644
  49. owner: root
  50. group: root
  51. loop: "{{ range(1,count|int + 1) }}"
  52. - name: mpdf var directory
  53. file:
  54. path: "/var/lib/mpd{{ item }}"
  55. state: directory
  56. owner: root
  57. group: root
  58. mode: '0755'
  59. loop: "{{ range(1,count|int + 1) }}"
  60. - name: mpdf playlist directory
  61. file:
  62. path: "/var/lib/mpd{{ item }}/playlist"
  63. state: directory
  64. owner: root
  65. group: root
  66. mode: '0755'
  67. loop: "{{ range(1,count|int + 1) }}"
  68. - name: mpdf pid file
  69. file:
  70. path: "/var/lib/mpd{{ item }}/pid"
  71. state: file
  72. owner: root
  73. group: root
  74. mode: '0755'
  75. loop: "{{ range(1,count|int + 1) }}"
  76. - name: mpdf music directory
  77. file:
  78. path: "/var/lib/mpd{{ item }}/music"
  79. state: directory
  80. owner: root
  81. group: root
  82. mode: '0755'
  83. loop: "{{ range(1,count|int + 1) }}"
  84. - name: copy sticker.sql
  85. copy:
  86. src: "/var/lib/mpd/sticker.sql"
  87. dest: "/var/lib/mpd{{ item }}/sticker.sql"
  88. owner: root
  89. group: root
  90. mode: '0644'
  91. loop: "{{ range(1,count|int + 1) }}"
  92. - name: setup service on hosts
  93. template:
  94. src: mpdf.service.j2
  95. dest: "/usr/lib/systemd/system/mpdf{{ item }}.service"
  96. mode: 0644
  97. owner: root
  98. group: root
  99. loop: "{{ range(1,count|int + 1) }}"
  100. - name: mpd service start
  101. systemd:
  102. name: "mpdf{{ item }}"
  103. state: started
  104. enabled: yes
  105. masked: no
  106. daemon_reload: yes
  107. loop: "{{ range(1,count|int + 1) }}"