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

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