Page MenuHomeDevCentral

Standardize NTP configuration
ClosedPublic

Authored by ptdradmin on Tue, Mar 3, 14:04.
Tags
None
Referenced Files
F24945682: D3990.id10439.diff
Fri, Mar 20, 17:32
F24937232: D3990.id10468.diff
Fri, Mar 20, 00:21
Unknown Object (File)
Wed, Mar 18, 16:04
Unknown Object (File)
Tue, Mar 17, 11:10
Unknown Object (File)
Mon, Mar 16, 14:28
Unknown Object (File)
Mon, Mar 16, 06:32
Unknown Object (File)
Mon, Mar 16, 01:54
Unknown Object (File)
Mon, Mar 16, 01:24
Subscribers
None

Details

Summary
  • Centralize NTP servers in Pillar
  • Update templates for Chrony and NTpd
  • Manage ntpdate and ntp.conf on FreeBSD

Ref T1223

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
feature/ntp-standardization-T1223
Build Status
Buildable 6501
Build 6785: arc lint + arc unit

Event Timeline

ptdradmin created this revision.

Standardize NTP configuration (T1223) - v2

dereckson retitled this revision from Standardize NTP configuration (T1223) to Standardize NTP configuration.Tue, Mar 3, 17:58
dereckson edited the summary of this revision. (Show Details)

Pillar OK.

Configuration templates OK, with proper headers.

Open questions for the role logic:

  • ntpd vs ntpdate -> which one to run on FreeBSD? We'll need to drop the other one
  • servers are defined twice, one in RC config, one in NTP configuration, which one we keep?

From T2192 and https://agora.nasqueron.org/Operations_grimoire/NTP#FreeBSD:

  • ntpd is favoured
dereckson requested changes to this revision.Wed, Mar 4, 06:38
dereckson added inline comments.
roles/core/ntp/init.sls
44

We don't need that one, but we'd need a /etc/rc.conf.d/ntpd file with as content:

ntpd_enable="YES"

This revision now requires changes to proceed.Wed, Mar 4, 06:38

Apply feedback: use YES (quotes) and add ntpd_sync_on_start

Fix FreeBSD configuration based on dereckson feedback

Final fix: remove ntpdate state from init.sls

Final cleanup: dereckson feedback and fix file corruption

roles/core/ntp/init.sls
18

Actually we're normalizing with " right now.

Normalize to double quotes in Jinja templates as requested

dereckson requested changes to this revision.Thu, Mar 19, 22:55

Looks good to me, just a small style fix and we can deploy it.

roles/core/ntp/init.sls
12

We can remove all the double quotes lines 12 to 22, excepted for Jinja

/etc/chrony.conf:
  file.managed:
    - source: salt://roles/core/ntp/files/chrony.conf.jinja
    - template: jinja
    - context:
        servers: {{ salt["pillar.get"]("ntp_servers") }}
    - user: root
    - group: root
    - mode: 644
    - watch_in:
      - service: chrony_service
26

Double quotes aren't useful here, YAML read most expressions as strings.

One of the only case you need double quotes is this when the value contains :, like keys: "alpha: emc123"

33
This revision now requires changes to proceed.Thu, Mar 19, 22:55

YAML style cleanup: remove unnecessary double quotes while keeping them for Jinja

Looks good to me.

To be deployed to all server this week-end before merging.

Tests servers:

  • Linux / chrony : Dwellers
  • FreeBSD / ntp : WindRiver
This revision is now accepted and ready to land.Thu, Mar 19, 23:07

Avoid blank lines between pool servers (Jinja template)

This revision was automatically updated to reflect the committed changes.