diff --git a/defaults/main.yml b/defaults/main.yml index 8c2fc3a..a5ef5a1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -126,6 +126,7 @@ systemd_environment: {} # `systemd_run_dir` -- (optional) Run directory that will be used for service runtime. Service slice or name is added to the path # `systemd_lock_dir` -- (optional) Lock directory that will be used for service runtime. Service slice or name is added to the path # `load` -- (optional) Boolean to set if the service is loaded. Socket activated services with '@' may not need to be loaded. +# `standard_output` -- (optional) Set the stdout of the service to go to a non default destination, such as 'socket' # Under the service dictionary the "sockets" key can be added, which may contain list of the sockets # for the given service_name. Each socket in the lsit may have following structure: diff --git a/templates/systemd-service.j2 b/templates/systemd-service.j2 index e6ef303..83abd1e 100644 --- a/templates/systemd-service.j2 +++ b/templates/systemd-service.j2 @@ -63,6 +63,10 @@ Restart={{ systemd_Restart }} RestartSec={{ systemd_RestartSec }} {% endif %} +{% if item.standard_output is defined %} +StandardOutput={{ item.standard_output }} +{% endif %} + # This creates a specific slice which all services will operate from # The accounting options give us the ability to see resource usage through # the `systemd-cgtop` command.