mirror of
https://github.com/davestephens/ansible-nas
synced 2024-12-25 02:53:11 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
319c9b2309
13 changed files with 114 additions and 55 deletions
10
.github/ISSUE_TEMPLATE/bug-report.md
vendored
10
.github/ISSUE_TEMPLATE/bug-report.md
vendored
|
@ -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):
|
||||
- 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?
|
||||
- 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**
|
||||
What should happen?
|
||||
|
|
|
@ -11,4 +11,15 @@ If you're adding a new application:
|
|||
|
||||
* Ensure that the new application is disabled by default.
|
||||
* 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.
|
14
README.md
14
README.md
|
@ -145,20 +145,8 @@ Getting help is easy! You can:
|
|||
|
||||
## 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
|
||||
|
||||
|
|
11
docs/applications/homebridge.md
Normal file
11
docs/applications/homebridge.md
Normal 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!
|
|
@ -23,6 +23,7 @@ By default, applications can be found on the ports listed below.
|
|||
| Guacamole | 8090 | |
|
||||
| Heimdall | 10080 | |
|
||||
| Home Assistant | 8123 | |
|
||||
| Homebridge | 8087 | |
|
||||
| Jackett | 9117 | |
|
||||
| Jellyfin | 8896 | HTTP |
|
||||
| Jellyfin | 8928 | HTTPS |
|
||||
|
|
|
@ -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
|
||||
late.
|
||||
|
||||
### Pool default parameters
|
||||
### Pool and filesystem properties
|
||||
|
||||
Setting pool-wide default parameters makes life easier when we create our
|
||||
filesystems. To see them all, you can use the command `zfs get all tank`. Most
|
||||
are perfectly sensible, some you'll [want to
|
||||
change](https://jrs-s.net/2018/08/17/zfs-tuning-cheat-sheet/):
|
||||
Pools have properties that apply either to the pool itself or to filesystems
|
||||
created in the pool. You can use the command `zpool get all tank` to see the
|
||||
pool properties and `zfs get all tank` to see the filesystem properties. Most
|
||||
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 compression=lz4 tank
|
||||
sudo zfs set autoexpand=on tank
|
||||
```
|
||||
|
||||
The `atime` parameter means that your system updates a time stamp every time a
|
||||
file is accessed, which uses a lot of resources. Usually, you don't care.
|
||||
`autoexpand=on` lets the pool grow when you add larger hard drives. `atime=off`
|
||||
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
|
||||
discuss exceptions for compressed media files later). The `autoexpand` lets the
|
||||
pool grow when you add larger hard drives.
|
||||
discuss exceptions for compressed media files later).
|
||||
|
||||
## Creating filesystems
|
||||
|
||||
|
|
|
@ -41,9 +41,6 @@ radarr_enabled: false
|
|||
get_iplayer_enabled: false
|
||||
jackett_enabled: false
|
||||
bazarr_enabled: false
|
||||
|
||||
|
||||
# Ombi
|
||||
ombi_enabled: false
|
||||
|
||||
# Music
|
||||
|
@ -64,7 +61,6 @@ watchtower_enabled: false
|
|||
cloudflare_ddns_enabled: false
|
||||
cloudcmd_enabled: false
|
||||
|
||||
|
||||
# Backup & Restore
|
||||
duplicati_enabled: false
|
||||
nextcloud_enabled: false
|
||||
|
@ -87,13 +83,12 @@ wallabag_enabled: false
|
|||
# Home Automation
|
||||
homeassistant_enabled: false
|
||||
mosquitto_enabled: false
|
||||
homebridge_enabled: false
|
||||
openhab_enabled: false
|
||||
|
||||
# Calibre
|
||||
calibre_enabled: false
|
||||
|
||||
# Smarthome
|
||||
openhab_enabled: false
|
||||
|
||||
# Joomla
|
||||
joomla_enabled: false
|
||||
|
||||
|
@ -368,6 +363,14 @@ plex_music_permissions: "rw"
|
|||
plex_user_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
|
||||
###
|
||||
|
|
4
nas.yml
4
nas.yml
|
@ -176,6 +176,10 @@
|
|||
when: (mosquitto_enabled | default(False))
|
||||
tags: mosquitto
|
||||
|
||||
- import_tasks: tasks/homebridge.yml
|
||||
when: (homebridge_enabled | default(False))
|
||||
tags: homebridge
|
||||
|
||||
- import_tasks: tasks/calibre.yml
|
||||
when: (calibre_enabled | default(False))
|
||||
tags: calibre
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
- name: add user account to docker group
|
||||
user:
|
||||
name: "{{ ansible_nas_user }}"
|
||||
group: docker
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: update docker home from install default
|
||||
|
|
29
tasks/homebridge.yml
Normal file
29
tasks/homebridge.yml
Normal 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"
|
|
@ -6,34 +6,36 @@
|
|||
|
||||
- name: Time Machine Docker Container
|
||||
docker_container:
|
||||
name: timemachine
|
||||
image: awlnx/samba-timemachine:latest
|
||||
pull: true
|
||||
ports:
|
||||
- "{{ timemachine_port }}:445"
|
||||
env:
|
||||
TMSIZE: "{{ timemachine_volume_size_limit }}"
|
||||
PASS: "{{ timemachine_password }}"
|
||||
SHARENAME: "{{ timemachine_share_name }}"
|
||||
volumes:
|
||||
- "{{ timemachine_data_directory }}/data:/backups"
|
||||
network_mode: bridge
|
||||
restart_policy: unless-stopped
|
||||
memory: 1g
|
||||
name: timemachine
|
||||
image: awlnx/samba-timemachine:latest
|
||||
pull: true
|
||||
ports:
|
||||
- "{{ timemachine_port }}:445"
|
||||
env:
|
||||
TMSIZE: "{{ timemachine_volume_size_limit }}"
|
||||
PASS: "{{ timemachine_password }}"
|
||||
SHARENAME: "{{ timemachine_share_name }}"
|
||||
volumes:
|
||||
- "{{ timemachine_data_directory }}/data:/backups"
|
||||
ulimits:
|
||||
- "nofile:1048576:1048576"
|
||||
network_mode: bridge
|
||||
restart_policy: unless-stopped
|
||||
memory: 1g
|
||||
|
||||
- name: Install avahi
|
||||
apt:
|
||||
name: "avahi-daemon"
|
||||
state: present
|
||||
name: "avahi-daemon"
|
||||
state: present
|
||||
register: result
|
||||
until: result is succeeded
|
||||
|
||||
- name: Setup timemachine service for avahi
|
||||
template:
|
||||
src: timemachine/timemachine.service
|
||||
dest: "/etc/avahi/services/timemachine.service"
|
||||
src: timemachine/timemachine.service
|
||||
dest: "/etc/avahi/services/timemachine.service"
|
||||
|
||||
- name: Reload avahi configuration
|
||||
service:
|
||||
name: avahi-daemon
|
||||
state: reloaded
|
||||
name: avahi-daemon
|
||||
state: reloaded
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<service>
|
||||
<type>_adisk._tcp</type>
|
||||
<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>
|
||||
<type>_smb._tcp</type>
|
||||
|
|
|
@ -4,7 +4,7 @@ PLAYBOOK_DIR=$DIR/..
|
|||
|
||||
header() {
|
||||
clear
|
||||
cat << EndOfMessage
|
||||
cat << "EndOfMessage"
|
||||
._____. .__
|
||||
_____ ____ _____|__\_ |__ | | ____ ____ _____ ______
|
||||
\__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/
|
||||
|
|
Loading…
Reference in a new issue