mirror of
https://github.com/davestephens/ansible-nas
synced 2024-11-15 00:17:10 +00:00
Merge branch 'master' into fix-file-location-options
This commit is contained in:
commit
955a3a7dc6
12 changed files with 146 additions and 95 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,8 +1,5 @@
|
|||
group_vars/all.yml
|
||||
group_vars/vpn_credentials.yml
|
||||
tests/test.yml
|
||||
site
|
||||
inventory
|
||||
.vagrant
|
||||
roles
|
||||
*.retry
|
||||
|
|
|
@ -16,7 +16,6 @@ install:
|
|||
- pip install mkdocs-material
|
||||
|
||||
script:
|
||||
- cp ${PWD}/group_vars/all.yml.dist ${PWD}/group_vars/all.yml
|
||||
- ansible-lint ${PWD}/nas.yml
|
||||
- ${PWD}/tests/test.sh
|
||||
- mkdocs build
|
||||
|
@ -29,11 +28,11 @@ deploy:
|
|||
keep-history: true
|
||||
on:
|
||||
branch: master
|
||||
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/bd52710d464f2b82036b
|
||||
on_success: change
|
||||
on_failure: always
|
||||
on_start: never
|
||||
on_start: never
|
||||
|
|
24
README.md
24
README.md
|
@ -12,7 +12,6 @@ Ansible config and a bunch of Docker containers.
|
|||
* 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, Bazarr, Lidarr
|
||||
* Media streaming via Plex or Emby
|
||||
* Music streaming with Airsonic
|
||||
|
@ -31,7 +30,7 @@ Ansible config and a bunch of Docker containers.
|
|||
* A dual panel local file manager
|
||||
* Self-service media request web application
|
||||
|
||||
### Docker Containers Used
|
||||
### Available Applications
|
||||
|
||||
* [Airsonic](https://airsonic.github.io/) - catalog and stream music
|
||||
* [Bazarr](https://github.com/morpheus65535/bazarr) - companion to Radarr and Sonarr for downloading subtitles
|
||||
|
@ -97,23 +96,13 @@ Ansible NAS doesn't set up your disk partitions, primarily because getting it wr
|
|||
That aside, configuring partitions is usually a one-time (or very infrequent) event, so there's not much to be
|
||||
gained by automating it. Check out the [docs](https://davestephens.github.io/ansible-nas) for recommended setups.
|
||||
|
||||
## Quick Start
|
||||
## Installation
|
||||
|
||||
: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:
|
||||
See [Installation](https://davestephens.github.io/ansible-nas/installation/).
|
||||
|
||||
1. Enable the Ubuntu Universe repository: `sudo add-apt-repository universe`
|
||||
2. Install Ansible: `sudo apt install ansible`
|
||||
3. `git clone https://github.com/davestephens/ansible-nas.git && cd ansible-nas`
|
||||
4. Copy `group_vars/all.yml.dist` to `group_vars/all.yml`.
|
||||
5. Open up `group_vars/all.yml` and follow the instructions there for configuring your Ansible NAS.
|
||||
6. If you plan to use Transmission with OpenVPN, also copy `group_vars/vpn_credentials.yml.dist` to
|
||||
`group_vars/vpn_credentials.yml` and fill in your settings.
|
||||
7. Copy `inventory.dist` to `inventory` and update it.
|
||||
8. Install the dependent roles: `ansible-galaxy install -r requirements.yml` (you might need sudo to install Ansible roles)
|
||||
9. Run the playbook - something like `ansible-playbook -i inventory nas.yml -b -K` should do you nicely.
|
||||
## Upgrading
|
||||
|
||||
**The way Ansible-NAS configuration is structured has changed!** See [Upgrading](https://davestephens.github.io/ansible-nas/upgrading/) for more information. See the **Getting Help** section if you get stuck.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
@ -150,7 +139,6 @@ Getting help is easy! You can:
|
|||
|
||||
Contributions are always welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
If you've enjoyed Ansible-NAS as much as I do working on it, please consider [buying me a coffee](https://ko-fi.com/davestephens) :coffee:
|
||||
|
|
|
@ -13,5 +13,14 @@ Transmission's web interface can be found at http://ansible_nas_host_or_ip:9091
|
|||
|
||||
## Specific Configuration
|
||||
|
||||
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.
|
||||
If you enable Transmission with OpenVPN, you'll need to add the following to your inventory `all.yml`:
|
||||
|
||||
```
|
||||
openvpn_username: super_secret_username
|
||||
openvpn_password: super_secret_password
|
||||
openvpn_provider: NORDVPN
|
||||
openvpn_config: uk686.nordvpn.com.udp
|
||||
```
|
||||
|
||||
See https://hub.docker.com/r/haugene/transmission-openvpn/ for supported VPN providers.
|
||||
|
||||
|
|
|
@ -1,24 +1,30 @@
|
|||
:skull: :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: :skull: :skull:
|
||||
|
||||
You can run Ansible-NAS from the computer you plan to use for your NAS, or from a remote controlling machine. The steps for deployment are exactly the same, just pay attention to editing the inventory file in step 7.
|
||||
|
||||
1. Enable the Ubuntu Universe repository: `sudo add-apt-repository universe`
|
||||
1. Enable the Ubuntu Universe repository:
|
||||
|
||||
1. Install Ansible: `sudo apt install ansible`
|
||||
`sudo add-apt-repository universe`
|
||||
|
||||
1. `git clone https://github.com/davestephens/ansible-nas.git && cd ansible-nas`
|
||||
2. Install Ansible:
|
||||
|
||||
1. Copy `group_vars/all.yml.dist` to `group_vars/all.yml`.
|
||||
`sudo apt install ansible`
|
||||
|
||||
1. Open up `group_vars/all.yml` and follow the instructions there for
|
||||
configuring your Ansible NAS.
|
||||
3. Clone Ansible-NAS:
|
||||
|
||||
1. If you plan to use Transmission with OpenVPN, also copy
|
||||
`group_vars/vpn_credentials.yml.dist` to `group_vars/vpn_credentials.yml` and
|
||||
fill in your settings.
|
||||
`git clone https://github.com/davestephens/ansible-nas.git && cd ansible-nas`
|
||||
|
||||
1. Copy `inventory.dist` to `inventory` and update it.
|
||||
4. Create your own inventory and config files by copying `inventories/sample` to your own directory:
|
||||
|
||||
1. Install the dependent roles: `ansible-galaxy install -r requirements.yml`
|
||||
(you might need sudo to install Ansible roles)
|
||||
`cp -rfp inventories/sample inventories/my-ansible-nas`
|
||||
|
||||
1. Run the playbook - something like `ansible-playbook -i inventory nas.yml -b
|
||||
-K` should do you nicely.
|
||||
5. Review `group_vars/all.yml`. Change settings by overriding them in `inventories/my-ansible-nas/group_vars/nas.yml`.
|
||||
|
||||
6. Update `inventories/my-ansible-nas/inventory`.
|
||||
|
||||
7. Install the dependent roles: `ansible-galaxy install -r requirements.yml` (you might need `sudo` to install Ansible roles).
|
||||
|
||||
8. Run the playbook - something like `ansible-playbook -i inventories/my-ansible-nas/inventory nas.yml -b -K` should do you nicely.
|
|
@ -1,3 +1,28 @@
|
|||
# Upgrading
|
||||
# Upgrading Ansible-NAS
|
||||
|
||||
## Upgrading from prior to January 2020 (`all.yml.dist` config style)
|
||||
|
||||
If you're upgrading from [this](https://github.com/davestephens/ansible-nas/commit/52c7fef3aba08e30331931747c81fb7b3bfd359a) commit or earlier, these instructions are relevant to you.
|
||||
|
||||
Rather than having to merge every new config line into your own `all.yml` file, now you only need to maintain the differences that are relevant to you in your own `nas.yml`, stored within an inventory directory. Your inventory `nas.yml` takes prescendence over `group_vars/all.yml`, which is how this setup works. `group_vars/all.yml` is now tracked as part of the repo.
|
||||
|
||||
This will make updates from `master` much simpler, as there will be no requirement to merge changes from `all.yml.dist` into your own `all.yml` any more. You simply pull from master, then add the bits you're interested in into your inventory `nas.yml`.
|
||||
|
||||
Instructions to upgrade from prior to January 2020 ([this]([this](https://github.com/davestephens/ansible-nas/commit/52c7fef3aba08e30331931747c81fb7b3bfd359a)) commit or earlier):
|
||||
|
||||
- Move your `group_vars/all.yml` somewhere safe.
|
||||
|
||||
- Pull from master. There shouldn't be any merge conflicts unless you've been hacking on the project.
|
||||
|
||||
- Create your own inventory and config files by copying `inventories/sample` to your own directory:
|
||||
|
||||
`cp -rfp inventories/sample inventories/my-ansible-nas`
|
||||
|
||||
Note that `my-ansible-nas` can be anything you want, but adjust the following instructions accordingly.
|
||||
|
||||
- Then:
|
||||
|
||||
- **Quick and Dirty:** Copy the contents of your `all.yml` into `inventories/my-ansible-nas/group_vars/nas.yml`.
|
||||
|
||||
- **Nice and Tidy:** Copy only the differences between your own `all.yml` and the distribution `group_vars/all.yml` into `inventories/my-ansible-nas/group_vars/nas.yml`. This is likely to be things like `ansible_nas_hostname`, `samba_shares`, `ansible_nas_timezone`, enabled applications, any application tweaks you've made in config etc.
|
||||
|
||||
Pull the latest Ansible-NAS repo, merge any new config sections from `group_vars/all.yml.dist` into your `group_vars/all.yml`, then run the playbook.
|
|
@ -1,45 +1,40 @@
|
|||
###
|
||||
### Ansible NAS Features
|
||||
###
|
||||
# Set these options to true or false to toggle specific features
|
||||
## ._____. .__
|
||||
## _____ ____ _____|__\_ |__ | | ____ ____ _____ ______
|
||||
## \__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/
|
||||
## / __ \| | \\___ \| || \_\ \ |_\ ___/ /_____/ | | \/ __ \_\___ \
|
||||
## (____ /___| /____ >__||___ /____/\___ > |___| (____ /____ >
|
||||
## \/ \/ \/ \/ \/ \/ \/ \/
|
||||
## a n s i b l e - n a s https://github.com/davestephens/ansible-nas
|
||||
|
||||
# External Access
|
||||
# Traefik will allow access to certain applications externally. To enable this you'll either; a domain name that points to your
|
||||
# home static IP address, the cloudflare with the cloudflare_ddns dynamic DNS container enabled, or use a dynamic DNS provider like no-ip.
|
||||
# You'll also need to map ports 80 and 443 from your router to your ansible-nas server, then enable the per-app "available_externally"
|
||||
# settings.
|
||||
traefik_enabled: false
|
||||
###
|
||||
### DO NOT EDIT THIS FILE!
|
||||
### Add your customisations to inventories/<your_inventory>/group_vars/nas.yml
|
||||
###
|
||||
|
||||
###
|
||||
### Ansible-NAS Applications
|
||||
###
|
||||
|
||||
# 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_with_openvpn_enabled: false # Please see docs about how to set VPN credentials
|
||||
transmission_enabled: false
|
||||
nzbget_enabled: false
|
||||
|
||||
# Downloaders
|
||||
pyload_enabled: false
|
||||
|
||||
# Plex
|
||||
# Media Serving
|
||||
plex_enabled: false
|
||||
tautulli_enabled: false
|
||||
|
||||
# Emby
|
||||
emby_enabled: false
|
||||
|
||||
# Jellyfin
|
||||
jellyfin_enabled: false
|
||||
|
||||
# minidlna
|
||||
minidlna_enabled: false
|
||||
|
||||
# Media Sourcing
|
||||
sonarr_enabled: false
|
||||
sonarr_enabled: false # tv
|
||||
sickchill_enabled: false
|
||||
couchpotato_enabled: false
|
||||
radarr_enabled: false
|
||||
get_iplayer_enabled: false
|
||||
jackett_enabled: false
|
||||
minidlna_enabled: false
|
||||
jellyfin_enabled: false
|
||||
emby_enabled: false
|
||||
bazarr_enabled: false
|
||||
ombi_enabled: false
|
||||
lidarr_enabled: false
|
||||
|
@ -52,8 +47,8 @@ mymediaforalexa_enabled: false
|
|||
miniflux_enabled: false
|
||||
|
||||
# System Management
|
||||
heimdall_enabled: true
|
||||
portainer_enabled: true
|
||||
heimdall_enabled: false
|
||||
portainer_enabled: false
|
||||
glances_enabled: false
|
||||
stats_enabled: false
|
||||
guacamole_enabled: false
|
||||
|
@ -65,9 +60,11 @@ cloudcmd_enabled: false
|
|||
# Backup & Restore
|
||||
duplicati_enabled: false
|
||||
nextcloud_enabled: false
|
||||
gitea_enabled: false
|
||||
timemachine_enabled: false
|
||||
|
||||
# Software build and CI
|
||||
gitea_enabled: false
|
||||
|
||||
# IRC
|
||||
znc_enabled: false
|
||||
thelounge_enabled: false
|
||||
|
@ -87,7 +84,7 @@ mosquitto_enabled: false
|
|||
homebridge_enabled: false
|
||||
openhab_enabled: false
|
||||
|
||||
# Calibre
|
||||
# Books
|
||||
calibre_enabled: false
|
||||
|
||||
# Ubooquity
|
||||
|
@ -96,6 +93,13 @@ ubooquity_enabled: false
|
|||
# Joomla
|
||||
joomla_enabled: false
|
||||
|
||||
# External Access
|
||||
# Traefik will allow access to certain applications externally. To enable this you'll either; a domain name that points to your
|
||||
# home static IP address, the cloudflare with the cloudflare_ddns dynamic DNS container enabled, or use a dynamic DNS provider like no-ip.
|
||||
# You'll also need to map ports 80 and 443 from your router to your ansible-nas server, then enable the per-app "available_externally"
|
||||
# settings.
|
||||
traefik_enabled: false
|
||||
|
||||
###
|
||||
### General
|
||||
###
|
||||
|
@ -115,7 +119,7 @@ ansible_nas_user: david
|
|||
# Your email and domain, used for Let's Encrypt SSL certs
|
||||
ansible_nas_email: me@example.com
|
||||
|
||||
# Applications will have subdomain SSL certificates created, e.g. ansible-nas.<your-domain>, nextcloud.<your-domain>
|
||||
# Applications will have subdomain SSL certificates created if Traefik is enabled, e.g. ansible-nas.<your-domain>, nextcloud.<your-domain>
|
||||
ansible_nas_domain: example.com
|
||||
|
||||
###
|
||||
|
@ -280,9 +284,6 @@ cloudflare_email: "{{ ansible_nas_email }}"
|
|||
# Cloudflare 'Global API Key', can be found on the 'My Profile' page
|
||||
cloudflare_api_key: abcdeabcdeabcdeabcde1234512345
|
||||
|
||||
##################################################################
|
||||
###### You shouldn't need to edit anything below this point ######
|
||||
##################################################################
|
||||
|
||||
###
|
||||
### General
|
||||
|
@ -304,6 +305,7 @@ ansible_python_interpreter: /usr/bin/python3
|
|||
###
|
||||
# Seems to break browsing of the \\server-name shares root when enabled
|
||||
samba_mitigate_cve_2017_7494: false
|
||||
|
||||
# Enable apple exentensions for compatibility with apple clients
|
||||
samba_apple_extensions: yes
|
||||
|
||||
|
@ -343,6 +345,14 @@ transmission_user_id: "0"
|
|||
transmission_group_id: "0"
|
||||
transmission_local_network: "192.168.1.0/24"
|
||||
|
||||
# Transmission VPN Credentials
|
||||
# If you're using Transmission with a VPN, you'll need to set these credentials.
|
||||
# See https://hub.docker.com/r/dceschmidt/openvpn-client/ for supported VPN providers.
|
||||
openvpn_username: leisure-suit-larry
|
||||
openvpn_password: secretpassword
|
||||
openvpn_provider: AWESOMEVPNPROVIDER
|
||||
openvpn_config: United-Kingdom
|
||||
|
||||
###
|
||||
### Joomla
|
||||
###
|
||||
|
@ -359,7 +369,6 @@ pyload_download_directory: "{{ downloads_root }}"
|
|||
pyload_user_id: "0"
|
||||
pyload_group_id: "0"
|
||||
|
||||
|
||||
###
|
||||
### Plex
|
||||
###
|
|
@ -1,9 +0,0 @@
|
|||
###
|
||||
### VPN Credentials
|
||||
###
|
||||
# If you're using Transmission with a VPN, you'll need to set these credentials.
|
||||
# See https://hub.docker.com/r/haugene/transmission-openvpn/ for supported VPN providers.
|
||||
openvpn_username: super_secret_username
|
||||
openvpn_password: super_secret_password
|
||||
openvpn_provider: NORDVPN
|
||||
openvpn_config: uk686.nordvpn.com.udp
|
18
inventories/sample/group_vars/nas.yml
Normal file
18
inventories/sample/group_vars/nas.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
## ._____. .__
|
||||
## _____ ____ _____|__\_ |__ | | ____ ____ _____ ______
|
||||
## \__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/
|
||||
## / __ \| | \\___ \| || \_\ \ |_\ ___/ /_____/ | | \/ __ \_\___ \
|
||||
## (____ /___| /____ >__||___ /____/\___ > |___| (____ /____ >
|
||||
## \/ \/ \/ \/ \/ \/ \/ \/
|
||||
## a n s i b l e - n a s https://github.com/davestephens/ansible-nas
|
||||
|
||||
# Add your all.yml config overrides to this file. See group_vars/all.yml for all possible settings.
|
||||
|
||||
# Example options
|
||||
ansible_nas_hostname: ansible-nas
|
||||
ansible_nas_timezone: Etc/UTC
|
||||
|
||||
## Enable some applications
|
||||
heimdall_enabled: true
|
||||
portainer_enabled: true
|
||||
|
18
inventories/sample/inventory
Normal file
18
inventories/sample/inventory
Normal file
|
@ -0,0 +1,18 @@
|
|||
## ._____. .__
|
||||
## _____ ____ _____|__\_ |__ | | ____ ____ _____ ______
|
||||
## \__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/
|
||||
## / __ \| | \\___ \| || \_\ \ |_\ ___/ /_____/ | | \/ __ \_\___ \
|
||||
## (____ /___| /____ >__||___ /____/\___ > |___| (____ /____ >
|
||||
## \/ \/ \/ \/ \/ \/ \/ \/
|
||||
## a n s i b l e - n a s https://github.com/davestephens/ansible-nas
|
||||
|
||||
|
||||
[all]
|
||||
## Example when running from a remote workstation
|
||||
# ansible-nas ansible_host=192.168.1.30
|
||||
|
||||
## Example when running directly on your Ansible-NAS server
|
||||
# ansible-nas ansible_connection=local ansible_host=localhost
|
||||
|
||||
[nas]
|
||||
ansible-nas
|
|
@ -1,6 +0,0 @@
|
|||
# Example for running it directly on NAS server
|
||||
# localhost ansible_connection=local
|
||||
|
||||
# Example using from remote workstation
|
||||
# [all]
|
||||
# 192.168.1.30
|
|
@ -1,7 +1,4 @@
|
|||
---
|
||||
- name: Include VPN credentials
|
||||
include_vars: group_vars/vpn_credentials.yml
|
||||
|
||||
- name: Create Transmission Directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
|
|
Loading…
Reference in a new issue