diff --git a/roles/samba-dc/files/auto-restart.conf b/roles/samba-dc/files/auto-restart.conf new file mode 100644 index 0000000..3a7ace8 --- /dev/null +++ b/roles/samba-dc/files/auto-restart.conf @@ -0,0 +1,6 @@ +[Unit] +StartLimitIntervalSec=60 +StartLimitBurst=10 + +[Service] +RestartSec=10s diff --git a/roles/samba-dc/tasks/main.yml b/roles/samba-dc/tasks/main.yml index 43ac2d5..01412ce 100644 --- a/roles/samba-dc/tasks/main.yml +++ b/roles/samba-dc/tasks/main.yml @@ -77,6 +77,20 @@ path=/etc/systemd/system/samba.service.d mode=0755 state=directory + tags: + - systemd +- name: ensure samba service auto restart is configurd + copy: + src: auto-restart.conf + dest: /etc/systemd/system/samba.service.d + owner: root + group: root + mode: u=rw,go=r + notify: + - reload systemd + - restart samba + tags: + - systemd - name: ensure samba starts at boot service: