From 523d31599bd6a623287c4a6f812d4d7f3002538d Mon Sep 17 00:00:00 2001 From: saltydk Date: Thu, 24 Aug 2023 03:09:32 +0200 Subject: [PATCH] common: add toggle for Media subfolder creation --- roles/common/defaults/main.yml | 1 + roles/common/tasks/main.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml index f013c8dec4..b56da4a893 100644 --- a/roles/common/defaults/main.yml +++ b/roles/common/defaults/main.yml @@ -8,3 +8,4 @@ ######################################################################### --- nano_syntax_highlighting_enabled: true +common_create_media_subfolders: true diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index ec24980ed3..345468e90e 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -31,6 +31,16 @@ - /mnt - /mnt/local - /mnt/local/Media + +- name: Create common Media directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: "{{ user.name }}" + group: "{{ user.name }}" + mode: "0775" + when: common_create_media_subfolders + with_items: - /mnt/local/Media/Movies - /mnt/local/Media/Music - /mnt/local/Media/TV