Add music/archive volume
This commit is contained in:
parent
a83aeac92a
commit
7530583f40
15
README.md
15
README.md
@ -171,3 +171,18 @@ All steps below are to be executed as the `music` user.
|
||||
will convert the flac files into mp3 files for sharing via Nextcloud.
|
||||
3. Run `nextcloud-upload /var/tmp/music/mp3/<artist>` for every artist to upload to Nextcloud.
|
||||
4. Remove the `/var/tmp/music/mp3/<artist>` directory.
|
||||
|
||||
### Archive music
|
||||
|
||||
#### From rip
|
||||
|
||||
1. Run `beet --config .config/beets/archive.yaml import /var/lib/yggdrasil/home/music/rip`. This
|
||||
will move the music files to `/var/lib/yggdrasil/data/music/archive`.
|
||||
|
||||
#### From collection
|
||||
|
||||
1. Run `beet --config .config/beets/archive.yaml import
|
||||
/var/lib/yggdrasil/data/music/collection/<artist>/<album>`. This will copy the music files to
|
||||
`/var/lib/yggdrasil/data/music/archive`.
|
||||
2. Run `beet remove -d -a artist:"<artis>" album:"<album>"`. This will remove the music files from
|
||||
the collection.
|
||||
|
@ -100,10 +100,12 @@ music_user_samba_password: "{{ vault_music_user_samba_password }}"
|
||||
music_user_home_directory: "{{ system_var_home_directory }}/{{ music_user_name }}"
|
||||
music_user_data_directory: "{{ system_var_data_directory }}/{{ music_user_name }}"
|
||||
music_user_data_collection_directory: "{{ music_user_data_directory }}/collection"
|
||||
music_user_data_archive_directory: "{{ music_user_data_directory }}/archive"
|
||||
|
||||
music_user_home_dataset: "rpool{{ music_user_home_directory }}"
|
||||
music_user_data_dataset: "rpool{{ music_user_data_directory }}"
|
||||
music_user_data_collection_dataset: "{{ music_user_data_dataset }}/collection"
|
||||
music_user_data_archive_dataset: "{{ music_user_data_dataset }}/archive"
|
||||
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
# music:backups
|
||||
|
@ -14,3 +14,6 @@ argument_specs:
|
||||
music_user_data_collection_dataset:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_data_archive_dataset:
|
||||
type: "str"
|
||||
required: true
|
||||
|
@ -26,6 +26,11 @@
|
||||
name: "{{ music_user_data_collection_dataset }}"
|
||||
state: "present"
|
||||
|
||||
- name: "create music archive dataset"
|
||||
community.general.zfs:
|
||||
name: "{{ music_user_data_archive_dataset }}"
|
||||
state: "present"
|
||||
|
||||
- name: "create backup data dataset"
|
||||
community.general.zfs:
|
||||
name: "{{ system_backups_snapshots_data_dataset }}/{{ music_user_name }}"
|
||||
|
@ -11,6 +11,9 @@ argument_specs:
|
||||
music_user_data_collection_directory:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_data_archive_directory:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_nextcloud_domain:
|
||||
type: "str"
|
||||
required: true
|
||||
|
@ -35,12 +35,18 @@
|
||||
group: "{{ music_user_name }}"
|
||||
mode: 0755
|
||||
|
||||
- name: "configure beets"
|
||||
- name: "configure beets for collection"
|
||||
ansible.builtin.template:
|
||||
src: "./beets.yml"
|
||||
src: "./beets-collection.yml"
|
||||
dest: "{{ music_user_home_directory }}/.config/beets/config.yaml"
|
||||
mode: 0644
|
||||
|
||||
- name: "configure beets for archive"
|
||||
ansible.builtin.template:
|
||||
src: "./beets-archive.yml"
|
||||
dest: "{{ music_user_home_directory }}/.config/beets/archive.yaml"
|
||||
mode: 0644
|
||||
|
||||
- name: "create nextcloud-upload config directory"
|
||||
ansible.builtin.file:
|
||||
path: "{{ music_user_home_directory }}/.config/nextcloud-upload"
|
||||
|
17
playbooks/roles/music/org/templates/beets-archive.yml
Normal file
17
playbooks/roles/music/org/templates/beets-archive.yml
Normal file
@ -0,0 +1,17 @@
|
||||
plugins: fetchart info
|
||||
library: {{ music_user_data_archive_directory }}/library.db
|
||||
|
||||
directory: {{ music_user_data_archive_directory }}
|
||||
paths:
|
||||
default: $albumartist/$year $album%aunique{}/$track $title
|
||||
singleton: Non-Album/$artist/$title
|
||||
comp: Compilations/$year $album%aunique{}/$track $title
|
||||
import:
|
||||
copy: yes
|
||||
move: no
|
||||
write: no
|
||||
autotag: no
|
||||
|
||||
fetchart:
|
||||
sources:
|
||||
- filesystem
|
@ -15,6 +15,14 @@
|
||||
group: "{{ music_user_name }}"
|
||||
mode: 0755
|
||||
|
||||
- name: "directories : create archive directory"
|
||||
ansible.builtin.file:
|
||||
path: "{{ music_user_data_archive_directory }}"
|
||||
state: "directory"
|
||||
owner: "{{ music_user_name }}"
|
||||
group: "{{ music_user_name }}"
|
||||
mode: 0755
|
||||
|
||||
- name: "directories : create rip directory"
|
||||
ansible.builtin.file:
|
||||
path: "{{ music_user_home_directory }}/rip"
|
||||
|
@ -22,6 +22,20 @@
|
||||
directory mask = 0755
|
||||
register: music_rip_samba_rip_config
|
||||
|
||||
- name: "samba : configure \"music-collection\" samba share"
|
||||
ansible.builtin.blockinfile:
|
||||
path: "/etc/samba/smb.conf"
|
||||
mode: 0644
|
||||
insertafter: "EOF"
|
||||
marker: "# {mark} ANSIBLE MANAGED BLOCK MUSIC:COLLECTION"
|
||||
block: |
|
||||
[music-collection]
|
||||
comment = Music archive
|
||||
path = {{ music_user_data_collection_directory }}
|
||||
browseable = yes
|
||||
read only = yes
|
||||
register: music_rip_samba_collection_config
|
||||
|
||||
- name: "samba : configure \"music-archive\" samba share"
|
||||
ansible.builtin.blockinfile:
|
||||
path: "/etc/samba/smb.conf"
|
||||
@ -31,7 +45,7 @@
|
||||
block: |
|
||||
[music-archive]
|
||||
comment = Music archive
|
||||
path = {{ music_user_data_collection_directory }}
|
||||
path = {{ music_user_data_archive_directory }}
|
||||
browseable = yes
|
||||
read only = yes
|
||||
register: music_rip_samba_archive_config
|
||||
@ -65,5 +79,6 @@
|
||||
state: "restarted"
|
||||
when:
|
||||
(music_rip_samba_rip_config.changed or
|
||||
music_rip_samba_collection_config.changed or
|
||||
music_rip_samba_archive_config.changed) and
|
||||
not music_rip_samba_start.changed
|
||||
|
Loading…
Reference in New Issue
Block a user