summaryrefslogtreecommitdiffstats
path: root/schemas/types.xsd
blob: 0a55f6355fb30eaff0c2876e4056454d3ac02fb4 (plain)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:py="http://genshi.edgewall.org/" xml:lang="en">

  <xsd:annotation>
    <xsd:documentation>
      string enumeration definitions for bcfg2
      Narayan Desai, Argonne National Laboratory
    </xsd:documentation>
  </xsd:annotation>

  <xsd:include schemaLocation="selinux.xsd"/>
  <xsd:include schemaLocation="augeas.xsd"/>
  <xsd:import namespace="http://genshi.edgewall.org/"
              schemaLocation="genshi.xsd"/>

  <xsd:simpleType name='PackageTypeEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='apk' />
      <xsd:enumeration value='ips' />
      <xsd:enumeration value='macport' />
      <xsd:enumeration value='opencsw' />
      <xsd:enumeration value='pacman' />
      <xsd:enumeration value='deb' />
      <xsd:enumeration value='rpm' />
      <xsd:enumeration value='blast' />
      <xsd:enumeration value='encap' />
      <xsd:enumeration value='sysv' />
      <xsd:enumeration value='ebuild' />
      <xsd:enumeration value='yum' />
      <xsd:enumeration value='freebsdpkg' />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="PackageGroupTypeEnum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="optional"/>
      <xsd:enumeration value="default"/>
      <xsd:enumeration value="mandatory"/>
      <xsd:enumeration value="all"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='PathTypeEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='augeas' />
      <xsd:enumeration value='device' />
      <xsd:enumeration value='directory' />
      <xsd:enumeration value='file' />
      <xsd:enumeration value='hardlink' />
      <xsd:enumeration value='ignore' />
      <xsd:enumeration value='nonexistent' />
      <xsd:enumeration value='permissions' />
      <xsd:enumeration value='symlink' />
      <xsd:enumeration value='vcs' />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='BootStatusEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='on'/>
      <xsd:enumeration value='off'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='StatusEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='on'/>
      <xsd:enumeration value='off'/>
      <xsd:enumeration value="ignore"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='ActionTimingEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='both'/>
      <xsd:enumeration value='pre'/>
      <xsd:enumeration value='post'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='ActionWhenEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='modified'/>
      <xsd:enumeration value='always'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name='ActionStatusEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='ignore'/>
      <xsd:enumeration value='check'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="ServiceTypeEnum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="chkconfig"/>
      <xsd:enumeration value="deb"/>
      <xsd:enumeration value="rc-update"/>
      <xsd:enumeration value="smf"/>
      <xsd:enumeration value="upstart"/>
      <xsd:enumeration value="systemd"/>
      <xsd:enumeration value="launchd"/>
      <xsd:enumeration value="freebsd"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name='ActionType'>
    <xsd:annotation>
      <xsd:documentation>
        Action entries are external shell commands that are executed
        either before bundle installation, after bundle installation
        or both.
      </xsd:documentation>
    </xsd:annotation>

    <xsd:attribute type='ActionTimingEnum' name='timing'>
      <xsd:annotation>
        <xsd:documentation>
          When the action is run. Actions with "pre" timing are run
          after important entries have been installed and before
          bundle entries are installed. Actions with "post" timing
          are run after bundle entries are installed.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type='ActionWhenEnum' name='when'>
      <xsd:annotation>
        <xsd:documentation>
          If the action is always run, or is only run when a bundle
          has been modified.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type='ActionStatusEnum' name='status'>
      <xsd:annotation>
        <xsd:documentation>
          Whether or not to check the return code of the action.  If
          this is "check", then a non-zero return code will result in
          the entry being flagged as bad.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:boolean" name="build" default="true">
      <xsd:annotation>
        <xsd:documentation>
          Also execute the action in build mode.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type='xsd:string' name='name' use='required'>
      <xsd:annotation>
        <xsd:documentation>
          The freeform name of the action.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type='xsd:string' name='command' use='required'>
      <xsd:annotation>
        <xsd:documentation>
          The command to run.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type='xsd:boolean' name='shell'>
      <xsd:annotation>
        <xsd:documentation>
          Whether the command string should be executeed within a shell.
          If enabled flow control and other shell-specific things can
          be used.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attributeGroup ref="py:genshiAttrs"/>
  </xsd:complexType>

  <xsd:simpleType name="DeviceTypeEnum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="block"/>
      <xsd:enumeration value="char"/>
      <xsd:enumeration value="fifo"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="ACLTypeEnum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="default"/>
      <xsd:enumeration value="access"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="ACLScopeEnum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="user"/>
      <xsd:enumeration value="group"/>
      <xsd:enumeration value="other"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="ACLType">
    <xsd:annotation>
      <xsd:documentation>
        Define POSIX ACLs for a Path entry.
      </xsd:documentation>
    </xsd:annotation>

    <xsd:attribute type="ACLTypeEnum" name="type" use="required">
      <xsd:annotation>
        <xsd:documentation>
          ACL type
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="ACLScopeEnum" name="scope">
      <xsd:annotation>
        <xsd:documentation>
          ACL scope.  This is omitted for
          :xml:attribute:`ACLType:type` = ``default``.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="perms" use="required">
      <xsd:annotation>
        <xsd:documentation>
          Permissions for the ACL.  This can either be a single octal
          digit (e.g., ``6`` would indicate read and write, but not
          execute), or a symbolic mode including 'r', 'w', and 'x'.
          You can include '-' for operations that are not permitted,
          but it's not required.  I.e., all of the following are
          identical::

              perms="5"
              perms="rx"
              perms="r-x"
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="user">
      <xsd:annotation>
        <xsd:documentation>
          User the ACL applies to (with :xml:attribute:`ACLType:scope`
          = ``user``).
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="group">
      <xsd:annotation>
        <xsd:documentation>
          Group the ACL applies to (with
          :xml:attribute:`ACLType:scope` = ``group``).
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attributeGroup ref="py:genshiAttrs"/>
  </xsd:complexType>

  <xsd:complexType name="PathType" mixed="true">
    <xsd:annotation>
      <xsd:documentation>
        Manage filesystem paths -- files, directories, symlinks, etc.
      </xsd:documentation>
    </xsd:annotation>

    <xsd:choice minOccurs='0' maxOccurs='unbounded'>
      <xsd:element name='ACL' type='ACLType'/>
      <xsd:group ref="augeasCommands"/>
      <xsd:group ref="py:genshiElements"/>
    </xsd:choice>
    <xsd:attribute type="PathTypeEnum" name="type">
      <xsd:annotation>
        <xsd:documentation>
          Type of path to manage.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="name" use="required">
      <xsd:annotation>
        <xsd:documentation>
          Full path.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="DeviceTypeEnum" name="dev_type">
      <xsd:annotation>
        <xsd:documentation>
          Type of device.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:nonNegativeInteger" name="major">
      <xsd:annotation>
        <xsd:documentation>
          Major device number (``block`` and ``char`` devices only).
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:nonNegativeInteger" name="minor">
      <xsd:annotation>
        <xsd:documentation>
          Minor device number (``block`` and ``char`` devices only).
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:nonNegativeInteger" name="mode">
      <xsd:annotation>
        <xsd:documentation>
          Permissions mode in octal format.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="owner">
      <xsd:annotation>
        <xsd:documentation>
          Owner username or UID number
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="group">
      <xsd:annotation>
        <xsd:documentation>
          Group name or GID number
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="secontext" default="__default__">
      <xsd:annotation>
        <xsd:documentation>
          SELinux context for the path.  This should be a full
          context, not just the type.  E.g.,
          ``system_u:object_r:etc_t:s0``, not just ``etc_t``.  You can
          also specify ``__default__``, which will restore the context
          of the file to the default set by policy.  See
          :ref:`server-selinux` for more information.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:boolean" name="important">
      <xsd:annotation>
        <xsd:documentation>
          Important entries are installed first during client execution.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:boolean" name="recursive">
      <xsd:annotation>
        <xsd:documentation>
          Recursively remove files or set permissions, as appropriate.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:boolean" name="prune">
      <xsd:annotation>
        <xsd:documentation>
          Remove entries that are not in the Bcfg2 specification from
          the directory.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="to">
      <xsd:annotation>
        <xsd:documentation>
          File to link to
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:boolean" name="empty">
      <xsd:annotation>
        <xsd:documentation>
          The file entry has no content.  This must be set as a
          safeguard against accidentally empty content.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="VCSTypeEnum" name="vcstype">
      <xsd:annotation>
        <xsd:documentation>
          The VCS backend to checkout contents from.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="revision">
      <xsd:annotation>
        <xsd:documentation>
          The revision to checkout.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:anyURI" name="sourceurl">
      <xsd:annotation>
        <xsd:documentation>
          The VCS URL to checkout.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="encrypted">
      <xsd:annotation>
        <xsd:documentation>
          The name of the encryption passphrase that the text content
          of this tag is encrypted with.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:token" name="lens">
      <xsd:annotation>
        <xsd:documentation>
          The Augeas lens to use when editing files in a non-standard
          (according to Augeas) location.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attributeGroup ref="py:genshiAttrs"/>
  </xsd:complexType>

  <xsd:simpleType name='VCSTypeEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='svn'/>
      <xsd:enumeration value='git'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="MemberOfType">
    <xsd:annotation>
      <xsd:documentation>
        Specify additional supplementary groups for the POSIXUser
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:extension base="xsd:token">
        <xsd:attribute name="group" type="xsd:token">
          <xsd:annotation>
            <xsd:documentation>
              The name of the supplementary group.  This can also be
              specified as content of the tag, although that is
              deprecated.
            </xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

   <xsd:complexType name="MemberOfContainerType">
    <xsd:choice maxOccurs="unbounded">
      <xsd:element name="MemberOf" type="MemberOfType"/>
      <xsd:element name="Client" type="MemberOfContainerType"/>
      <xsd:element name="Group" type="MemberOfContainerType"/>
    </xsd:choice>
    <xsd:attribute name="name" type="xsd:string" use="required"/>
    <xsd:attribute name="negate" type="xsd:boolean"/>
  </xsd:complexType>

  <xsd:complexType name="POSIXUserType">
    <xsd:annotation>
      <xsd:documentation>
        The POSIXUser tag allows you to create users on client machines.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:choice minOccurs='0' maxOccurs='unbounded'>
      <xsd:element name='MemberOf' type='MemberOfType'/>
      <xsd:element name='Group' type='MemberOfContainerType'/>
      <xsd:element name='Client' type='MemberOfContainerType'/>
    </xsd:choice>
    <xsd:attribute type="xsd:token" name="name" use="required">
      <xsd:annotation>
        <xsd:documentation>
          Username
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:integer" name="uid">
      <xsd:annotation>
        <xsd:documentation>
          User ID number.  If this is not specified, each client is
          allowed to set the UID.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:token" name="group">
      <xsd:annotation>
        <xsd:documentation>
          Name of the user's primary group.  If this is not set, the
          user's primary group will be the same as the username.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="gecos">
      <xsd:annotation>
        <xsd:documentation>
          This field is typically used to record general information
          about the account or its user(s) such as their real name
          and phone number. If this is not set, the GECOS will be
          the same as the username.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="home">
      <xsd:annotation>
        <xsd:documentation>
          User's home directory.  Default is ``/root`` for the root
          user, ``/home/&lt;username&gt;`` otherwise.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:string" name="shell" default="/bin/bash">
      <xsd:annotation>
        <xsd:documentation>
          User's shell
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attributeGroup ref="py:genshiAttrs"/>
  </xsd:complexType>

  <xsd:complexType name="POSIXGroupType">
    <xsd:annotation>
      <xsd:documentation>
        The POSIXGroup tag allows you to create groups on client
        machines.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:attribute type="xsd:token" name="name" use="required">
      <xsd:annotation>
        <xsd:documentation>
          Username
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute type="xsd:integer" name="gid">
      <xsd:annotation>
        <xsd:documentation>
          Group ID number.  If this is not specified, each client is
          allowed to set the GID.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attributeGroup ref="py:genshiAttrs"/>
  </xsd:complexType>
</xsd:schema>