Skip to content

Commit 74abbbe

Browse files
author
Ritwick DSouza
committed
[raspbian] Added documentation for NTP settings
1 parent ddb356d commit 74abbbe

2 files changed

Lines changed: 48 additions & 2 deletions

File tree

docs/source/backends/raspbian.rst

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ Will result in::
476476
wireless-channel 1
477477
wireless-essid freifunk
478478
wireless-mode ad-hoc
479-
479+
480480

481481
WPA2 Personal (Pre-Shared Key)
482482
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -530,3 +530,49 @@ Will be rendered as follows::
530530
wpa_key_mgmt=WPA-PSK
531531
wpa_passphrase=passphrase012345
532532
wpa_pairwise=TKIP CCMP
533+
534+
NTP settings
535+
------------
536+
537+
The Network Time Protocol settings reside in the ``ntp`` key of the
538+
*configuration dictionary*, which is a custom NetJSON extension not present in
539+
the original NetJSON RFC.
540+
541+
The ``ntp`` key must contain a dictionary, the allowed options are:
542+
543+
+-------------------+---------+---------------------+
544+
| key name | type | function |
545+
+===================+=========+=====================+
546+
| ``enabled`` | boolean | ntp client enabled |
547+
+-------------------+---------+---------------------+
548+
| ``enable_server`` | boolean | ntp server enabled |
549+
+-------------------+---------+---------------------+
550+
| ``server`` | list | list of ntp servers |
551+
+-------------------+---------+---------------------+
552+
553+
NTP settings example
554+
~~~~~~~~~~~~~~~~~~~~
555+
556+
The following *configuration dictionary* :
557+
558+
.. code-block:: python
559+
560+
{
561+
"ntp": {
562+
"enabled": True,
563+
"enable_server": False,
564+
"server": [
565+
"0.openwrt.pool.ntp.org",
566+
"1.openwrt.pool.ntp.org",
567+
"2.openwrt.pool.ntp.org",
568+
"3.openwrt.pool.ntp.org"
569+
]
570+
}
571+
572+
Will be rendered as follows::
573+
574+
config: /etc/ntp.conf
575+
server 0.openwrt.pool.ntp.org
576+
server 1.openwrt.pool.ntp.org
577+
server 2.openwrt.pool.ntp.org
578+
server 3.openwrt.pool.ntp.org

tests/raspbian/test_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_ntp(self):
2020
}
2121
})
2222

23-
expected = '''config: /etc/ntp.config
23+
expected = '''config: /etc/ntp.conf
2424
server 0.openwrt.pool.ntp.org
2525
server 1.openwrt.pool.ntp.org
2626
server 2.openwrt.pool.ntp.org

0 commit comments

Comments
 (0)