ansible-nas/tasks/timemachine.yml
Ryan Olf 8e5fb6f827 Changed timemachine to use samba instead of netatalk, consistent with current standard
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.
2019-08-25 16:04:08 -07:00

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