Skip to content

Commit

Permalink
Merge pull request #1 from timvy/patch-2
Browse files Browse the repository at this point in the history
feat: Add loop to exec_start_pre and exec_start_post
  • Loading branch information
alexandermeindl authored Apr 18, 2024
2 parents 397a8bd + 5f259a4 commit dab0df6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/systemd_timer/templates/service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,24 @@ Environment="{{ item.name }}={{ item.value }}"
WorkingDirectory={{ timer.working_directory }}
{% endif %}
{% if timer.exec_start_pre is defined %}
{% if timer.exec_start_pre is iterable and timer.exec_start_pre is not string %}
{% for item in timer.exec_start_pre %}
ExecStartPre={{ item }}
{% endfor %}
{% else %}
ExecStartPre={{ timer.exec_start_pre }}
{% endif %}
{% endif %}
ExecStart={{ timer.exec_start }}
{% if timer.exec_start_post is defined %}
{% if timer.exec_start_post is iterable and timer.exec_start_post is not string %}
{% for item in timer.exec_start_post %}
ExecStartPost={{ item }}
{% endfor %}
{% else %}
ExecStartPost={{ timer.exec_start_post }}
{% endif %}
{% endif %}
{% if timer.syslog_identifier is defined %}
SyslogIdentifier={{ timer.syslog_identifier }}
{% endif %}
Expand Down

0 comments on commit dab0df6

Please sign in to comment.