Merge ~paulgear/ntp-charm/+git/ntp-charm:master into ntp-charm:master

Proposed by Paul Gear
Status: Merged
Merged at revision: c3b87f0fc81b9d889a2c4f399ccd8d8fed5d4b1a
Proposed branch: ~paulgear/ntp-charm/+git/ntp-charm:master
Merge into: ntp-charm:master
Diff against target: 74 lines (+16/-7)
2 files modified
config.yaml (+14/-6)
templates/ntp.conf (+2/-1)
Reviewer Review Type Date Requested Status
Junien F Approve
Stuart Bishop (community) Approve
Review via email: mp+311104@code.launchpad.net

Description of the change

This change (from server to pool in /etc/ntp.conf) will produce the following effects:
- on trusty, a longer list of peers will be selected from the pool at service start time
- on xenial, one server from each pool will be selected at start time, and poor quality/unresponsive servers will be replaced with new servers periodically

To post a comment you must log in.
Revision history for this message
Junien F (axino) wrote :

This looks good.

Does precise's ntp understand "pool" ?

Revision history for this message
Stuart Bishop (stub) wrote :

Per metadata.yaml, the charm does not support precise so we don't care about that.

Looks good. One trivial point inline.

review: Approve
Revision history for this message
Stuart Bishop (stub) :
Revision history for this message
Junien F (axino) wrote :

+1

review: Approve
Revision history for this message
Paul Gear (paulgear) wrote :

> This looks good.
>
> Does precise's ntp understand "pool" ?

precise's ntp does understand pool, so this should still work even if forced onto precise.

Revision history for this message
Paul Gear (paulgear) wrote :

> ...
> Looks good. One trivial point inline.

Updated to use > except in one case where indentation is required; not sure if there's a better way to do that with yaml...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index 13929ea..cadefa1 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -2,11 +2,17 @@ options:
6 source:
7 default: ""
8 type: string
9- description: Space separated list of NTP servers to use as source for time.
10+ description: >
11+ Space-separated list of NTP servers to use as sources for time.
12+ Servers are added using the 'pool' directive to allow recent ntp
13+ versions to automatically drop poor quality sources from the
14+ running configuration and select new ones from the pool.
15 peers:
16 default: ""
17 type: string
18- description: Space separated list of NTP servers to use as peers for time.
19+ description: >
20+ Space-separated list of NTP servers to use as peers for time.
21+ Peers are allowed to query the local NTP server via ntpq.
22 nagios_context:
23 default: "juju"
24 type: string
25@@ -20,24 +26,26 @@ options:
26 nagios_servicegroups:
27 default: ""
28 type: string
29- description: |
30+ description: >
31 A comma-separated list of nagios servicegroups.
32 If left empty, the nagios_context will be used as the servicegroup.
33 nagios_ntpmon_checks:
34 default: "offset peers reachability sync"
35 type: string
36- description: |
37+ description: >
38 A space-separated list of nagios ntpmon checks to enable.
39 Options are "offset peers reachability sync"; if all are specified,
40 they are combined into a single check; leave empty for no checks.
41 auto_peers:
42 default: false
43 type: boolean
44- description:
45+ description: >
46 Automatically peer with other units in the same service.
47 DEPRECATED. Please consider using the ntpmaster charm to provide
48 sufficient peers for your environment in favour of auto_peers.
49 use_iburst:
50 default: true
51 type: boolean
52- description: Use iburst for all servers, not just ntpmaster.
53+ description: >
54+ Use iburst for all peers/sources, not just those received via the
55+ master relation.
56diff --git a/templates/ntp.conf b/templates/ntp.conf
57index 605c880..882155a 100644
58--- a/templates/ntp.conf
59+++ b/templates/ntp.conf
60@@ -6,12 +6,13 @@ filegen peerstats file peerstats type day enable
61 filegen clockstats file clockstats type day enable
62 restrict -4 default kod notrap nomodify nopeer noquery
63 restrict -6 default kod notrap nomodify nopeer noquery
64+restrict source notrap nomodify noquery
65 restrict 127.0.0.1
66 restrict ::1
67 {% for peer in peers %}restrict {{ peer.name }} kod notrap nomodify
68 {% endfor %}
69 # SERVERS
70-{% for server in servers %}server {{ server.name }} {{ server.iburst }}
71+{% for server in servers %}pool {{ server.name }} {{ server.iburst }}
72 {% endfor %}
73 # PEERS
74 {% for peer in peers %}peer {{ peer.name }} {{ peer.iburst }}

Subscribers

People subscribed via source and target branches