Merge branch 'master' into master

This commit is contained in:
David Stephens 2020-01-05 09:44:08 +00:00 committed by GitHub
commit 319c9b2309
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 114 additions and 55 deletions

View file

@ -21,7 +21,15 @@ A clear and concise description of what the bug is.
- Ansible-NAS Docker version (`docker --version` on the Ansible-NAS box): - Ansible-NAS Docker version (`docker --version` on the Ansible-NAS box):
- Latest Docker logs (`journalctl -u docker.service` on the Ansible-NAS box): - Latest Docker logs (`journalctl -u docker.service` on the Ansible-NAS box):
- Are you running the playbook from a remote box or the Ansible-NAS box itself? - Are you running the playbook from a remote box or the Ansible-NAS box itself?
- Vagrant version, if testing (`vagrant --version`) - Vagrant version, if testing (`vagrant --version`):
- Ansible-NAS filesystems (`df -hT` on the Ansible-NAS box):
- Mounted filesystems (`mount` on the Ansible-NAS box)
**all.yml Variables**
- `docker_image_directory`:
- `docker_home`:
- `docker_storage_driver`:
- `samba_shares_root`:
**Expected behavior** **Expected behavior**
What should happen? What should happen?

View file

@ -11,4 +11,15 @@ If you're adding a new application:
* Ensure that the new application is disabled by default. * Ensure that the new application is disabled by default.
* Add a documentation page to `docs/applications/` - use an existing application as an example. * Add a documentation page to `docs/applications/` - use an existing application as an example.
* Add the frontend port to `docs/configuration/application_ports.md`, ensuring you've not clashed with an existing application. * Add the frontend port to `docs/configuration/application_ports.md`, ensuring you've not clashed with an existing application.
## Things to bear in mind
* If you break the build with your PR, please fix it :)
* Pull requests that unintentionally touch files, or that show files as removed then re-added will be rejected.
* Please know that your efforts are appreciated, thanks! :+1:
# Development Environment
* Development of Ansible-NAS is carried out in [Visual Studio Code](https://code.visualstudio.com/) - you'll get some nice
recommended extensions and task setups if you do the same.

View file

@ -145,20 +145,8 @@ Getting help is easy! You can:
## Contributing ## Contributing
Contributions are welcome, please feel free to raise a PR! Contributions are always welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
* Restrict pull requests to one piece of functionality or bugfix at a time.
* Test your new functionality or bugfix using the included
`tests/test-vagrant.sh` script to spin up a test VM. Note that Ansible-NAS
requires Vagrant version 2.2.2 or later, so for stock Ubuntu 18.04.2, you will
have to download and install the newest version from
https://www.vagrantup.com/downloads.html.
* Run `ansible-lint` against the playbook before committing. (There is a VSCode
task set up to run the right command for you)
* Please know that your efforts are appreciated, thanks! :+1:
Development of Ansible-NAS is carried out in [Visual Studio Code](https://code.visualstudio.com/) - you'll get some nice
recommended extensions and task setups if you do the same.
## Support ## Support

View file

@ -0,0 +1,11 @@
# Homebridge
Homepage: [https://github.com/nfarina/homebridge](https://github.com/nfarina/homebridge)
Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.
## Usage
Set `homebridge_enabled: true` in your `group_vars/all.yml` file.
The Homebridge web interface can be found at http://ansible_nas_host_or_ip:8087. The default username and password is 'admin' - change this after your first login!

View file

@ -23,6 +23,7 @@ By default, applications can be found on the ports listed below.
| Guacamole | 8090 | | | Guacamole | 8090 | |
| Heimdall | 10080 | | | Heimdall | 10080 | |
| Home Assistant | 8123 | | | Home Assistant | 8123 | |
| Homebridge | 8087 | |
| Jackett | 9117 | | | Jackett | 9117 | |
| Jellyfin | 8896 | HTTP | | Jellyfin | 8896 | HTTP |
| Jellyfin | 8928 | HTTPS | | Jellyfin | 8928 | HTTPS |

View file

@ -102,24 +102,26 @@ Our new pool is named `tank` and is mirrored. To see information about it, use
`ashift`), use `sudo zpool destroy tank` and start over _now_ before it's too `ashift`), use `sudo zpool destroy tank` and start over _now_ before it's too
late. late.
### Pool default parameters ### Pool and filesystem properties
Setting pool-wide default parameters makes life easier when we create our Pools have properties that apply either to the pool itself or to filesystems
filesystems. To see them all, you can use the command `zfs get all tank`. Most created in the pool. You can use the command `zpool get all tank` to see the
are perfectly sensible, some you'll [want to pool properties and `zfs get all tank` to see the filesystem properties. Most
change](https://jrs-s.net/2018/08/17/zfs-tuning-cheat-sheet/): default values are perfecly sensible, some you'll [want to
change](https://jrs-s.net/2018/08/17/zfs-tuning-cheat-sheet/). Setting
defaults makes life easier when we create our filesystems.
``` ```
sudo zpool set autoexpand=on tank
sudo zfs set atime=off tank sudo zfs set atime=off tank
sudo zfs set compression=lz4 tank sudo zfs set compression=lz4 tank
sudo zfs set autoexpand=on tank
``` ```
The `atime` parameter means that your system updates a time stamp every time a `autoexpand=on` lets the pool grow when you add larger hard drives. `atime=off`
file is accessed, which uses a lot of resources. Usually, you don't care. means that your system won't update a time stamp every time a file is accessed,
something which would use a lot of resources. Usually, you don't care.
Compression is a no-brainer on modern CPUs and should be on by default (we will Compression is a no-brainer on modern CPUs and should be on by default (we will
discuss exceptions for compressed media files later). The `autoexpand` lets the discuss exceptions for compressed media files later).
pool grow when you add larger hard drives.
## Creating filesystems ## Creating filesystems

View file

@ -41,9 +41,6 @@ radarr_enabled: false
get_iplayer_enabled: false get_iplayer_enabled: false
jackett_enabled: false jackett_enabled: false
bazarr_enabled: false bazarr_enabled: false
# Ombi
ombi_enabled: false ombi_enabled: false
# Music # Music
@ -64,7 +61,6 @@ watchtower_enabled: false
cloudflare_ddns_enabled: false cloudflare_ddns_enabled: false
cloudcmd_enabled: false cloudcmd_enabled: false
# Backup & Restore # Backup & Restore
duplicati_enabled: false duplicati_enabled: false
nextcloud_enabled: false nextcloud_enabled: false
@ -87,13 +83,12 @@ wallabag_enabled: false
# Home Automation # Home Automation
homeassistant_enabled: false homeassistant_enabled: false
mosquitto_enabled: false mosquitto_enabled: false
homebridge_enabled: false
openhab_enabled: false
# Calibre # Calibre
calibre_enabled: false calibre_enabled: false
# Smarthome
openhab_enabled: false
# Joomla # Joomla
joomla_enabled: false joomla_enabled: false
@ -368,6 +363,14 @@ plex_music_permissions: "rw"
plex_user_id: 0 plex_user_id: 0
plex_group_id: 0 plex_group_id: 0
###
### Homebridge
###
homebridge_available_externally: "false"
homebridge_config_directory: "{{ docker_home }}/homebridge/config"
homebridge_user_id: "0"
homebridge_group_id: "0"
### ###
### Emby ### Emby
### ###

View file

@ -176,6 +176,10 @@
when: (mosquitto_enabled | default(False)) when: (mosquitto_enabled | default(False))
tags: mosquitto tags: mosquitto
- import_tasks: tasks/homebridge.yml
when: (homebridge_enabled | default(False))
tags: homebridge
- import_tasks: tasks/calibre.yml - import_tasks: tasks/calibre.yml
when: (calibre_enabled | default(False)) when: (calibre_enabled | default(False))
tags: calibre tags: calibre

View file

@ -22,7 +22,7 @@
- name: add user account to docker group - name: add user account to docker group
user: user:
name: "{{ ansible_nas_user }}" name: "{{ ansible_nas_user }}"
group: docker groups: docker
append: yes append: yes
- name: update docker home from install default - name: update docker home from install default

29
tasks/homebridge.yml Normal file
View file

@ -0,0 +1,29 @@
---
- name: Create Homebridge Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ homebridge_config_directory }}"
- name: Homebridge Docker Container
docker_container:
name: homebridge
image: oznu/homebridge
pull: true
volumes:
- "{{ homebridge_config_directory }}:/homebridge"
network_mode: host
env:
TZ: "{{ ansible_nas_timezone }}"
PGID: "{{ homebridge_group_id }}"
PUID: "{{ homebridge_user_id }}"
HOMEBRIDGE_CONFIG_UI: "1"
HOMEBRIDGE_CONFIG_UI_PORT: "8087"
restart_policy: unless-stopped
memory: 1g
labels:
traefik.backend: "homebridge"
traefik.frontend.rule: "Host:homebridge.{{ ansible_nas_domain }}"
traefik.enable: "{{ homebridge_available_externally }}"
traefik.port: "8087"

