--- - name: formatting data disk filesystem: fstype: ext4 dev: /dev/sdb - name: mount data disk to /srv mount: path: /srv src: /dev/sdb fstype: ext4 opts: nodev,nosuid,,x-systemd.automount,nofail state: mounted - name: install transmission daemon apt: name: - transmission-daemon state: present - name: create data directories loop: - /srv/incomplete - /srv/downloads file: path: "{{ item }}" state: directory owner: debian-transmission group: debian-transmission mode: 0750 - name: configure transmission loop: - regexp: '^(\s*)"rpc-bind-address":' line: '\1"rpc-bind-address": "127.0.0.1",' - regexp: '^(\s*)"incomplete-dir":' line: '\1"incomplete-dir": "/srv/incomplete",' - regexp: '^(\s*)"download-dir":' line: '\1"download-dir": "/srv/downloads",' - regexp: '^(\s*)"rpc-password":' line: '\1"rpc-password": "{{ transmission_rpc_password }}",' - regexp: '^(\s*)"rpc-username":' line: '\1"rpc-username": "{{ transmission_rpc_username }}",' loop_control: label: "{{ item.regexp }}" lineinfile: path: /etc/transmission-daemon/settings.json backrefs: true regexp: "{{ item.regexp }}" line: "{{ item.line }}" notify: reload transmission-daemon