mirror of
https://github.com/davestephens/ansible-nas
synced 2024-11-16 00:38:02 +00:00
8e5fb6f827
Apple deprecated netatalk and prefers samba/smb for timemachine (with some extensions). This update uses awls/samba-timemachine to create a dedicated samba instance for timemachine, and then sets up the appropriate service in avahi so timemachine is discovered properly.
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
---
|
|
- name: Time Machine Directories
|
|
file:
|
|
path: "{{ timemachine_data_directory }}"
|
|
state: directory
|
|
|
|
- name: Build time machine image
|
|
command: >
|
|
docker build -t awlx/samba-timemachine https://github.com/awlx/samba-timemachine.git
|
|
|
|
- name: Time Machine Docker Container
|
|
docker_container:
|
|
name: timemachine
|
|
image: awlx/samba-timemachine:latest
|
|
pull: false
|
|
ports:
|
|
- "{{ timemachine_port }}:445"
|
|
env:
|
|
TMSIZE: "{{ timemachine_volume_size_limit }}"
|
|
PASS: "{{ timemachine_password }}"
|
|
SHARENAME: "{{ timemachine_share_name }}"
|
|
volumes:
|
|
- "{{ timemachine_data_directory }}:/backups"
|
|
network_mode: bridge
|
|
restart_policy: unless-stopped
|
|
memory: 1g
|
|
|
|
- name: Install avahi
|
|
apt:
|
|
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"
|
|
|
|
- name: Reload avahi configuration
|
|
service:
|
|
name: avahi-daemon
|
|
state: reloaded
|