View file

@ -6,34 +6,36 @@
- name: Time Machine Docker Container - name: Time Machine Docker Container
docker_container: docker_container:
name: timemachine name: timemachine
image: awlnx/samba-timemachine:latest image: awlnx/samba-timemachine:latest
pull: true pull: true
ports: ports:
- "{{ timemachine_port }}:445" - "{{ timemachine_port }}:445"
env: env:
TMSIZE: "{{ timemachine_volume_size_limit }}" TMSIZE: "{{ timemachine_volume_size_limit }}"
PASS: "{{ timemachine_password }}" PASS: "{{ timemachine_password }}"
SHARENAME: "{{ timemachine_share_name }}" SHARENAME: "{{ timemachine_share_name }}"
volumes: volumes:
- "{{ timemachine_data_directory }}/data:/backups" - "{{ timemachine_data_directory }}/data:/backups"
network_mode: bridge ulimits:
restart_policy: unless-stopped - "nofile:1048576:1048576"
memory: 1g network_mode: bridge
restart_policy: unless-stopped
memory: 1g
- name: Install avahi - name: Install avahi
apt: apt:
name: "avahi-daemon" name: "avahi-daemon"
state: present state: present
register: result register: result
until: result is succeeded until: result is succeeded
- name: Setup timemachine service for avahi - name: Setup timemachine service for avahi
template: template:
src: timemachine/timemachine.service src: timemachine/timemachine.service
dest: "/etc/avahi/services/timemachine.service" dest: "/etc/avahi/services/timemachine.service"
- name: Reload avahi configuration - name: Reload avahi configuration
service: service:
name: avahi-daemon name: avahi-daemon
state: reloaded state: reloaded

View file

@ -5,7 +5,7 @@
<service> <service>
<type>_adisk._tcp</type> <type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record> <txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=Data,adVF=0x82</txt-record> <txt-record>dk0=adVN={{ timemachine_share_name }},adVF=0x82</txt-record>
</service> </service>
<service> <service>
<type>_smb._tcp</type> <type>_smb._tcp</type>

View file

@ -4,7 +4,7 @@ PLAYBOOK_DIR=$DIR/..
header() { header() {
clear clear
cat << EndOfMessage cat << "EndOfMessage"
._____. .__ ._____. .__
_____ ____ _____|__\_ |__ | | ____ ____ _____ ______ _____ ____ _____|__\_ |__ | | ____ ____ _____ ______
\__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/ \__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/