2023-02-19 23:46:17 +01:00
|
|
|
---
|
2023-04-03 15:44:52 +02:00
|
|
|
- name: "install beets and other utils"
|
2023-02-19 23:46:17 +01:00
|
|
|
ansible.builtin.apt:
|
|
|
|
name:
|
|
|
|
- "beets"
|
|
|
|
- "ffmpeg"
|
2023-05-20 16:01:48 +02:00
|
|
|
- "flac"
|
2023-04-03 15:44:52 +02:00
|
|
|
- "unzip"
|
2023-02-19 23:46:17 +01:00
|
|
|
|
|
|
|
- name: "install nextcloud-upload"
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "./nextcloud-upload"
|
|
|
|
dest: "/usr/local/bin/nextcloud-upload"
|
|
|
|
mode: 0755
|
|
|
|
|
2023-07-29 15:19:20 +02:00
|
|
|
- name: "resolve nextcloud-upload via hosts file (inet)"
|
2023-02-26 00:21:00 +01:00
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: "/etc/hosts"
|
2023-07-29 15:19:20 +02:00
|
|
|
line: "{{ music_org_nextcloud_inet_address }} {{ music_user_nextcloud_domain }}"
|
|
|
|
insertafter: "EOF"
|
|
|
|
|
|
|
|
- name: "resolve nextcloud-upload via hosts file (inet6)"
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: "/etc/hosts"
|
|
|
|
line: "{{ music_org_nextcloud_inet6_address }} {{ music_user_nextcloud_domain }}"
|
2023-02-26 00:21:00 +01:00
|
|
|
insertafter: "EOF"
|
|
|
|
|
2023-02-19 23:46:17 +01:00
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: "create beets config directory"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ music_user_home_directory }}/.config/beets"
|
|
|
|
state: "directory"
|
|
|
|
owner: "{{ music_user_name }}"
|
|
|
|
group: "{{ music_user_name }}"
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: "create beets convert directory"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "/var/tmp/{{ music_user_name }}/mp3"
|
|
|
|
state: "directory"
|
|
|
|
owner: "{{ music_user_name }}"
|
|
|
|
group: "{{ music_user_name }}"
|
|
|
|
mode: 0755
|
|
|
|
|
2023-04-03 15:45:13 +02:00
|
|
|
- name: "configure common beets config"
|
|
|
|
ansible.builtin.blockinfile:
|
|
|
|
path: "{{ music_user_home_directory }}/.config/beets/{{ item }}.yaml"
|
|
|
|
create: true
|
2023-02-19 23:46:17 +01:00
|
|
|
mode: 0644
|
2023-04-03 15:45:13 +02:00
|
|
|
insertafter: "EOF"
|
|
|
|
marker: "# {mark} ANSIBLE MANAGED BLOCK COMMON"
|
|
|
|
block: "{{ lookup('ansible.builtin.template', './beets-common.yml') }}"
|
|
|
|
with_items:
|
|
|
|
- "config"
|
|
|
|
- "archive"
|
|
|
|
|
|
|
|
- name: "configure beets for collection"
|
|
|
|
ansible.builtin.blockinfile:
|
|
|
|
path: "{{ music_user_home_directory }}/.config/beets/config.yaml"
|
|
|
|
insertbefore: "BOF"
|
|
|
|
marker: "# {mark} ANSIBLE MANAGED BLOCK COLLECTION"
|
|
|
|
block: "{{ lookup('ansible.builtin.template', './beets-collection.yml') }}"
|
2023-02-19 23:46:17 +01:00
|
|
|
|
2023-03-01 20:14:12 +01:00
|
|
|
- name: "configure beets for archive"
|
2023-04-03 15:45:13 +02:00
|
|
|
ansible.builtin.blockinfile:
|
|
|
|
path: "{{ music_user_home_directory }}/.config/beets/archive.yaml"
|
|
|
|
insertbefore: "BOF"
|
|
|
|
marker: "# {mark} ANSIBLE MANAGED BLOCK ARCHIVE"
|
|
|
|
block: "{{ lookup('ansible.builtin.template', './beets-archive.yml') }}"
|
2023-03-01 20:14:12 +01:00
|
|
|
|
2023-02-19 23:46:17 +01:00
|
|
|
- name: "create nextcloud-upload config directory"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ music_user_home_directory }}/.config/nextcloud-upload"
|
|
|
|
state: "directory"
|
|
|
|
owner: "{{ music_user_name }}"
|
|
|
|
group: "{{ music_user_name }}"
|
|
|
|
mode: 0755
|
|
|
|
|
2023-04-06 14:07:13 +02:00
|
|
|
- name: "configure nextcloud-upload for music"
|
2023-02-19 23:46:17 +01:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: "./nextcloud-upload.yml"
|
|
|
|
dest: "{{ music_user_home_directory }}/.config/nextcloud-upload/config.yml"
|
|
|
|
mode: 0644
|
2023-04-06 14:07:13 +02:00
|
|
|
vars:
|
|
|
|
music_user_nextcloud_user: "{{ music_user_nextcloud_music_user }}"
|
|
|
|
music_user_nextcloud_pswd: "{{ music_user_nextcloud_music_pswd }}"
|
|
|
|
|
|
|
|
- name: "configure nextcloud-upload for videos"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: "./nextcloud-upload.yml"
|
|
|
|
dest: "{{ music_user_home_directory }}/.config/nextcloud-upload/videos.yml"
|
|
|
|
mode: 0644
|
|
|
|
vars:
|
|
|
|
music_user_nextcloud_user: "{{ music_user_nextcloud_videos_user }}"
|
|
|
|
music_user_nextcloud_pswd: "{{ music_user_nextcloud_videos_pswd }}"
|
2023-02-19 23:46:17 +01:00
|
|
|
|
|
|
|
become_user: "{{ music_user_name }}"
|