1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142 | for file in `ls schema`; do echo -e BEGIN $file '---------------------\n'; cat schema/$file; echo -e '-----------------\nOUTPUT:\n'; ./tools/cloudconfig-schema --config-file schema/$file; echo -e "END " $file "----------------------\n\n"; done;
BEGIN invalid-empty-ntp.yaml ---------------------
#cloud-config
ntp:
-----------------
OUTPUT:
ntp: None is not of type 'object'
END invalid-empty-ntp.yaml ----------------------
BEGIN invalid-format.yaml ---------------------
#cloud-config
# pools and servers need to be string objects
ntp:
badkey:
pools:
- '-123'
servers:
- '1.2.3'
- '3.4.5'
-----------------
OUTPUT:
ntp: Additional properties are not allowed ('badkey' was unexpected)
ntp.pools.0: '-123' is not a 'hostname'
END invalid-format.yaml ----------------------
BEGIN invalid-header.yaml ---------------------
#bcloud-config
# this file doesn't start w/ #cloud-config header
-----------------
OUTPUT:
Cloud config file schema/invalid-header.yaml needs to begin with "#cloud-config"
END invalid-header.yaml ----------------------
BEGIN invalid-key.yaml ---------------------
#cloud-config
# Invalidkey should raise an error
ntp:
invalidkey:
-----------------
OUTPUT:
ntp: Additional properties are not allowed ('invalidkey' was unexpected)
ntp: {'invalidkey': None} is not valid under any of the given schemas
END invalid-key.yaml ----------------------
BEGIN invalid-type.yaml ---------------------
#cloud-config
# pools and servers need to be string objects
ntp:
badkey:
pools:
- -123
servers:
- '1.2.3'
- '3.4.5'
-----------------
OUTPUT:
ntp: Additional properties are not allowed ('badkey' was unexpected)
ntp.pools.0: -123 is not of type 'string'
END invalid-type.yaml ----------------------
BEGIN valid.yaml ---------------------
#cloud-config
ntp:
pools:
- '123'
servers:
- '1.2.3'
- '3.4.5'
-----------------
OUTPUT:
Cloud config schema/valid.yaml is valid.
END valid.yaml ----------------------
csmith@uptown:~/src/server/cloud-init/cloud-init$ ./tools/cloudconfig-schema --doc
NTP
---
**Summary:** enable and configure ntp
Handle ntp configuration. If ntp is not installed on the system and ntp configuration is specified, ntp will be installed. If there is a default ntp config file in the image or one is present in the distro's ntp package, it will be copied to ``/etc/ntp.conf.dist`` before any changes are made. A list of ntp pools and ntp servers can be provided under the ``ntp`` config key. If no ntp servers or pools are provided, 4 pools will be used in the format ``{0-3}.{distro}.pool.ntp.org``.
**Internal name:** ``cc_ntp``
**Module frequency:** once-per-instance
**Supported distros:** ['centos', 'debian', 'fedora', 'opensuse', 'ubuntu']
**Config keys**::
ntp (object):
servers (array): List of ntp servers. If both pools and servers are empty, 4 default pool servers will be provided with the format \{0-3\}.\{distro\}.pool.ntp.org.
pools (array): List of ntp pools. If both pools and servers are empty, 4 default pool servers will be provided of the format \{0-3\}.\{distro\}.pool.ntp.org.
$ ./tools/cloudconfig-schema --doc | rst2man | man -l -
NTP() NTP()
NAME
NTP -
Summary: enable and configure ntp
Handle ntp configuration. If ntp is not installed on the system and ntp configuration is specified, ntp will be installed. If there is a default ntp config
file in the image or one is present in the distro's ntp package, it will be copied to /etc/ntp.conf.dist before any changes are made. A list of ntp pools and
ntp servers can be provided under the ntp config key. If no ntp servers or pools are provided, 4 pools will be used in the format {0-3}.{dis‐
tro}.pool.ntp.org.
Internal name: cc_ntp
Module frequency: once-per-instance
Supported distros: ['centos', 'debian', 'fedora', 'opensuse', 'ubuntu']
Config keys:
ntp (object):
servers (array): List of ntp servers. If both pools and servers are empty, 4 default pool servers will be provided with the format \{0-3\}.\{distro\}.pool.ntp.org.
pools (array): List of ntp pools. If both pools and servers are empty, 4 default pool servers will be provided of the format \{0-3\}.\{distro\}.pool.ntp.org.
|