Add PTP service
Precision Time Protocol (PTP) is a protocol used to synchronize clocks throughout a network. When used in conjunction with hardware support, PTP is capable of sub-microsecond accuracy which is far better than is normally obtainable with NTP. Change-Id: Idc78df3a90b73be504480bc9d33a3f0041d2d84f
This commit is contained in:
parent
0980deab43
commit
07eabfd08d
@ -45,6 +45,10 @@ mod 'ntp',
|
||||
:git => 'https://github.com/puppetlabs/puppetlabs-ntp',
|
||||
:ref => '4.2.x'
|
||||
|
||||
mod 'ptp',
|
||||
:git => 'https://github.com/redhat-nfvpe/ptp',
|
||||
:ref => 'master'
|
||||
|
||||
mod 'systemd',
|
||||
:git => 'https://github.com/camptocamp/puppet-systemd',
|
||||
:ref => 'master'
|
||||
|
52
manifests/profile/base/time/ptp.pp
Normal file
52
manifests/profile/base/time/ptp.pp
Normal file
@ -0,0 +1,52 @@
|
||||
# Copyright 2017 Red Hat, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# == Class: tripleo::profile::base::time::ptp
|
||||
#
|
||||
# PTP base profile for tripleo.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ptp4l_interface*]
|
||||
# The physical interface name where PTP service is configured on
|
||||
# Defaults to 'eth0'
|
||||
#
|
||||
# [*ptp4l_conf_slaveonly*]
|
||||
# Whether to configure PTP service in slave mode
|
||||
# Defaults to 1
|
||||
#
|
||||
# [*ptp4l_conf_network_transport*]
|
||||
# PTP message transport protocol
|
||||
# Defaults to 'UDPv4'
|
||||
|
||||
class tripleo::profile::base::time::ptp (
|
||||
$ptp4l_interface = 'eth0',
|
||||
$ptp4l_conf_slaveonly = 1,
|
||||
$ptp4l_conf_network_transport = 'UDPv4',
|
||||
) {
|
||||
|
||||
$interface_mapping = generate('/bin/os-net-config', '-i', $ptp4l_interface)
|
||||
$ptp4l_interface_name = $interface_mapping[$ptp4l_interface]
|
||||
|
||||
ptp::instance_ptp4l { "ptp4l-${title}-${ptp4l_interface_name}":
|
||||
ptp4l_interface => $ptp4l_interface_name,
|
||||
ptp4l_conf_slaveonly => $ptp4l_conf_slaveonly,
|
||||
ptp4l_conf_network_transport => $ptp4l_conf_network_transport,
|
||||
}
|
||||
|
||||
ptp::instance_phc2sys { "phc2sys-${title}-${ptp4l_interface_name}":
|
||||
auto_sync => true,
|
||||
}
|
||||
}
|
6
releasenotes/notes/ptp-062b1d1f2d9f2275.yaml
Normal file
6
releasenotes/notes/ptp-062b1d1f2d9f2275.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- Precision Time Protocol (PTP) is a protocol used to synchronize clocks
|
||||
throughout a network. When used in conjunction with hardware support,
|
||||
PTP is capable of sub-microsecond accuracy which is far better than is
|
||||
normally obtainable with NTP.
|
Loading…
Reference in New Issue
Block a user