Skip to content

Commit

Permalink
Enable support for systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
matisku committed Oct 2, 2017
1 parent ac87071 commit f04610e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tasks/teamcity-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
dest: "/etc/default/teamcity-server"
mode: 0644

- name: "Put TeamCity service file"
- name: "Put TeamCity service file (sysv)"
template:
src: "teamcity-server.conf.j2"
dest: "/etc/init/teamcity-server.conf"
src: "teamcity-agent.conf.j2"
dest: "/etc/init/teamcity-agent.conf"
mode: 0644
when: "ansible_service_mgr != 'systemd'"

- name: "Put TeamCity service file (systemd)"
template:
src: "teamcity-agent.service.j2"
dest: "/lib/systemd/system/teamcity-server.service"
mode: 0644
when: "ansible_service_mgr == 'systemd'"

- name: "Stop TeamCity Server before upgrade"
service:
Expand Down
13 changes: 13 additions & 0 deletions templates/teamcity-server.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#/lib/systemd/system
[Unit]
Description="TeamCity Server"

[Service]
Type=forking
User={{ teamcity_server_user_name }}
PIDFile={{ teamcity_server_dir }}/logs/teamcity-server.pid
ExecStart={{ teamcity_server_dir }}/bin/teamcity-server.sh start
ExecStop={{ teamcity_server_dir }}/bin/teamcity-server.sh stop

[Install]
WantedBy=multi-user.target

0 comments on commit f04610e

Please sign in to comment.