-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from 0xQSL/reload_runner
Support systemd reloading on debian too
- Loading branch information
Showing
4 changed files
with
40 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
|
||
- name: Ensure /etc/systemd/system/gitlab-runner.service.d/ exists | ||
file: | ||
path: /etc/systemd/system/gitlab-runner.service.d | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: Add reload command to GitLab Runner system service | ||
copy: | ||
dest: /etc/systemd/system/gitlab-runner.service.d/exec-reload.conf | ||
content: | | ||
[Service] | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
register: gitlab_runner_exec_reload | ||
|
||
# https://docs.gitlab.com/runner/configuration/init.html#overriding-systemd | ||
- name: Configure graceful stop for GitLab Runner system service | ||
copy: | ||
dest: /etc/systemd/system/gitlab-runner.service.d/kill.conf | ||
content: | | ||
[Service] | ||
TimeoutStopSec={{ gitlab_runner_timeout_stop_seconds }} | ||
KillSignal=SIGQUIT | ||
when: gitlab_runner_timeout_stop_seconds > 0 | ||
register: gitlab_runner_kill_timeout | ||
|
||
- name: Force systemd to reread configs | ||
systemd: | ||
daemon_reload: yes | ||
when: gitlab_runner_exec_reload.changed or gitlab_runner_kill_timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters