From 1c580bbdbc626814b3c552f90b260a5c1ec66bec Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 3 Apr 2018 11:17:41 -0500 Subject: [PATCH] Add a documentation list default This change adds the documentation list default to our systemd service files when populated. This is feature will provide us the ability to link services to specific documentation which operators will be able to see when querying a service. Change-Id: I514d907ccbb52cc6010a29c4c3e10eb2cf558dfa Signed-off-by: Kevin Carter --- defaults/main.yml | 5 +++++ templates/systemd-service.j2 | 3 +++ 2 files changed, 8 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 43634f2..6da40b0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -47,6 +47,11 @@ systemd_after_targets: - syslog.target - network.target +# List of documentation information that will be presented in the unit. This +# option is a list of documentation items which can be local or online. +# Usage: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Documentation= +systemd_unit_docs: [] + # Set the service enabled state. Valid options are: [yes, no] systemd_service_enabled: yes diff --git a/templates/systemd-service.j2 b/templates/systemd-service.j2 index de3719c..da2b0f3 100644 --- a/templates/systemd-service.j2 +++ b/templates/systemd-service.j2 @@ -5,6 +5,9 @@ Description={{ item.service_name }} service {% for item in systemd_after_targets %} After={{ item }} {% endfor %} +{% for item in systemd_unit_docs %} +Documentation={{ item }} +{% endfor %} [Service] {% set service_type = item.service_type | default(systemd_default_service_type) %}