Ansible repo for digital ocean projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 2 година
пре 2 година
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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: mpd
  57. group: mpd
  58. mode: '0755'
  59. - name: mpdf playlist directory
  60. file:
  61. path: "/var/lib/mpd {{ item }}/playlist"
  62. state: directory
  63. owner: mpd
  64. group: mpd
  65. mode: '0755'
  66. - name: mpdf music directory
  67. file:
  68. path: "/var/lib/mpd {{ item }}/music"
  69. state: directory
  70. owner: mpd
  71. group: mpd
  72. mode: '0755'
  73. - name: setup service on hosts
  74. template:
  75. src: mpdf.service.j2
  76. dest: "/usr/lib/systemd/system/mpdf{{ item }}.service"
  77. mode: 0644
  78. owner: root
  79. group: root
  80. loop: "{{ range(1,count|int + 1) }}"
  81. - name: mpd service start
  82. systemd:
  83. name: "mpdf{{ item }}"
  84. state: started
  85. enabled: yes
  86. masked: no
  87. daemon_reload: yes
  88. loop: "{{ range(1,count|int + 1) }}"