tripleo-ansible/tripleo_ansible/roles/tripleo_timemaster/templates/timemaster.conf.j2
Haresh Khandelwal dba77c4b22 replacing "," with " " to avoid timemaster to
consider it as a single interface

Due to this, when below is passed via THT,
PTPInterfaces: '0:eno1,0:eno2'

results in to
[ptp_domain 0]
interfaces eno1,eno2

timemaster[169838]: timemaster[532409.195]:
ioctl SIOCETHTOOL failed: No such device
timemaster[169838]: timemaster[532409.195]:
failed to get time stamping info for eno1,eno2
systemd[1]: timemaster.service: Main process
exited, code=exited, status=1/FAILURE
systemd[1]: timemaster.service: Failed with
result 'exit-code'.

Closes-Bug: #1934667
Change-Id: I3f3182929571ec723f4e1d5a8e283755b3e17f95
(cherry picked from commit 34c0d5d62c)
2021-07-09 07:33:38 +00:00

91 lines
2.3 KiB
Django/Jinja

# Do not manually edit this file.
# Managed by ansible role tripleo_timemaster
{% set ptp_ifaces = tripleo_timemaster_ptpinterfaces.split(',') %}
{% set ptp_dict = {} %}
{% for ptp in ptp_ifaces %}
{% if ptp.split(':')[0] not in ptp_dict %}
{% set _ = ptp_dict.update({ptp.split(':')[0]: []}) %}
{% endif %}
{% set _ = ptp_dict[ptp.split(':')[0]].append(ptp.split(':')[1]) %}
{% endfor %}
{% for domain, nic_list in ptp_dict.items() %}
[ptp_domain {{ domain }}]
interfaces {% for nic in nic_list %}
{{ nic }}{% if not loop.last %} {% endif %}
{% endfor %}
{% endfor %}
[timemaster]
ntp_program chronyd
[chrony.conf]
#include /etc/chrony.conf
{% for server in tripleo_timemaster_ntp_servers -%}
{% if server is mapping %}
server {{ server.server_host }} {{ server.server_settings }}
{% else %}
server {{ server }} {{ tripleo_timemaster_global_server_settings|default('') }}
{% endif %}
{% endfor -%}
{% for pool in tripleo_timemaster_ntp_pools -%}
{% if pool is mapping %}
pool {{ pool.pool_host }} {{ pool.pool_settings }}
{% else %}
pool {{ pool }} {{ tripleo_timemaster_global_pool_settings|default('') }}
{% endif %}
{% endfor -%}
{% for peer in tripleo_timemaster_ntp_peers -%}
{% if peer is mapping %}
peer {{ peer.peer_host }} {{ peer.peer_settings }}
{% else %}
peer {{ peer }} {{ tripleo_timemaster_global_peer_settings|default('') }}
{% endif %}
{% endfor -%}
{% if tripleo_timemaster_bind_addresses is defined and tripleo_timemaster_bind_addresses|length > 0 -%}
{% for bind_addr in tripleo_timemaster_bind_addresses %}
bindcmdaddress {{ bind_addr }}
{% endfor %}
{% endif -%}
{% if tripleo_timemaster_acl_rules is defined and tripleo_timemaster_acl_rules|length > 0 -%}
{{ tripleo_timemaster_acl_rules|join("\n") }}
{% endif -%}
{% if tripleo_timemaster_rtc_settings is defined -%}
{{ tripleo_timemaster_rtc_settings }}
{% endif -%}
{% if tripleo_timemaster_makestep is defined -%}
makestep {{ tripleo_timemaster_makestep }}{{ '\n' }}
{% endif -%}
{% if tripleo_timemaster_extra_options -%}
{{ tripleo_timemaster_extra_options|join("\n") }}
{% endif -%}
[ntp.conf]
includefile /etc/ntp.conf
[ptp4l.conf]
#includefile /etc/ptp4l.conf
network_transport {{ tripleo_timemaster_ptptransport }}
[chronyd]
path /usr/sbin/chronyd
[ntpd]
path /usr/sbin/ntpd
options -u ntp:ntp -g
[phc2sys]
path /usr/sbin/phc2sys
#options -w
[ptp4l]
path /usr/sbin/ptp4l