summaryrefslogtreecommitdiffstats
path: root/roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2
diff options
context:
space:
mode:
authorJoel Diaz <jdiaz@redhat.com>2015-11-17 15:19:54 -0500
committerJoel Diaz <jdiaz@redhat.com>2015-11-18 11:50:50 -0500
commitea3c029d5dcbf6d60995f920fb169a7e77375cfd (patch)
tree7f31fa1eb0f78c6b67c06d964fe1a4fd15001a4b /roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2
parent4729ff527762cc0b48c6a49eede59484cd143297 (diff)
downloadopenshift-ea3c029d5dcbf6d60995f920fb169a7e77375cfd.tar.gz
openshift-ea3c029d5dcbf6d60995f920fb169a7e77375cfd.tar.bz2
openshift-ea3c029d5dcbf6d60995f920fb169a7e77375cfd.tar.xz
openshift-ea3c029d5dcbf6d60995f920fb169a7e77375cfd.zip
Created role to deploy ops host monitoring
oso_host_monitoring to config/run host monitoring container(s)
Diffstat (limited to 'roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2')
-rw-r--r--roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j243
1 files changed, 43 insertions, 0 deletions
diff --git a/roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2 b/roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2
new file mode 100644
index 000000000..d18ad90fe
--- /dev/null
+++ b/roles/oso_host_monitoring/templates/oso-f22-host-monitoring.service.j2
@@ -0,0 +1,43 @@
+# This is a systemd file to run this docker container under systemd.
+# To make this work:
+# * pull the image (probably from ops docker registry)
+# * place this file in /etc/systemd/system without the .systemd extension
+# * run the commands:
+# systemctl daemon-reload
+# systemctl enable pcp-docker
+# systemctl start pcp-docker
+#
+#
+[Unit]
+Description=PCP Collector Contatainer
+Requires=docker.service
+After=docker.service
+
+
+[Service]
+Type=simple
+TimeoutStartSec=5m
+Environment=HOME=/etc/docker/ops
+#Slice=container-small.slice
+
+# systemd syntax '=-' ignore errors from return codes.
+ExecStartPre=-/usr/bin/docker kill "{{ osohm_host_monitoring }}"
+ExecStartPre=-/usr/bin/docker rm "{{ osohm_host_monitoring }}"
+ExecStartPre=-/usr/bin/docker pull "{{ osohm_docker_registry_url }}{{ osohm_host_monitoring }}"
+
+
+ExecStart=/usr/bin/docker run --rm --name="{{ osohm_host_monitoring }}" \
+ --privileged --net=host --pid=host --ipc=host \
+ -v /sys:/sys:ro -v /etc/localtime:/etc/localtime:ro \
+ -v /var/lib/docker:/var/lib/docker:ro -v /run:/run \
+ -v /var/log:/var/log \
+ {{ osohm_docker_registry_url }}{{ osohm_host_monitoring }}
+
+ExecReload=-/usr/bin/docker stop "{{ osohm_host_monitoring }}"
+ExecReload=-/usr/bin/docker rm "{{ osohm_host_monitoring }}"
+ExecStop=-/usr/bin/docker stop "{{ osohm_host_monitoring }}"
+Restart=always
+RestartSec=30
+
+[Install]
+WantedBy=default.target