From 678ad7eb6d9140910df27b098a39ec2ce415886d Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sun, 28 Apr 2019 16:07:55 +0100 Subject: [PATCH 1/6] Hardware docs, tweaks elsewhere --- docs/hardware.md | 21 +++++++++++++++++++++ docs/zfs/zfs_configuration.md | 2 ++ docs/zfs/zfs_overview.md | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 docs/hardware.md diff --git a/docs/hardware.md b/docs/hardware.md new file mode 100644 index 00000000..54066e11 --- /dev/null +++ b/docs/hardware.md @@ -0,0 +1,21 @@ +# Hardware + +Ansible-NAS will run against any x64 Ubuntu box (i.e. not a Raspberry Pi or other ARM hardware), or even a VM if you're just testing things out. The hardware you pick for Ansible-NAS depends largely on what you intend to do with your server - and is very much a "how long is a piece of string" type question. + +The [homeserver Reddit](https://www.reddit.com/r/HomeServer/) has lots of good information. [ServerBuilds.net](https://www.serverbuilds.net/) is also kept up to date with cheap and decent quality builds known as "NAS Killers". + +## Questions To Think About + +1. What will be taxing the CPU(s) on your Ansible-NAS box? Are you intending to transcode video? How many users will be hitting it? + +2. How many applications do you intend to run in parallel? How much memory do these applications require? + +3. Are you going to run the [ZFS](zfs/zfs_overview/) file system? (you should!) + +4. What are you intending to store on your Ansible-NAS? Is it data you can download again, or is it important to you that you don't lose it? Do you need mirrored disks? + +## HP Microserver + +Ansible-NAS development is tested against an HP Microserver N54L, with 16GB of memory, a 60gb SSD for the OS and 4x2TB WD Red NAS drives for storage. It works great :-) + +This is obviously not the only solution but a reasonable one if you just want a single box to buy, and many different models are available on eBay for varying costs. \ No newline at end of file diff --git a/docs/zfs/zfs_configuration.md b/docs/zfs/zfs_configuration.md index 8260257f..7f36f2f3 100644 --- a/docs/zfs/zfs_configuration.md +++ b/docs/zfs/zfs_configuration.md @@ -1,3 +1,5 @@ +# ZFS Configuration + This text deals with specific ZFS configuration questions for Ansible-NAS. If you are new to ZFS and are looking for the big picture, please read the [ZFS overview](zfs_overview.md) introduction first. diff --git a/docs/zfs/zfs_overview.md b/docs/zfs/zfs_overview.md index 0bc65672..9bc9b012 100644 --- a/docs/zfs/zfs_overview.md +++ b/docs/zfs/zfs_overview.md @@ -1,3 +1,5 @@ +# ZFS Overview + This is a general overview of the ZFS file system for people who are new to it. If you have some experience and are actually looking for specific information about how to configure ZFS for Ansible-NAS, check out the [ZFS example From daf164e82a79713e875d817cd2f9c763aaa2d1a7 Mon Sep 17 00:00:00 2001 From: "Scot W. Stevenson" Date: Sun, 28 Apr 2019 20:10:40 +0200 Subject: [PATCH 2/6] Fix typo in local link to ZFS intro --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index c8f9310f..bb9c232a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,4 +28,4 @@ you're done, check out the [post-installation](post_installation.md) steps. If this is all very confusing, there is also an [overview](overview.md) of the project and what is required for complete beginners. If you're only confused -abot ZFS, we'll help you [get started](zfs_overview.md) as well. +abot ZFS, we'll help you [get started](zfs/zfs_overview.md) as well. From 724424a979ce8f44ce76609e20872fc29c6a2556 Mon Sep 17 00:00:00 2001 From: "Scot W. Stevenson" Date: Tue, 2 Apr 2019 13:29:48 +0200 Subject: [PATCH 3/6] Added permissions parameters to Plex and Emby User can now set parameters to decide if their Plex and/or Emby apps should consider the TV and movies folders as read-only or read-write (see discussion at #69) --- README.md | 33 ++++++++++++++++++++++++--------- group_vars/all.yml.dist | 4 ++++ tasks/emby.yml | 4 ++-- tasks/plex.yml | 4 ++-- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 75e93c58..6c340e35 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ [![Build Status](https://img.shields.io/travis/com/davestephens/ansible-nas.svg?logo=travis&style=flat-square)](https://travis-ci.com/davestephens/ansible-nas) [![Gitter chat](https://img.shields.io/gitter/room/ansible-nas/chat.svg?logo=gitter&style=flat-square)](https://gitter.im/Ansible-NAS/Chat) [![license](https://img.shields.io/github/license/DAVFoundation/api_doc.svg?style=flat-square)](https://github.com/davestephens/ansible-nas/blob/master/LICENSE) -After getting burned by broken FreeNAS updates one too many times, I figured I could do a much better job myself using -just a stock Ubuntu install, some clever Ansible config and a bunch of Docker containers. +After getting burned by broken FreeNAS updates one too many times, I figured I +could do a much better job myself using just a stock Ubuntu install, some clever +Ansible config and a bunch of Docker containers. ## What This Sets Up @@ -60,19 +61,27 @@ just a stock Ubuntu install, some clever Ansible config and a bunch of Docker co ## What This Could Do -Ansible-NAS can run anything that's in a Docker image, which is why Portainer is included. A NAS configuration is a pretty personal thing based on what you download, what media you view, how many photos you take...so it's difficult to please everyone. +Ansible-NAS can run anything that's in a Docker image, which is why Portainer is +included. A NAS configuration is a pretty personal thing based on what you +download, what media you view, how many photos you take...so it's difficult to +please everyone. -That said, if specific functionality you want isn't included and you think others could benefit, add it and raise a PR! +That said, if specific functionality you want isn't included and you think +others could benefit, add it and raise a PR! ## What This Doesn't Do -Ansible NAS doesn't set up your disk partitions, primarily because getting it wrong can be incredibly destructive. -That aside, configuring partitions is usually a one-time (or very infrequent) event, so there's not much to be -gained by automating it. +Ansible NAS doesn't set up your disk partitions, primarily because getting it +wrong can be incredibly destructive. That aside, configuring partitions is +usually a one-time (or very infrequent) event, so there's not much to be gained +by automating it. ## Quick Start -:skull: Before running anything, check out the playbook and understand what it does. Run it against a VM and make sure you're happy. ***Do not*** blindly download code from the internet and trust that it's going to work as you expect. :skull: +:skull: Before running anything, check out the playbook and understand what it +does. Run it against a VM and make sure you're happy. ***Do not*** blindly +download code from the internet and trust that it's going to work as you expect. +:skull: 1. Enable the Ubuntu Universe repository: `sudo add-apt-repository universe` 2. Install Ansible: `sudo apt install ansible` @@ -87,7 +96,8 @@ gained by automating it. ## Documentation -You can read the docs [here](https://davestephens.github.io/ansible-nas). PRs for more documentation always welcome! +You can read the docs [here](https://davestephens.github.io/ansible-nas). PRs +for more documentation always welcome! ## Migrating from FreeNAS @@ -102,8 +112,13 @@ Assuming that your Ubuntu system disk is separate from your storage (it should b ## Requirements +<<<<<<< HEAD * Ansible NAS targets the latest Ubuntu LTS release, which is currently Ubuntu Server 18.04.2 LTS. * You can run Ansible-NAS on whatever you like, read the docs for more info. I use an HP Microserver. +======= +Ansible NAS should work on any recent Ubuntu box. Development is done on Ubuntu +Server 18.04.1 LTS running on an HP Microserver. +>>>>>>> Added permissions parameters to Plex and Emby ## Getting Help diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 3f34ef75..32f7f605 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -290,7 +290,9 @@ transmission_local_network: "192.168.1.0/24" plex_available_externally: "false" plex_config_directory: "{{ docker_home }}/plex/config" plex_movies_directory: "{{ movies_root }}" +plex_movies_permissions: "ro" plex_tv_directory: "{{ tv_root }}" +plex_tv_permissions: "ro" plex_user_id: 0 plex_group_id: 0 @@ -300,7 +302,9 @@ plex_group_id: 0 emby_available_externally: "false" emby_config_directory: "{{ docker_home }}/emby/config" emby_movies_directory: "{{ movies_root }}" +emby_movies_permissions: "ro" emby_tv_directory: "{{ tv_root }}" +emby_tv_permissions: "ro" emby_user_id: 0 emby_group_id: 0 diff --git a/tasks/emby.yml b/tasks/emby.yml index eb31130e..fdded57c 100644 --- a/tasks/emby.yml +++ b/tasks/emby.yml @@ -12,8 +12,8 @@ pull: true volumes: - "{{ emby_config_directory }}:/config:rw" - - "{{ emby_movies_directory }}:/movies:rw" - - "{{ emby_tv_directory }}:/tv:rw" + - "{{ emby_movies_directory }}:/movies:{{ emby_movies_permissions }}" + - "{{ emby_tv_directory }}:/tv:{{ emby_tv_permissions }}" ports: - "8096:8096" # HTTP port - "8920:8920" # HTTPS port diff --git a/tasks/plex.yml b/tasks/plex.yml index b43c2631..0e84bbf9 100644 --- a/tasks/plex.yml +++ b/tasks/plex.yml @@ -13,8 +13,8 @@ pull: true volumes: - "{{ plex_config_directory }}:/config:rw" - - "{{ plex_movies_directory }}:/movies:rw" - - "{{ plex_tv_directory }}:/tv:rw" + - "{{ plex_movies_directory }}:/movies:{{ plex_movies_permissions }}" + - "{{ plex_tv_directory }}:/tv:{{ plex_tv_permissions }}" network_mode: "host" env: TZ: "{{ ansible_nas_timezone }}" From 6858d3b6f1a50f62173d6a01c0bab6a7bdb966f2 Mon Sep 17 00:00:00 2001 From: "Scot W. Stevenson" Date: Mon, 15 Apr 2019 17:46:26 +0200 Subject: [PATCH 4/6] Emby/Plex permissions now rw by default --- README.md | 11 ++++------- group_vars/all.yml.dist | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6c340e35..d61899b2 100644 --- a/README.md +++ b/README.md @@ -112,13 +112,10 @@ Assuming that your Ubuntu system disk is separate from your storage (it should b ## Requirements -<<<<<<< HEAD -* Ansible NAS targets the latest Ubuntu LTS release, which is currently Ubuntu Server 18.04.2 LTS. -* You can run Ansible-NAS on whatever you like, read the docs for more info. I use an HP Microserver. -======= -Ansible NAS should work on any recent Ubuntu box. Development is done on Ubuntu -Server 18.04.1 LTS running on an HP Microserver. ->>>>>>> Added permissions parameters to Plex and Emby +* Ansible NAS targets the latest Ubuntu LTS release, which is currently Ubuntu + Server 18.04.2 LTS. +* You can run Ansible-NAS on whatever you like, read the docs for more info. I + use an HP Microserver. ## Getting Help diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 32f7f605..8c535e72 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -290,9 +290,9 @@ transmission_local_network: "192.168.1.0/24" plex_available_externally: "false" plex_config_directory: "{{ docker_home }}/plex/config" plex_movies_directory: "{{ movies_root }}" -plex_movies_permissions: "ro" +plex_movies_permissions: "rw" plex_tv_directory: "{{ tv_root }}" -plex_tv_permissions: "ro" +plex_tv_permissions: "rw" plex_user_id: 0 plex_group_id: 0 @@ -302,9 +302,9 @@ plex_group_id: 0 emby_available_externally: "false" emby_config_directory: "{{ docker_home }}/emby/config" emby_movies_directory: "{{ movies_root }}" -emby_movies_permissions: "ro" +emby_movies_permissions: "rw" emby_tv_directory: "{{ tv_root }}" -emby_tv_permissions: "ro" +emby_tv_permissions: "rw" emby_user_id: 0 emby_group_id: 0 From 697cc273f783d4bfce4150a743f35ee9e82d36f0 Mon Sep 17 00:00:00 2001 From: "Scot W. Stevenson" Date: Sun, 28 Apr 2019 21:30:06 +0200 Subject: [PATCH 5/6] Explain why Emby/Plex might want 'ro' filesystems --- group_vars/all.yml.dist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 8c535e72..000773e9 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -287,6 +287,8 @@ transmission_local_network: "192.168.1.0/24" ### ### Plex ### +# If you're paranoid, set permissions to "ro" so Plex won't ever be able to +# delete your files plex_available_externally: "false" plex_config_directory: "{{ docker_home }}/plex/config" plex_movies_directory: "{{ movies_root }}" @@ -299,6 +301,8 @@ plex_group_id: 0 ### ### Emby ### +# If you're paranoid, set permissions to "ro" so Emby won't ever be able to +# delete your files emby_available_externally: "false" emby_config_directory: "{{ docker_home }}/emby/config" emby_movies_directory: "{{ movies_root }}" From 2a80aff5389c69ad3436036e4e6cd0112bc3db28 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Fri, 24 May 2019 14:36:42 +0100 Subject: [PATCH 6/6] Add BeerPay.io --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d61899b2..f50cfaa2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Ansible NAS -[![Build Status](https://img.shields.io/travis/com/davestephens/ansible-nas.svg?logo=travis&style=flat-square)](https://travis-ci.com/davestephens/ansible-nas) [![Gitter chat](https://img.shields.io/gitter/room/ansible-nas/chat.svg?logo=gitter&style=flat-square)](https://gitter.im/Ansible-NAS/Chat) [![license](https://img.shields.io/github/license/DAVFoundation/api_doc.svg?style=flat-square)](https://github.com/davestephens/ansible-nas/blob/master/LICENSE) +[![Build Status](https://img.shields.io/travis/com/davestephens/ansible-nas.svg?logo=travis&style=flat-square)](https://travis-ci.com/davestephens/ansible-nas) [![Gitter chat](https://img.shields.io/gitter/room/ansible-nas/chat.svg?logo=gitter&style=flat-square)](https://gitter.im/Ansible-NAS/Chat) [![license](https://img.shields.io/github/license/DAVFoundation/api_doc.svg?style=flat-square)](https://github.com/davestephens/ansible-nas/blob/master/LICENSE) [![Beerpay](https://beerpay.io/davestephens/ansible-nas/badge.svg?style=flat-square)](https://beerpay.io/davestephens/ansible-nas) After getting burned by broken FreeNAS updates one too many times, I figured I could do a much better job myself using just a stock Ubuntu install, some clever