blob: 1ef273e5952bf442fd4a0f404e91259bb99af98b [file] [log] [blame]
OlgaGusarenko5fc09322018-06-19 11:29:32 +03001=====
2Usage
3=====
Filip Pytloun10e4d6c2015-10-06 16:28:32 +02004
OlgaGusarenko5fc09322018-06-19 11:29:32 +03005The Network Time Protocol (NTP) formula is used to properly synchronize
6services across the nodes. This file provides the sample configurations for
7different use cases.
Filip Pytloun10e4d6c2015-10-06 16:28:32 +02008
OlgaGusarenko5fc09322018-06-19 11:29:32 +03009* [Deprecated] NTP client configuration, should not be used if the ``stratum``
10 parameter exists:
Filip Pytloun10e4d6c2015-10-06 16:28:32 +020011
OlgaGusarenko5fc09322018-06-19 11:29:32 +030012 .. code-block:: yaml
Filip Pytloun10e4d6c2015-10-06 16:28:32 +020013
OlgaGusarenko5fc09322018-06-19 11:29:32 +030014 ntp:
15 client:
Ondrej Smolad3c67032018-04-04 12:16:05 +020016 enabled: true
OlgaGusarenko5fc09322018-06-19 11:29:32 +030017 strata:
18 - ntp.cesnet.cz
19 - ntp.nic.cz
Ondrej Smolad3c67032018-04-04 12:16:05 +020020
OlgaGusarenko5fc09322018-06-19 11:29:32 +030021* The NTP client extended definition with auth:
Ondrej Smolad3c67032018-04-04 12:16:05 +020022
OlgaGusarenko5fc09322018-06-19 11:29:32 +030023 .. code-block:: yaml
24
25 ntp:
26 client:
Ondrej Smolad3c67032018-04-04 12:16:05 +020027 enabled: true
OlgaGusarenko5fc09322018-06-19 11:29:32 +030028 stratum:
29 primary:
30 server: ntp.cesnet.cz
31 key_id: 1
32 secondary:
33 server: ntp.nic.cz
34 key_id: 2
35
36* The NTP client with MD5 auth configuration:
37
38 .. code-block:: yaml
39
40 ntp:
41 client:
42 enabled: true
43 auth:
44 enabled: true
45 secrets:
46 1:
47 secret_type: 'M'
48 secret: 'Runrabbitrundigthath'
49 trustedkey: true
50 2:
51 secret_type: 'M'
52 secret: 'Howiwishyouwereherew'
53 trustedkey: true
54 stratum:
55 primary:
56 server: ntp.cesnet.cz
57 key_id: 1
58 secondary:
59 server: ntp.nic.cz
60 key_id: 2
61
Stanislav Riazanovb1027022019-03-25 17:42:22 +040062* The NTP client definition enabling the ``listen`` and ``ignore`` actions on
63 specific addresses:
64
65 .. code-block:: yaml
66
67 ntp:
68 client:
69 interface:
70 1:
71 value: wildcard
72 action: ignore
73 2:
74 value: ::1
75 action: listen
76 3:
77 value: 192.168.31.1
78 action: listen
79
OlgaGusarenko5fc09322018-06-19 11:29:32 +030080* The NTP server with MD5 auth configuration:
81
82 .. code-block:: yaml
83
84 ntp:
85 client:
86 enabled: false
87 server:
88 enabled: true
89 auth:
90 enabled: true
91 secrets:
92 1:
93 secret_type: 'M'
94 secret: 'Runrabbitrundigthath'
95 trustedkey: true
96 2:
97 secret_type: 'M'
98 secret: 'Howiwishyouwereherew'
99 trustedkey: true
100 stratum:
101 primary:
102 server: ntp.cesnet.cz
103 key_id: 1
104 secondary:
105 server: ntp.nic.cz
106 key_id: 2
107
108* A cleaning up of the NTP configurations left by DHCP:
109
110 .. code-block:: yaml
111
112 ntp:
113 client:
114 enabled: true
115 remove_dhcp_conf: true # default false
116
117* The NTP server simple peering definition:
118
119 .. code-block:: yaml
120
121 ntp:
122 server:
123 peers:
124 - 192.168.0.241
125 - 192.168.0.242
126
127* The NTP server extended peering definition:
128
129 .. code-block:: yaml
130
131 ntp:
132 server:
133 peers:
Ondrej Smolad3c67032018-04-04 12:16:05 +0200134 1:
OlgaGusarenko5fc09322018-06-19 11:29:32 +0300135 host: 192.168.31.1
Ondrej Smolad3c67032018-04-04 12:16:05 +0200136 2:
OlgaGusarenko5fc09322018-06-19 11:29:32 +0300137 host: 192.168.31.2
138 3:
139 host: 192.168.31.3
Ondrej Smolad3c67032018-04-04 12:16:05 +0200140
OlgaGusarenko5fc09322018-06-19 11:29:32 +0300141* The NTP server definition enabling the ``listen`` and ``ignore`` actions on
142 specific addresses:
azvyagintsev4e404702018-05-30 20:02:03 +0300143
OlgaGusarenko5fc09322018-06-19 11:29:32 +0300144 .. code-block:: yaml
azvyagintsev4e404702018-05-30 20:02:03 +0300145
OlgaGusarenko5fc09322018-06-19 11:29:32 +0300146 ntp:
147 server:
Stanislav Riazanovb1027022019-03-25 17:42:22 +0400148 interface:
OlgaGusarenko5fc09322018-06-19 11:29:32 +0300149 1:
150 value: wildcard
151 action: ignore
152 2:
153 value: ::1
154 action: listen
155 3:
156 value: 192.168.31.1
157 action: listen
azvyagintsev4e404702018-05-30 20:02:03 +0300158
OlgaGusarenko5fc09322018-06-19 11:29:32 +0300159**Read more**
Filip Pytloun10e4d6c2015-10-06 16:28:32 +0200160
161* https://collectd.org/wiki/index.php/Plugin:NTPd