Merge pull request #50 from jgoerz/add-timemachine-support

Add support for timemachine server
This commit is contained in:
David Stephens 2019-01-12 22:19:57 +00:00 committed by GitHub
commit 170b8c67d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 75 additions and 2 deletions

View file

@ -44,6 +44,7 @@ just a stock Ubuntu install, some clever Ansible config and a bunch of Docker co
* [Sonarr](https://sonarr.tv/) - for downloading and managing TV episodes
* [Tautulli](http://tautulli.com/) - Monitor Your Plex Media Server
* [Telegraf](https://github.com/influxdata/telegraf) - Metrics collection agent
* [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)
* [Watchtower](https://github.com/v2tec/watchtower) - Monitor your Docker containers and update them if a new version is available

View file

@ -0,0 +1,24 @@
# Time Machine
Apple docs: [https://support.apple.com/en-us/HT201250](https://support.apple.com/en-us/HT201250)
Docker image: [https://github.com/mbentley/docker-timemachine](https://github.com/mbentley/docker-timemachine)
Time Machine is an application that allows you to backup files from your Mac.
## Usage
Set `timemachine_enabled: true` in your `group_vars/all.yml` file.
## Specific Configuration
<dl>
<dt><strong>timemachine_data_directory</strong></dt>
<dd>The absolute path on Ansible NAS where the backup files will be stored</dd>
<dt><strong>timemachine_volume_size_limit</strong></dt>
<dd>The maximum amount of space Time Machine can use for the backups in units of MiB. Set it to 0 for no limit.</dd>
<dt><strong>timemachine_share_name</strong></dt>
<dd>The name of the share as it will appear in the Time Machine application. Default is 'TimeMachine'</dd>
<dt><strong>timemachine_password</strong></dt>
<dd>The password used to access the share. Default is 'timemachine'</dd>
<dt><strong>timemachine_log_level</strong></dt>
<dd>The verbosity of the logs. 'Error' is the default.</dd>

View file

@ -47,6 +47,7 @@ watchtower_enabled: false
duplicati_enabled: false
nextcloud_enabled: false
gitea_enabled: false
timemachine_enabled: false
# IRC bouncer
znc_enabled: false
@ -389,4 +390,13 @@ watchtower_command: "--schedule '{{ watchtower_cron_schedule }}' --debug"
# watchtower_command: "--schedule '{{ watchtower_cron_schedule }}' --notifications 'email' --notification-email-from 'ansible@nas.com' --notification-email-to '{{ ansible_nas_email }}' --notification-email-server 'my.email.server.com' --notification-email-server-port '25' --notification-email-server-user 'email_username' --notification-email-server-password 'top-secret'"
# Slack notifications
# watchtower_command: "--schedule '{{ watchtower_cron_schedule }}' --notifications 'slack' --notification-slack-hook-url 'https://hooks.slack.com/services/xxx/yyyyyyyyyyyyyyy' --notification-slack-identifier 'ansible-nas'"
# watchtower_command: "--schedule '{{ watchtower_cron_schedule }}' --notifications 'slack' --notification-slack-hook-url 'https://hooks.slack.com/services/xxx/yyyyyyyyyyyyyyy' --notification-slack-identifier 'ansible-nas'"
###
### Time Machine
###
timemachine_data_directory: "{{ docker_home }}/timemachine"
timemachine_volume_size_limit: 0
timemachine_password: timemachine
timemachine_share_name: TimeMachine
timemachine_log_level: error

View file

@ -103,6 +103,10 @@
when: gitea_enabled
tags: gitea
- import_tasks: tasks/timemachine.yml
when: timemachine_enabled
tags: timemachine
- import_tasks: tasks/stats.yml
when: stats_enabled
tags: stats

25
tasks/timemachine.yml Normal file
View file

@ -0,0 +1,25 @@
---
- name: Time Machine Directories
file:
path: "{{ timemachine_data_directory }}"
state: directory
- name: Time Machine Docker Container
docker_container:
name: timemachine
image: mbentley/timemachine:latest
pull: true
ports:
- "548:548"
env:
VOLUME_SIZE_LIMIT: "{{ timemachine_volume_size_limit }}"
PASSWORD: "{{ timemachine_password }}"
SHARE_NAME: "{{ timemachine_share_name }}"
LOG_LEVEL: "{{ timemachine_log_level }}"
volumes:
- "{{ timemachine_data_directory }}/data:/opt/timemachine"
- "{{ timemachine_data_directory }}/logs:/var/log/supervisor"
- "/var/run/dbus:/var/run/dbus"
network_mode: host
restart_policy: unless-stopped
memory: 1g

View file

@ -47,11 +47,11 @@ watchtower_enabled: false
duplicati_enabled: false
nextcloud_enabled: false
gitea_enabled: false
timemachine_enabled: false
# IRC bouncer
znc_enabled: false
###
### General
###
@ -389,3 +389,12 @@ watchtower_command: "--schedule '{{ watchtower_cron_schedule }}' --debug"
# Slack notifications
# watchtower_command: "--schedule '{{ watchtower_cron_schedule }}' --notifications 'slack' --notification-slack-hook-url 'https://hooks.slack.com/services/xxx/yyyyyyyyyyyyyyy' --notification-slack-identifier 'ansible-nas'"
###
### Time Machine
###
timemachine_data_directory: "{{ docker_home }}/timemachine" # needs to be an absolute path
timemachine_volume_size_limit: 0
timemachine_password: timemachine
timemachine_share_name: TimeMachine
timemachine_log_level: error