dotfiles/.ansible/roles/rclone_mount/tasks/main.yaml

88 lines
1.8 KiB
YAML
Raw Normal View History

2019-10-12 15:53:12 +01:00
---
- name: "Rclone"
tags:
- rclone
block:
- name: "Rclone: Mountpoints"
tags:
- install
file:
path: "{{ item }}"
state: directory
owner: "media"
group: "media"
loop:
- "/mnt/media"
- "/mnt/GoogleDriveCrypt"
- "/mnt/.media.cache"
- "/mnt/.overlay.work"
become: yes
2019-10-16 21:41:36 +01:00
- name: "Rclone: Packages"
tags:
- install
package:
name: "rclone"
state: latest
become: yes
2019-10-12 15:53:12 +01:00
2019-10-16 21:41:36 +01:00
- name: "Rclone: Configuration"
tags:
- config
template:
src: "templates/rclone.conf.j2"
dest: "/srv/etc/rclone.conf"
mode: "0600"
owner: "media"
group: "media"
force: no
become: yes
2019-10-12 19:50:49 +01:00
2019-10-16 21:41:36 +01:00
- name: "Rclone: Configuration: FUSE"
tags:
- config
lineinfile:
path: /etc/fuse.conf
regexp: "^#?user_allow_other"
line: "user_allow_other"
become: yes
- name: "Rclone: Install: rclone service"
tags:
- install
copy:
dest: "/etc/systemd/system/rclone.service"
src: "files/rclone.service"
owner: "root"
group: "root"
mode: "0444"
become: yes
- name: "Rclone: Configure: rclone service"
tags:
- config
systemd:
name: rclone
enabled: yes
state: started
become: yes
- name: "Rclone: Install:/mnt/media mount"
tags:
- install
copy:
dest: "/etc/systemd/system/mnt-media.mount"
src: "files/mnt-media.mount"
owner: "root"
group: "root"
mode: "0444"
become: yes
- name: "Rclone: Configure: /mnt/media mount"
tags:
- config
systemd:
name: mnt-media.mount
state: started
become: yes