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

89 lines
1.8 KiB
YAML
Raw Permalink 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"
2019-10-18 08:40:04 +01:00
- "/srv/etc/rclone"
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"
2019-10-18 08:40:04 +01:00
dest: "/srv/etc/rclone/rclone.conf"
2019-10-16 21:41:36 +01:00
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