mirror of
https://github.com/davestephens/ansible-nas
synced 2024-11-15 00:17:10 +00:00
Merge branch 'master' into emby
This commit is contained in:
commit
bb17aeed7c
23 changed files with 368 additions and 42 deletions
|
@ -11,6 +11,7 @@ Ansible config and a bunch of Docker containers.
|
|||
* An awesome dashboard to your home server (Heimdall)
|
||||
* Any number of Samba shares or NFS exports for you to store your stuff
|
||||
* A BitTorrent client
|
||||
* A Usenet downloader
|
||||
* Various media management tools - Sonarr, Sickchill, CouchPotato, Radarr
|
||||
* Media streaming via Plex or Emby
|
||||
* Music streaming with Airsonic
|
||||
|
@ -47,8 +48,10 @@ Ansible config and a bunch of Docker containers.
|
|||
* [MyMediaForAlexa](https://www.mymediaalexa.com/) - Lets you stream your music collection to your alexa device
|
||||
* [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution
|
||||
* [Nextcloud](https://nextcloud.com/) - A self-hosted Dropbox alternative
|
||||
* [NZBget](https://nzbget.net/) - The most efficient usenet downloader
|
||||
* [Plex](https://www.plex.tv/) - Plex Media Server
|
||||
* [Portainer](https://portainer.io/) - for managing Docker and running custom images
|
||||
* [pyLoad](https://pyload.net/) - A download manager with a friendly web-interface
|
||||
* [Radarr](https://radarr.video/) - for organising and downloading movies
|
||||
* [Sickchill](https://sickchill.github.io/) - for managing TV episodes
|
||||
* [Sonarr](https://sonarr.tv/) - for downloading and managing TV episodes
|
||||
|
@ -58,6 +61,7 @@ Ansible config and a bunch of Docker containers.
|
|||
* [TimeMachine](https://github.com/mbentley/docker-timemachine) - Mac backup server
|
||||
* [Traefik](https://traefik.io/) - Web proxy and SSL certificate manager
|
||||
* [Transmission](https://transmissionbt.com/) - BitTorrent client (with OpenVPN if you have a supported VPN provider)
|
||||
* [Wallabag](https://wallabag.org/) - Save and classify articles. Read them later.
|
||||
* [Watchtower](https://github.com/v2tec/watchtower) - Monitor your Docker containers and update them if a new version is available
|
||||
* [ZNC](https://wiki.znc.in/ZNC) - IRC bouncer to stay connected to favourite IRC networks and channels
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@ Set `bitwarden_enabled: true` in your `group_vars/all.yml` file.
|
|||
|
||||
## Specific Configuration
|
||||
|
||||
Make sure you set your admin token! It is `bitwarden_admin_token` in `group_vars/all.yml` file. The string you put here will be the login to the admin section of your bitwarden installation (https://bitwarden.ansiblenasdomain.tld/admin). This token can be anything, but it's recommended to use a long, randomly generated string of characters, for example running:
|
||||
Make sure you set your admin token! It is `bitwarden_admin_token` in `group_vars/all.yml` file. The string you put here will be the login to the admin section of your Bitwarden installation (https://bitwarden.ansiblenasdomain.tld/admin). This token can be anything, but it's recommended to use a long, randomly generated string of characters, for example running:
|
||||
`openssl rand -base64 48`.
|
||||
|
||||
To create a user, you need to set `bitwarden_allow_signups` to `true` in your `all.yml`, and re-run the playbook to reprovision the
|
||||
container. Once you've created your users, set `bitwarden_allow_signups` back to `false` and run again.
|
||||
|
||||
For speed you can target just Bitwarden by appending `-t bitwarden` to your `ansible-playbook` command.
|
||||
For speed you can target just Bitwarden by appending `-t bitwarden` to your `ansible-playbook` command.
|
||||
|
|
|
@ -8,4 +8,4 @@ Firefly III is a self-hosted financial manager. It can help you keep track of ex
|
|||
|
||||
Set `firefly_enabled: true` in your `group_vars/all.yml` file.
|
||||
|
||||
The very basic MiniDLNA web interface can be found at http://ansible_nas_host_or_ip:8066.
|
||||
The Firefly III web interface can be found at http://ansible_nas_host_or_ip:8066.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# My Media for Alexa
|
||||
|
||||
Homepage: https://www.mymediaalexa.com/](https://www.mymediaalexa.com/)
|
||||
Homepage: [https://www.mymediaalexa.com/](https://www.mymediaalexa.com/)
|
||||
|
||||
My Media lets you stream your music collection to your Amazon Echo or Amazon Dot without having to upload all your music collection to the Cloud. This keeps your music under your control.
|
||||
|
||||
|
|
11
docs/applications/nzbget.md
Normal file
11
docs/applications/nzbget.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# NZBget
|
||||
|
||||
Homepage: [https://nzbget.net/](https://nzbget.net/)
|
||||
|
||||
The most efficient Usenet downloader. NZBGet is written in C++ and designed with performance in mind to achieve maximum download speed by using very little system resources.
|
||||
|
||||
## Usage
|
||||
|
||||
Set `nzbget_enabled: true` in your `group_vars/all.yml` file.
|
||||
|
||||
The NZBget web interface can be found at http://ansible_nas_host_or_ip:6789, the default username is `nzbget` and password `tegbzn6789`. Change this once you've logged in!
|
17
docs/applications/pyload.md
Normal file
17
docs/applications/pyload.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
# pyLoad
|
||||
|
||||
Homepage: [https://pyload.net/](https://pyload.net//)
|
||||
|
||||
Free and Open Source download manager written in Python and designed to be extremely lightweight, easily extensible and fully manageable via web
|
||||
.
|
||||
## Usage
|
||||
|
||||
Set `pyload_enabled: true` in your `group_vars/all.yml` file.
|
||||
|
||||
pyLoad's web interface can be found at http://ansible_nas_host_or_ip:8000
|
||||
|
||||
## Specific Configuration
|
||||
|
||||
Default username is `pyload` and default password is `pyload`.
|
||||
|
||||
In order to add or remove users, you will need to access the container from an interactive shell (can easily be done from portainer, if installed) and enter pyLoad's home directory `/opt/pyload` and using the command `python pyLoadCore.py -u` and follow the on-screen prompts. More commands to configure and customize pyLoad can be found on it's website.
|
|
@ -3,7 +3,7 @@
|
|||
Homepage: [https://transmissionbt.com/](https://transmissionbt.com/)
|
||||
|
||||
Transmission is a free BitTorrent client. Two versions are provided - one that tunnels through a VPN and one that connects
|
||||
directly.
|
||||
directly.
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -13,5 +13,5 @@ Transmission's web interface can be found at http://ansible_nas_host_or_ip:9091
|
|||
|
||||
## Specific Configuration
|
||||
|
||||
If you enable Tranmission with OpenVPN, you'll need to copy `group_vars/vpn_credentials.yml.dist` to
|
||||
If you enable Transmission with OpenVPN, you'll need to copy `group_vars/vpn_credentials.yml.dist` to
|
||||
`group_vars/vpn_credentials.yml` and fill in your settings.
|
||||
|
|
17
docs/applications/wallabag.md
Normal file
17
docs/applications/wallabag.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Wallabag
|
||||
|
||||
Homepage: [https://www.wallabag.org/](https://www.wallabag.org/)
|
||||
|
||||
wallabag is a self-hostable PHP application allowing you to not miss any content anymore. Click, save and read it when you can. It extracts content so that you can read it when you have time.
|
||||
|
||||
## Usage
|
||||
|
||||
Set `wallabag_enabled: true` in your `group_vars/all.yml` file.
|
||||
|
||||
If you want to access Wallabag externally, don't forget to set `wallabag_available_externally: "true"` in your `group_vars/all.yml` file.
|
||||
|
||||
I reccomend using the mobile app, which will sync with this installation so you have access to your saved articles even if you don't have signal or wifi access.
|
||||
|
||||
The default credentials are wallabag:wallabag
|
||||
|
||||
The Wallabag web interface can be found at http://ansible_nas_host_or_ip:7780.
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Homepage: [https://github.com/v2tec/watchtower](https://github.com/v2tec/watchtower)
|
||||
|
||||
A process for watching your Docker containers and automatically udpating and restarting them whenever their base image is refreshed.
|
||||
A process for watching your Docker containers and automatically updating and restarting them whenever their base image is refreshed.
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -12,4 +12,4 @@ Set `watchtower_enabled: true` in your `group_vars/all.yml` file.
|
|||
|
||||
By default Watchtower is configured to check daily at 5am for updates.
|
||||
|
||||
Various notification options are available, and can be configured by updating `watchtower_command` in your `group_vars/all.yml` file. A few examples are provided. The full set of options can be found at the [Watchtower GitHub project page](https://github.com/v2tec/watchtower).
|
||||
Various notification options are available, and can be configured by updating `watchtower_command` in your `group_vars/all.yml` file. A few examples are provided. The full set of options can be found at the [Watchtower GitHub project page](https://github.com/v2tec/watchtower).
|
||||
|
|
|
@ -24,8 +24,10 @@ By default, applications can be found on the ports listed below.
|
|||
| MyMediaForAlexa | 52051 | |
|
||||
| Netdata | 19999 | |
|
||||
| Nextcloud | 8080 | |
|
||||
| NZBGet | 6789 | |
|
||||
| Plex | 32400 | |
|
||||
| Portainer | 9000 | |
|
||||
| pyload | 8000 | |
|
||||
| Radarr | 7878 | |
|
||||
| Sickchill | 8081 | |
|
||||
| Sonarr | 8989 | |
|
||||
|
@ -34,4 +36,5 @@ By default, applications can be found on the ports listed below.
|
|||
| Traefik | 8083 | |
|
||||
| Transmission | 9091 | with VPN |
|
||||
| Transmission | 9092 | |
|
||||
| Wallabag | 7780 | |
|
||||
| ZNC | 6677 | |
|
||||
|
|
|
@ -11,7 +11,7 @@ There are a number of steps required to enable external access to the applicatio
|
|||
|
||||
Enabling access to applications externally **does not** automatically secure them. If you can access an application from within your own network without a username and password, this will also be the case externally.
|
||||
|
||||
It is your responsiblity to ensure that applications you enable external access to are secured appropriately!
|
||||
It is your responsibility to ensure that applications you enable external access to are secured appropriately!
|
||||
|
||||
## Enable Traefik
|
||||
|
||||
|
|
|
@ -16,6 +16,6 @@ The [homeserver Reddit](https://www.reddit.com/r/HomeServer/) has lots of good i
|
|||
|
||||
## 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 :-)
|
||||
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.
|
||||
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.
|
||||
|
|
|
@ -24,8 +24,8 @@ Ansible config and a bunch of Docker containers. Ansible-NAS was born!
|
|||
|
||||
Head to [installation](installation.md) if you're ready to roll, or to
|
||||
[testing](testing.md) if you want to spin up a test Virtual Machine first. Once
|
||||
you're done, check out the [post-installation](post_installation.md) steps.
|
||||
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/zfs_overview.md) as well.
|
||||
about ZFS, we'll help you [get started](zfs/zfs_overview.md) as well.
|
||||
|
|
|
@ -10,14 +10,14 @@ small box that sits in the corner and runs 24/7. These days, a NAS doesn't just
|
|||
only handle files, but also offers other services, for instance video streaming
|
||||
with [Plex](https://www.plex.tv/) or [Emby](https://emby.media/index.html). You
|
||||
can buy consumer NAS boxes from [various
|
||||
manifacturers](https://en.wikipedia.org/wiki/List_of_NAS_manufacturers) where
|
||||
manufacturers](https://en.wikipedia.org/wiki/List_of_NAS_manufacturers) where
|
||||
you just have to add the hard drives, or you can configure your own hardware and
|
||||
use open-source software as the operating system.
|
||||
use open-source software as the operating system.
|
||||
|
||||
One example of the second variant you'll see mentioned here is
|
||||
[FreeNAS](https://freenas.org/). It is based on
|
||||
[FreeBSD](https://www.freebsd.org/), which like Linux belongs to the family of
|
||||
Unix-like operating systems. One strength of FreeBSD/FreeNAS is that it
|
||||
Unix-like operating systems. One strength of FreeBSD/FreeNAS is that it
|
||||
includes the powerful ZFS file system
|
||||
([OpenZFS](http://www.open-zfs.org/wiki/Main_Page), to be exact). However, it
|
||||
does not support the [Docker](https://www.docker.com/) containers the way Linux
|
||||
|
@ -30,7 +30,7 @@ using Docker on Linux with ZFS. This is possible because the
|
|||
technologies. As the name says, Ansible-NAS uses
|
||||
[Ansible](https://www.ansible.com/) server automation which is usually deployed
|
||||
on big multi-machine enterprise systems, not small home servers the size of a
|
||||
breadbox.
|
||||
breadbox.
|
||||
|
||||
## Before you take the plunge
|
||||
|
||||
|
@ -38,12 +38,12 @@ The commercial NAS vendors try to make setting up and running a NAS as simple
|
|||
and painless as possible - for a fee, obviously. The open-source NAS software
|
||||
providers have lots of resources to help you get started with your own hardware.
|
||||
FreeNAS for instance comes with extensive documentation, good introductions to
|
||||
ZFS and other topics, and a large community to lean on.
|
||||
ZFS and other topics, and a large community to lean on.
|
||||
|
||||
With Ansible-NAS, at this point at least, you're pretty much on your own. Though
|
||||
there is a [Gitter](https://gitter.im/Ansible-NAS/Chat) chat room (see
|
||||
[support](support.md)), you're expected to have some familiarity with the
|
||||
technologies involved and be able to set up the basic stuff yourself.
|
||||
technologies involved and be able to set up the basic stuff yourself.
|
||||
|
||||
As a to-do list, before you can even install Ansible-NAS, you'll have to:
|
||||
|
||||
|
@ -65,13 +65,13 @@ As a to-do list, before you can even install Ansible-NAS, you'll have to:
|
|||
You will probably want to install a specialized filesystem for bulk storage such
|
||||
as [ZFS](http://www.open-zfs.org/wiki/Main_Page) or
|
||||
[Btrfs](https://btrfs.wiki.kernel.org/index.php/Main_Page). Both offer features
|
||||
such as snapshots, checksumming and scrubing to protect your data against
|
||||
such as snapshots, checksumming and scrubbing to protect your data against
|
||||
bitrot, ransomware and other nasties. Ansible-NAS historically prefers **ZFS**
|
||||
because this lets you swap storage pools with
|
||||
[FreeNAS](https://freenas.org/zfs/). A [brief introduction](zfs/zfs_overview.md)
|
||||
to ZFS is included in the Ansible-NAS documentation, as well as [an
|
||||
example](zfs/zfs_configuration.md) of a very simple ZFS setup.
|
||||
|
||||
|
||||
After that, you can continue with the actual [installation](installation.md) of
|
||||
Ansible-NAS.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ So you've installed Ansible-NAS. Now what?
|
|||
The first thing to do is to configure [Heimdall](https://heimdall.site/) as the
|
||||
dashboard of your new NAS, because most of the applications included come with a
|
||||
web interface. Heimdall lets you create "apps" for them which appear as little
|
||||
icons on the screen.
|
||||
icons on the screen.
|
||||
|
||||
To add applications to Heimdall, you'll need the IP address of your NAS. If you
|
||||
don't know it for some reason, you will have to look up using the console with
|
||||
|
@ -14,10 +14,11 @@ device, will show the address. Another alternative is to make sure
|
|||
`.local` to your machines name, such as `ssh tardis.local`. Then you can use the
|
||||
`ip a` command again.
|
||||
|
||||
Next, you need the application's port. You can test the combination of address
|
||||
and port in your browser by typing them joined by a colon. For instance, for
|
||||
Glances on a machine with the IPv4 address 192.168.1.2, the full address would
|
||||
be `http://192.168.1.2:61208`. Once you are sure it works, use this address and
|
||||
Next, you need the application's port, which you can look up in the [list of
|
||||
ports](configuration/application_ports.md). You can test the combination of address and port
|
||||
in your browser by typing them joined by a colon. For instance, for Glances on a
|
||||
machine with the IPv4 address 192.168.1.2, the full address would be
|
||||
`http://192.168.1.2:61208`. Once you are sure it works, use this address and
|
||||
port combination when creating the Heimdall icon.
|
||||
|
||||
[Glances](https://nicolargo.github.io/glances/) and
|
||||
|
|
|
@ -59,14 +59,14 @@ The options from simple to complex are:
|
|||
**NAME**: ZFS pools traditionally take their names from characters in the [The
|
||||
Matrix](https://www.imdb.com/title/tt0133093/fullcredits). The two most common
|
||||
are `tank` and `dozer`. Whatever you use, it should be short - think `ash`, not
|
||||
`xenomorph`.
|
||||
`xenomorph`.
|
||||
|
||||
**DRIVES**: The Linux command `lsblk` will give you a quick overview of the
|
||||
hard drives in the system. However, we don't pass the drive specification in the
|
||||
format `/dev/sde` because this is not persistent. Instead,
|
||||
[always use](https://github.com/zfsonlinux/zfs/wiki/FAQ#selecting-dev-names-when-creating-a-pool)
|
||||
the output of `ls /dev/disk/by-id/` to find the drives' IDs.
|
||||
|
||||
|
||||
**ASHIFT**: This is required to pass the [sector
|
||||
size](https://github.com/zfsonlinux/zfs/wiki/FAQ#advanced-format-disks) of the
|
||||
drive to ZFS for optimal performance. You might have to do this by hand because
|
||||
|
@ -179,7 +179,7 @@ pre-compressed files - should probably take the exact same parameters.
|
|||
### Downloads
|
||||
|
||||
For downloads, we can leave most of the default parameters the way they are.
|
||||
|
||||
|
||||
```
|
||||
sudo zfs create tank/downloads
|
||||
sudo zfs set exec=off tank/downloads
|
||||
|
@ -224,7 +224,146 @@ ZED_NOTIFY_VERBOSE=1
|
|||
If `zed` is not enabled, you might have to run `systemctl enable zed`. You can
|
||||
test the setup by manually starting a scrub with `sudo zpool scrub tank`.
|
||||
|
||||
## Setting up automatic snapshots
|
||||
|
||||
See [sanoid](https://github.com/jimsalterjrs/sanoid/) as a tool for snapshot
|
||||
management.
|
||||
## Snapshots
|
||||
|
||||
Snapshots create a "frozen" version of a filesystem, providing a safe copy of
|
||||
the contents. Correctly configured, they provide good protection against
|
||||
accidental deletion and certain types of attacks such as ransomware. On
|
||||
copy-on-write (COW) filesystems such as ZFS, they are cheap and fast to create.
|
||||
It is very rare that you _won't_ want snapshots.
|
||||
|
||||
> Snapshots do not replace the need for backups. Nothing replaces the need for
|
||||
> backups except more backups.
|
||||
|
||||
|
||||
### Managing snapshots by hand
|
||||
|
||||
If you have data in a filesystem that never or very rarely changes, it might be
|
||||
easiest to just take a snapshot by hand after every major change. Use the `zfs
|
||||
snapshot` command with the name of the filesystem combined with an identifier
|
||||
separated by the `@` sign. Traditionally, this somehow includes the date of the
|
||||
snapshot, usually in some variant of the [ISO
|
||||
8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
|
||||
```
|
||||
zfs snapshot tank/movies@2019-04-24
|
||||
```
|
||||
|
||||
To see the list of snapshots in the system, run
|
||||
|
||||
```
|
||||
zfs list -t snapshot
|
||||
```
|
||||
|
||||
To revert ("roll back") to the previous snapshot, use the `zfs rollback`
|
||||
command.
|
||||
|
||||
```
|
||||
zfs rollback tank/movies@2019-04-24
|
||||
```
|
||||
|
||||
By default, you can only roll back to the most recent snapshot. Anything before
|
||||
then requires trickery outside the scope of this document. Finally, to get rid
|
||||
of a snapshot, use the `zfs destroy` command.
|
||||
|
||||
```
|
||||
zfs destroy tank/movies@2019-04-24
|
||||
```
|
||||
|
||||
> Be **very** careful with `destroy`. If you leave out the snapshot identifier
|
||||
> and only list the filesystem - in our example, `tank/movies` - the filesystem
|
||||
> itself will immediately be destroyed. There will be no confirmation prompt,
|
||||
> because ZFS doesn't believe in that sort of thing.
|
||||
|
||||
|
||||
### Managing snapshots with Sanoid
|
||||
|
||||
Usually, you'll want the process of creating new and deleting old snapshots to
|
||||
be automatic, especially on filesystems that change frequently. One tool for
|
||||
this is [sanoid](https://github.com/jimsalterjrs/sanoid/). There are various
|
||||
instructions for setting it up, the following is based on notes from
|
||||
[SvennD](https://www.svennd.be/zfs-snapshots-of-proxmox-using-sanoid/). For this
|
||||
example, we'll assume we have a single dataset `tank/movies` that holds, ah,
|
||||
movies.
|
||||
|
||||
First, we install sanoid to the `/opt` directory. This assumes that Perl itself
|
||||
is already installed.
|
||||
|
||||
```
|
||||
sudo apt install libconfig-inifiles-perl
|
||||
cd /opt
|
||||
sudo git clone https://github.com/jimsalterjrs/sanoid
|
||||
```
|
||||
|
||||
It is probably easiest to link sanoid to `/usr/sbin`:
|
||||
|
||||
```
|
||||
sudo ln /opt/sanoid/sanoid /usr/sbin/
|
||||
```
|
||||
|
||||
Then we need to setup the configuration files.
|
||||
|
||||
```
|
||||
sudo mkdir /etc/sanoid
|
||||
sudo cp /opt/sanoid/sanoid.conf /etc/sanoid/sanoid.conf
|
||||
sudo cp /opt/sanoid/sanoid.defaults.conf /etc/sanoid/sanoid.defaults.conf
|
||||
```
|
||||
|
||||
We don't change the defaults file, but it has to be copied to the folder anyway.
|
||||
Next, we edit the `/etc/sanoid/sanoid.conf` configuration file in two steps: We
|
||||
design the "templates" and then tell sanoid which filesystems to use it on.
|
||||
|
||||
The configuration file included with sanoid contains a "production" template for
|
||||
filesystems that change frequently. For media files, we assume that there is not
|
||||
going to be that much change from day-to-day, and especially there will be very
|
||||
few deletions. We use snapshots because this provides protection against
|
||||
cryptolocker attacks and against accidental deletions.
|
||||
|
||||
> Again, snapshots, even lots of snapshots, do not replace backups.
|
||||
|
||||
For our example, we configure for two hourly snapshots (against "oh crap"
|
||||
deletions), 31 daily, one monthly and one yearly snapshot.
|
||||
|
||||
```
|
||||
[template_media]
|
||||
frequently = 0
|
||||
hourly = 2
|
||||
daily = 31
|
||||
monthly = 1
|
||||
yearly = 1
|
||||
autosnap = yes
|
||||
autoprune = yes
|
||||
```
|
||||
|
||||
That might seem like a bunch of daily snapshots, but remember, if nothing has
|
||||
changed, a ZFS snapshot is basically free.
|
||||
|
||||
Once we have an entry for the template, we assign it to the filesystem.
|
||||
|
||||
```
|
||||
[tank/movies]
|
||||
use_template = media
|
||||
```
|
||||
|
||||
Finally, we edit `/etc/crontab` to run sanoid every five minutes:
|
||||
|
||||
```
|
||||
*/5 * * * * root /usr/sbin/sanoid --cron
|
||||
```
|
||||
|
||||
After five minutes, you should see the first snapshots (use `zfs list -t
|
||||
snapshot` again). The list will look something like this mock example:
|
||||
|
||||
```
|
||||
NAME USED AVAIL REFER MOUNTPOINT
|
||||
tank/movies@autosnap_2019-05-17_13:55:01_yearly 0B - 1,53G -
|
||||
tank/movies@autosnap_2019-05-17_13:55:01_monthly 0B - 1,53G -
|
||||
tank/movies@autosnap_2019-05-17_13:55:01_daily 0B - 1,53G -
|
||||
```
|
||||
|
||||
Note that the snapshots use no storage, because we haven't changed anything.
|
||||
|
||||
This is a very simple use of sanoid. Other functions include running scripts
|
||||
before and after snapshots, and setups to help with backups. See the included
|
||||
configuration files for examples.
|
||||
|
|
|
@ -12,7 +12,7 @@ manager originally created by Sun Microsystems starting in 2001. First released
|
|||
in 2005 for OpenSolaris, Oracle later bought Sun and switched to developing ZFS
|
||||
as closed source software. An open source fork took the name
|
||||
[OpenZFS](http://www.open-zfs.org/wiki/Main_Page), but is still called "ZFS" for
|
||||
short. It runs on Linux, FreeBSD, illumos and other platforms.
|
||||
short. It runs on Linux, FreeBSD, illumos and other platforms.
|
||||
|
||||
ZFS aims to be the ["last word in
|
||||
filesystems"](https://blogs.oracle.com/bonwick/zfs:-the-last-word-in-filesystems),
|
||||
|
@ -65,7 +65,7 @@ Pools do not directly consist of hard disks or SSDs. Instead, drives are
|
|||
organized as **virtual devices** (VDEVs). This is where the physical redundancy
|
||||
in ZFS is located. Drives in a VDEV can be "mirrored" or combined as "RaidZ",
|
||||
roughly the equivalent of RAID5. These VDEVs are then combined into a pool by the
|
||||
administrator. The command might look something like this:
|
||||
administrator. The command might look something like this:
|
||||
|
||||
```
|
||||
sudo zpool create tank mirror /dev/sda /dev/sdb
|
||||
|
@ -96,7 +96,7 @@ with ransomware, you can simply laugh maniacally and revert to the old version:
|
|||
|
||||
Of course, you would lose any texts you might have added to the filesystem
|
||||
between that snapshot and now. Usually, you'll have some form of **automatic
|
||||
snapshot administration** configured.
|
||||
snapshot administration** configured.
|
||||
|
||||
To detect bitrot and other data defects, ZFS periodically runs **scrubs**: The
|
||||
system compares the available copies of each data record with their checksums.
|
||||
|
@ -130,7 +130,7 @@ wrong. Partially this is because it has been in use for almost 15 years now and
|
|||
things change, partially it is the result of being used on different operating
|
||||
systems which have minor differences under the hood. Also, Google searches tend
|
||||
to first return the Oracle documentation for their closed source ZFS variant,
|
||||
which is increasingly diverging from the open source OpenZFS standard.
|
||||
which is increasingly diverging from the open source OpenZFS standard.
|
||||
|
||||
To clear up some of the most common misunderstandings:
|
||||
|
||||
|
@ -162,7 +162,7 @@ This is another case where a recommendation has been taken as a requirement. To
|
|||
quote the [ZFS on Linux
|
||||
FAQ](https://github.com/zfsonlinux/zfs/wiki/FAQ#do-i-have-to-use-ecc-memory-for-zfs)
|
||||
again:
|
||||
|
||||
|
||||
> Using ECC memory for OpenZFS is strongly recommended for enterprise
|
||||
> environments where the strongest data integrity guarantees are required.
|
||||
> Without ECC memory rare random bit flips caused by cosmic rays or by faulty
|
||||
|
@ -176,7 +176,7 @@ and ZFS is no exception. However, there is absolutely no requirement for ZFS to
|
|||
have ECC RAM. If you just don't care about the danger of random bit flips
|
||||
because, hey, you can always just download [Night of the Living
|
||||
Dead](https://archive.org/details/night_of_the_living_dead) all over again,
|
||||
you're prefectly free to use normal RAM. If you do use ECC RAM, make sure your
|
||||
you're perfectly free to use normal RAM. If you do use ECC RAM, make sure your
|
||||
processor and motherboard support it.
|
||||
|
||||
### No, the SLOG is not really a write cache
|
||||
|
|
|
@ -10,11 +10,15 @@
|
|||
# settings.
|
||||
traefik_enabled: false
|
||||
|
||||
# BitTorrent
|
||||
# Downloading
|
||||
# If you plan to use Transmission with OpenVPN, you'll need to copy group_vars/vpn_credentials.yml.dist
|
||||
# to group_vars/vpn_credentials.yml, then update it with your own settings.
|
||||
transmission_with_openvpn_enabled: false
|
||||
transmission_enabled: false
|
||||
nzbget_enabled: false
|
||||
|
||||
# Downloaders
|
||||
pyload_enabled: false
|
||||
|
||||
# Plex
|
||||
plex_enabled: false
|
||||
|
@ -67,6 +71,9 @@ bitwarden_enabled: false
|
|||
# Finance
|
||||
firefly_enabled: false
|
||||
|
||||
# Wallabag
|
||||
wallabag_enabled: false
|
||||
|
||||
###
|
||||
### General
|
||||
###
|
||||
|
@ -162,7 +169,7 @@ samba_shares:
|
|||
public: yes
|
||||
writable: yes
|
||||
browsable: yes
|
||||
path: "{{ samba_shares_root }}/music"
|
||||
path: "{{ music_root }}"
|
||||
|
||||
- name: podcasts
|
||||
comment: 'Podcasts'
|
||||
|
@ -170,7 +177,7 @@ samba_shares:
|
|||
public: yes
|
||||
writable: yes
|
||||
browsable: yes
|
||||
path: "{{ samba_shares_root }}/podcasts"
|
||||
path: "{{ podcasts_root }}"
|
||||
|
||||
- name: dump
|
||||
comment: 'File dump'
|
||||
|
@ -286,6 +293,14 @@ transmission_user_id: 0
|
|||
transmission_group_id: 0
|
||||
transmission_local_network: "192.168.1.0/24"
|
||||
|
||||
###
|
||||
### pyLoad
|
||||
###
|
||||
pyload_available_externally: "false"
|
||||
pyload_config_directory: "{{ docker_home }}/pyload"
|
||||
pyload_download_directory: "{{ downloads_root }}"
|
||||
pyload_user_id: 0
|
||||
pyload_group_id: 0
|
||||
|
||||
###
|
||||
### Plex
|
||||
|
@ -533,4 +548,19 @@ bitwarden_allow_signups: false
|
|||
### Firefly
|
||||
###
|
||||
firefly_available_externally: "false"
|
||||
firefly_data_directory: "{{ docker_home }}/firefly"
|
||||
firefly_data_directory: "{{ docker_home }}/firefly"
|
||||
|
||||
###
|
||||
### Nzbget
|
||||
###
|
||||
nzbget_available_externally: "false"
|
||||
nzbget_data_directory: "{{ docker_home }}/nzbget"
|
||||
nzbget_download_directory: "{{ downloads_root }}"
|
||||
nzbget_user_id: 0
|
||||
nzbget_group_id: 0
|
||||
|
||||
###
|
||||
### Wallabag
|
||||
###
|
||||
wallabag_available_externally: "false"
|
||||
wallabag_data_directory: "{{ docker_home }}/wallabag"
|
12
nas.yml
12
nas.yml
|
@ -68,6 +68,10 @@
|
|||
when: (transmission_with_openvpn_enabled | default(False))
|
||||
tags: transmission
|
||||
|
||||
- import_tasks: tasks/pyload.yml
|
||||
when: (pyload_enabled | default(False))
|
||||
tags: pyload
|
||||
|
||||
- import_tasks: tasks/thelounge.yml
|
||||
when: (thelounge_enabled | default(False))
|
||||
tags: thelounge
|
||||
|
@ -155,3 +159,11 @@
|
|||
- import_tasks: tasks/bitwarden.yml
|
||||
when: (bitwarden_enabled | default(False))
|
||||
tags: bitwarden
|
||||
|
||||
- import_tasks: tasks/nzbget.yml
|
||||
when: (nzbget_enabled | default(False))
|
||||
tags: nzbget
|
||||
|
||||
- import_tasks: tasks/wallabag.yml
|
||||
when: (wallabag_enabled | default(False))
|
||||
tags: wallabag
|
29
tasks/nzbget.yml
Normal file
29
tasks/nzbget.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- name: Create NZBget Directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- "{{ nzbget_data_directory }}"
|
||||
|
||||
- name: NZBGet
|
||||
docker_container:
|
||||
name: nzbget
|
||||
image: linuxserver/nzbget
|
||||
pull: true
|
||||
volumes:
|
||||
- "{{ nzbget_download_directory }}:/downloads:rw"
|
||||
- "{{ nzbget_data_directory }}:/config:rw"
|
||||
ports:
|
||||
- "6789:6789"
|
||||
env:
|
||||
TZ: "{{ ansible_nas_timezone }}"
|
||||
PUID: "{{ nzbget_user_id }}"
|
||||
PGID: "{{ nzbget_group_id }}"
|
||||
restart_policy: unless-stopped
|
||||
memory: 1g
|
||||
labels:
|
||||
traefik.backend: "nzbget"
|
||||
traefik.frontend.rule: "Host:nzbget.{{ ansible_nas_domain }}"
|
||||
traefik.enable: "{{ nzbget_available_externally }}"
|
||||
traefik.port: "6789"
|
31
tasks/pyload.yml
Normal file
31
tasks/pyload.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
- name: Create pyLoad Directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
# mode: 0755
|
||||
with_items:
|
||||
- "{{ pyload_config_directory }}"
|
||||
- "{{ pyload_download_directory }}"
|
||||
|
||||
- name: pyLoad Docker Container
|
||||
docker_container:
|
||||
name: pyload
|
||||
image: writl/pyload
|
||||
pull: true
|
||||
volumes:
|
||||
- "{{ pyload_config_directory }}:/opt/pyload/pyload-config:rw"
|
||||
- "{{ pyload_download_directory }}:/opt/pyload/Downloads:rw"
|
||||
ports:
|
||||
- "8000:8000"
|
||||
env:
|
||||
TZ: "{{ ansible_nas_timezone }}"
|
||||
UID: "{{ pyload_user_id }}"
|
||||
GID: "{{ pyload_group_id }}"
|
||||
restart_policy: unless-stopped
|
||||
memory: 1g
|
||||
labels:
|
||||
traefik.backend: "pyload"
|
||||
traefik.frontend.rule: "Host:pyload.{{ ansible_nas_domain }}"
|
||||
traefik.enable: "{{ pyload_available_externally }}"
|
||||
traefik.port: "8000"
|
28
tasks/wallabag.yml
Normal file
28
tasks/wallabag.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
- name: Create Wallabag Directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- "{{ wallabag_data_directory }}/data"
|
||||
- "{{ wallabag_data_directory }}/images"
|
||||
|
||||
- name: Wallabag Docker Container
|
||||
docker_container:
|
||||
name: wallabag
|
||||
image: wallabag/wallabag:latest
|
||||
pull: true
|
||||
volumes:
|
||||
- "{{ wallabag_data_directory }}/data:/var/www/wallabag/data:rw"
|
||||
- "{{ wallabag_data_directory }}/images:/var/www/wallabag/web/assets/images:rw"
|
||||
ports:
|
||||
- "7780:80"
|
||||
env:
|
||||
SYMFONY__ENV__DOMAIN_NAME: "https://wallabag.{{ ansible_nas_domain }}"
|
||||
restart_policy: unless-stopped
|
||||
labels:
|
||||
traefik.backend: "wallabag"
|
||||
traefik.frontend.rule: "Host:wallabag.{{ ansible_nas_domain }}"
|
||||
traefik.enable: "{{ wallabag_available_externally }}"
|
||||
traefik.port: "80"
|
||||
traefik.frontend.headers.SSLRedirect: "true"
|
||||
memory: 1g
|
|
@ -184,6 +184,7 @@ onDemand = false # create certificate when container is created
|
|||
"couchpotato.{{ ansible_nas_domain }}",
|
||||
"duplicati.{{ ansible_nas_domain }}",
|
||||
"emby.{{ ansible_nas_domain }}",
|
||||
"firefly.{{ ansible_nas_domain }}",
|
||||
"gitea.{{ ansible_nas_domain }}",
|
||||
"glances.{{ ansible_nas_domain }}",
|
||||
"grafana.{{ ansible_nas_domain }}",
|
||||
|
@ -193,8 +194,10 @@ onDemand = false # create certificate when container is created
|
|||
"miniflux.{{ ansible_nas_domain }}",
|
||||
"netdata.{{ ansible_nas_domain }}",
|
||||
"nextcloud.{{ ansible_nas_domain }}",
|
||||
"nzbget.{{ ansible_nas_domain }}",
|
||||
"plex.{{ ansible_nas_domain }}",
|
||||
"portainer.{{ ansible_nas_domain }}",
|
||||
"pyload.{{ ansible_nas_domain }}",
|
||||
"radarr.{{ ansible_nas_domain }}",
|
||||
"sickchill.{{ ansible_nas_domain }}",
|
||||
"sonarr.{{ ansible_nas_domain }}",
|
||||
|
@ -202,4 +205,5 @@ onDemand = false # create certificate when container is created
|
|||
"thelounge.{{ ansible_nas_domain }}",
|
||||
"transmission.{{ ansible_nas_domain }}",
|
||||
"transmission-openvpn.{{ ansible_nas_domain }}",
|
||||
"wallabag.{{ ansible_nas_domain }}",
|
||||
"znc.{{ ansible_nas_domain }}"]
|
||||
|
|
Loading…
Reference in a new issue