Ansible repo for digital ocean projects
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2 лет назад
2 лет назад
2 лет назад
2 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. - hosts: mpdf
  2. gather_facts: true
  3. vars:
  4. mpdcount: 5
  5. path: /var/lib/mpd
  6. playlist_directory: /playlist/
  7. db_file: tag_cache
  8. log_dir: /var/log/
  9. log_file: mpd.log
  10. pid_file: pid
  11. state_file: state
  12. sticker_file: sticker
  13. user: mpd
  14. group: nogroup
  15. bind_to_address: any
  16. bind_address: any
  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: "mpd backendhost"
  40. set_fact:
  41. backendhost: "{{ inventory_hostname |replace ('f', 'b') }}"
  42. - name: Install mpdf on hosts
  43. apt:
  44. name: mpd
  45. state: present
  46. - name: setup config on hosts
  47. template:
  48. src: mpdf.conf.j2
  49. dest: "/etc/mpdf{{ item }}.conf"
  50. mode: 0644
  51. owner: root
  52. group: root
  53. loop: "{{ range(1,mpdcount|int + 1) }}"
  54. - name: mpdf var directory
  55. file:
  56. path: "/var/lib/mpd{{ item }}"
  57. state: directory
  58. owner: root
  59. group: root
  60. mode: '0777'
  61. loop: "{{ range(1,count|int + 1) }}"
  62. - name: mpdf playlist directory
  63. file:
  64. path: "/var/lib/mpd{{ item }}/playlist"
  65. state: directory
  66. owner: root
  67. group: root
  68. mode: '0755'
  69. loop: "{{ range(1,mpdcount|int + 1) }}"
  70. # - name: mpdf pid file
  71. # file:
  72. # path: "/var/lib/mpd{{ item }}/pid"
  73. # state: touch
  74. # owner: root
  75. # group: root
  76. # mode: '0755'
  77. #loop: "{{ range(1,count|int + 1) }}"
  78. - name: mpdf music directory
  79. file:
  80. path: "/var/lib/mpd{{ item }}/music"
  81. state: directory
  82. owner: root
  83. group: root
  84. mode: '0755'
  85. loop: "{{ range(1,mpdcount|int + 1) }}"
  86. - name: copy sticker.sql
  87. copy:
  88. src: "/var/lib/mpd/sticker.sql"
  89. dest: "/var/lib/mpd{{ item }}/sticker.sql"
  90. owner: root
  91. group: root
  92. mode: '0644'
  93. loop: "{{ range(1,mpdcount|int + 1) }}"
  94. - name: setup service on hosts
  95. template:
  96. src: mpdf.service.j2
  97. dest: "/usr/lib/systemd/system/mpdf{{ item }}.service"
  98. mode: 0644
  99. owner: root
  100. group: root
  101. loop: "{{ range(1,mpdcount|int + 1) }}"
  102. - name: mpd service start
  103. systemd:
  104. name: "mpdf{{ item }}"
  105. state: started
  106. enabled: yes
  107. masked: no
  108. daemon_reload: yes
  109. loop: "{{ range(1,mpdcount|int + 1) }}"