Only restart samba when its config changes
state: restarted is unconditional, so every run reported a change and bounced smbd - which is the share the music is copied over, so a run during a transfer would interrupt it. Start/enable it as a task, restart it from a handler the config copy notifies. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -217,13 +217,13 @@
|
||||
src: smb.conf
|
||||
dest: /etc/samba/
|
||||
mode: "0644"
|
||||
notify: Restart samba
|
||||
|
||||
- name: Restart samba
|
||||
- name: Enable samba
|
||||
ansible.builtin.systemd:
|
||||
name: smbd
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
state: started
|
||||
enabled: true
|
||||
# manual steps:
|
||||
# - set samba passwords with smbpasswd
|
||||
# - copy music into /media/musicmouse: scripts/sync-library.sh in the app repo, which
|
||||
|
||||
Reference in New Issue
Block a user