Skip to content

Commit

Permalink
roles/timemaster: fix After setting
Browse files Browse the repository at this point in the history
"After" setting should be in the Unit section of a systemd service file.

Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
  • Loading branch information
Revalioli committed Jan 9, 2025
1 parent 503ab2b commit 551e5e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion roles/timemaster/templates/timemaster.service.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[Unit]
After=network-online.target
{% if ptp_interface is defined and ptp_vlanid is not defined %}
After=sys-subsystem-net-devices-{{ ptp_interface }}.device
{% endif %}
Wants=network-online.target

[Service]
{% if ptp_interface is defined %}{% if ptp_vlanid is defined %}
ExecStartPre=bash -c "while true; do ip addr show {{ ptp_interface + '.' + ptp_vlanid|string }} && break; sleep 1; done"
{% else %}
After=sys-subsystem-net-devices-{{ ptp_interface }}.device
ExecStartPre=bash -c "while true; do ip addr show {{ ptp_interface }} && break; sleep 1; done"
{% endif %}
{% endif %}

0 comments on commit 551e5e1

Please sign in to comment.