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:
@@ -34,3 +34,9 @@
|
|||||||
state: restarted
|
state: restarted
|
||||||
enabled: "yes"
|
enabled: "yes"
|
||||||
daemon_reload: "yes"
|
daemon_reload: "yes"
|
||||||
|
|
||||||
|
- name: Restart samba
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: smbd
|
||||||
|
state: restarted
|
||||||
|
daemon_reload: true
|
||||||
|
|||||||
@@ -217,13 +217,13 @@
|
|||||||
src: smb.conf
|
src: smb.conf
|
||||||
dest: /etc/samba/
|
dest: /etc/samba/
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
notify: Restart samba
|
||||||
|
|
||||||
- name: Restart samba
|
- name: Enable samba
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: smbd
|
name: smbd
|
||||||
state: restarted
|
state: started
|
||||||
enabled: "yes"
|
enabled: true
|
||||||
daemon_reload: "yes"
|
|
||||||
# manual steps:
|
# manual steps:
|
||||||
# - set samba passwords with smbpasswd
|
# - set samba passwords with smbpasswd
|
||||||
# - copy music into /media/musicmouse: scripts/sync-library.sh in the app repo, which
|
# - copy music into /media/musicmouse: scripts/sync-library.sh in the app repo, which
|
||||||
|
|||||||
Reference in New Issue
Block a user