From aa7e730afc6fe5821ba6d89425b836b70724165e Mon Sep 17 00:00:00 2001 From: Jocelyn Jaubert Date: Mon, 8 Jul 2024 21:23:38 +0200 Subject: [PATCH] =?UTF-8?q?buildbot:=20Configuration=20systemd=20pour=20re?= =?UTF-8?q?d=C3=A9marrage=20automatique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/buildbot-slave/handlers/main.yml | 4 ++++ roles/buildbot-slave/tasks/main.yml | 14 ++++++++++++++ .../systemd-buildbot-worker-override.conf | 4 ++++ 3 files changed, 22 insertions(+) create mode 100644 roles/buildbot-slave/templates/systemd-buildbot-worker-override.conf diff --git a/roles/buildbot-slave/handlers/main.yml b/roles/buildbot-slave/handlers/main.yml index 33ebcf4f..73a4689b 100644 --- a/roles/buildbot-slave/handlers/main.yml +++ b/roles/buildbot-slave/handlers/main.yml @@ -1,3 +1,7 @@ +- name: systemd daemon-reload + systemd: + daemon_reload: yes + - name: restart buildslave service: name=buildslave state=restarted diff --git a/roles/buildbot-slave/tasks/main.yml b/roles/buildbot-slave/tasks/main.yml index 1cb401ad..cc567138 100644 --- a/roles/buildbot-slave/tasks/main.yml +++ b/roles/buildbot-slave/tasks/main.yml @@ -37,6 +37,20 @@ - {regexp: "WorkingDirectory=", line: "WorkingDirectory=/data/work/buildbot-slave"} notify: restart buildbot-worker +- name: create systemd override for buildbot-worker + file: + path: /etc/systemd/system/buildbot-worker@osmose.service.d/ + state: directory + +- name: add systemd override for postgresql + template: + dest: "/etc/systemd/system/buildbot-worker@osmose.service.d/override.conf" + src: "systemd-buildbot-worker-override.conf" + owner: root + notify: + - systemd daemon-reload + - restart buildbot-worker + - name: enable systemd service systemd: name: "{{ item }}" diff --git a/roles/buildbot-slave/templates/systemd-buildbot-worker-override.conf b/roles/buildbot-slave/templates/systemd-buildbot-worker-override.conf new file mode 100644 index 00000000..caee4735 --- /dev/null +++ b/roles/buildbot-slave/templates/systemd-buildbot-worker-override.conf @@ -0,0 +1,4 @@ +# {{ ansible_managed }} +[Service] +Restart=always +RestartSec=30s