- hosts: all gather_facts: false vars: #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 count: 5 path: /var/lib/ mpd: mpd #service_name: "{{ mpd ~ item }}" add_path: "{{ path ~ service_name }}" playlist_directory: "{{ add_path ~ 'playlist/' }}" db_file: tag_cache log_file: mpd.log pid_file: pid state_file: state sticker_file: sticker.sql user: mpd group: nogroup bind_to_address: any bind_address: any port_start: 6600 port: "{{ port_start + item }}" log_level: gapless_mp3_playback: yes save_absolute_paths_in_playlists: yes metadata_to_use: artist,album,title,track,name,genre,date,composer,performer,disc auto_update: no auto_update_depth: 3 follow_outside_symlinks: no follow_inside_symlinks: no zeroconf_enabled: no zeroconf_name: mpd default_permissions: red,add,control,admin stream: music stream_port: 6700 stream_bind_address: any mixer_type: disabled replaygain: album replaygain_preamp: 0 volume_normalization: no audio_buffer_size: 2048 buffer_before_play: 1% tasks: - debug: msg: "{{ playlist_directory }}" #"{{ service_name }}" - name: Install mpdf on hosts apt: name: mpd state: present - name: setup config on hosts template: src: mpdf.conf.j2 dest: /etc/mpdf{{ item }}.conf mode: 0644 owner: root group: root notify: - restart mpd loop: "{{ range(1,count|int + 1) }}"