]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ansible: adds a systemd template for jenkins
authorAndrew Schoen <aschoen@redhat.com>
Tue, 13 Sep 2016 20:01:29 +0000 (15:01 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 14 Sep 2016 19:30:10 +0000 (14:30 -0500)
This is used for static slaves that run the java command to connect to
the jenkins master using jnlp.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ansible/templates/systemd/jenkins.service.j2 [new file with mode: 0644]

diff --git a/ansible/templates/systemd/jenkins.service.j2 b/ansible/templates/systemd/jenkins.service.j2
new file mode 100644 (file)
index 0000000..97ba7d9
--- /dev/null
@@ -0,0 +1,21 @@
+# {{ ansible_managed }}
+[Unit]
+Description=Jenkins Slave
+Wants=network.target
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+User={{ jenkins_user }}
+ExecStart=/usr/bin/java \
+          -jar /home/{{ jenkins_user }}/slave.jar \
+          -jnlpUrl {{ api_uri }}/computer/{{ ansible_default_ipv4.address }}+{{ nodename }}/slave-agent.jnlp \
+          -jnlpCredentials {{ api_user }}:{{ token }}
+StandardOutput=journal
+StandardError=journal
+Restart=always
+RestartSec=30
+StartLimitInterval=0