diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-07-03 08:56:47 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-07-03 08:56:47 -0400 |
commit | 09e934512dc053a96bd7b16c2c95563e055720f7 (patch) | |
tree | e1351268921fb0fc3b64df8d565044df25196930 /schemas | |
parent | 9fe65b2fe9323da6583625cde1b2494352207d51 (diff) | |
download | bcfg2-09e934512dc053a96bd7b16c2c95563e055720f7.tar.gz bcfg2-09e934512dc053a96bd7b16c2c95563e055720f7.tar.bz2 bcfg2-09e934512dc053a96bd7b16c2c95563e055720f7.zip |
added selinux support
Diffstat (limited to 'schemas')
-rw-r--r-- | schemas/base.xsd | 3 | ||||
-rw-r--r-- | schemas/bundle.xsd | 127 | ||||
-rw-r--r-- | schemas/defaults.xsd | 27 | ||||
-rw-r--r-- | schemas/info.xsd | 1 | ||||
-rw-r--r-- | schemas/pathentry.xsd | 21 | ||||
-rw-r--r-- | schemas/rules.xsd | 113 | ||||
-rw-r--r-- | schemas/servicetype.xsd | 2 | ||||
-rw-r--r-- | schemas/types.xsd | 113 |
8 files changed, 214 insertions, 193 deletions
diff --git a/schemas/base.xsd b/schemas/base.xsd index cca665b38..98682fdb5 100644 --- a/schemas/base.xsd +++ b/schemas/base.xsd @@ -10,6 +10,7 @@ <xsd:include schemaLocation="atom.xsd"/> <xsd:include schemaLocation="pathentry.xsd"/> <xsd:include schemaLocation="rules.xsd"/> + <xsd:include schemaLocation="types.xsd"/> <xsd:group name='BaseEntries'> <xsd:choice> @@ -19,7 +20,7 @@ <xsd:element name='Path' type='PathEntry'/> <xsd:element name='Service' type='StructureEntry'/> <xsd:element name='BoundPackage' type='PackageType'/> - <xsd:element name='BoundPath' type='BoundPathEntry'/> + <xsd:element name='BoundPath' type='PathType'/> <xsd:element name='BoundService' type='ServiceType'/> </xsd:choice> </xsd:group> diff --git a/schemas/bundle.xsd b/schemas/bundle.xsd index 4e034ee3c..b72b174e2 100644 --- a/schemas/bundle.xsd +++ b/schemas/bundle.xsd @@ -16,10 +16,12 @@ <xsd:include schemaLocation="atom.xsd"/> <xsd:include schemaLocation="pathentry.xsd"/> <xsd:include schemaLocation="rules.xsd"/> + <xsd:include schemaLocation="types.xsd"/> <xsd:include schemaLocation="services.xsd"/> - <xsd:complexType name='GroupType'> - <xsd:choice minOccurs='0' maxOccurs='unbounded'> + <xsd:group name="bundleElements"> + <xsd:choice> + <xsd:group ref="py:genshiElements"/> <xsd:element name='Package' type='PackageStructure'> <xsd:annotation> <xsd:documentation> @@ -56,12 +58,20 @@ </xsd:documentation> </xsd:annotation> </xsd:element> + <xsd:element name='SELinux' type='SELinuxStructure'> + <xsd:annotation> + <xsd:documentation> + Abstract implementation of an SELinux entry. The + full specification will be included in Rules. + </xsd:documentation> + </xsd:annotation> + </xsd:element> <xsd:element name='PostInstall' type='StructureEntry'> <xsd:annotation> <xsd:documentation> PostInstall entries are deprecated in favor of Action - entries. Actions can do everything PostInstall entries can - do and more. + entries. Actions can do everything PostInstall entries can + do and more. </xsd:documentation> </xsd:annotation> </xsd:element> @@ -72,7 +82,7 @@ </xsd:documentation> </xsd:annotation> </xsd:element> - <xsd:element name='BoundPath' type='BoundPathEntry'> + <xsd:element name='BoundPath' type='PathType'> <xsd:annotation> <xsd:documentation> Fully bound description of a filesystem path to be handled @@ -94,6 +104,13 @@ </xsd:documentation> </xsd:annotation> </xsd:element> + <xsd:element name='BoundSELinux' type='SELinuxType'> + <xsd:annotation> + <xsd:documentation> + Fully bound description of an SELinux entry. + </xsd:documentation> + </xsd:annotation> + </xsd:element> <xsd:element name='Group' type='GroupType'> <xsd:annotation> <xsd:documentation> @@ -107,7 +124,7 @@ <xsd:annotation> <xsd:documentation> Elements within Client tags only apply to the named client - (or vice-versa; see #element_negate below) + (or vice-versa; see #element_negate below) </xsd:documentation> </xsd:annotation> </xsd:element> @@ -119,7 +136,12 @@ </xsd:documentation> </xsd:annotation> </xsd:element> - <xsd:group ref="py:genshiElements"/> + </xsd:choice> + </xsd:group> + + <xsd:complexType name='GroupType'> + <xsd:choice minOccurs='0' maxOccurs='unbounded'> + <xsd:group ref="bundleElements"/> </xsd:choice> <xsd:attribute type='xsd:string' name='name' use='required'> <xsd:annotation> @@ -140,96 +162,7 @@ <xsd:complexType name='BundleType'> <xsd:choice minOccurs='0' maxOccurs='unbounded'> - <xsd:element name='Package' type='PackageStructure'> - <xsd:annotation> - <xsd:documentation> - Abstract implementation of a Package entry. The full - specification will be generated by a plugin such as - Packages. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='Path' type='PathEntry'> - <xsd:annotation> - <xsd:documentation> - Abstract implementation of a Path entry. The entry will - either be handled by Cfg, TGenshi, or another - DirectoryBacked plugin; or handled by Rules, in which case - the full specification of this entry will be included in - Rules. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='Service' type='StructureEntry'> - <xsd:annotation> - <xsd:documentation> - Abstract implementation of a Service entry. The full - specification will be included in Rules. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='Action' type='StructureEntry'> - <xsd:annotation> - <xsd:documentation> - Abstract implementation of an Action entry. The full - specification will be included in Rules. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='BoundPackage' type='PackageType'> - <xsd:annotation> - <xsd:documentation> - Fully bound description of a software package to be managed. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='BoundPath' type='BoundPathEntry'> - <xsd:annotation> - <xsd:documentation> - Fully bound description of a filesystem path to be handled - by the POSIX driver. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='BoundService' type='ServiceType'> - <xsd:annotation> - <xsd:documentation> - Fully bound description of a system service to be managed. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='BoundAction' type='ActionType'> - <xsd:annotation> - <xsd:documentation> - Fully bound description of a command to be run. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='Group' type='GroupType'> - <xsd:annotation> - <xsd:documentation> - Elements within Group tags only apply to clients that are - members of that group - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='Client' type='GroupType'> - <xsd:annotation> - <xsd:documentation> - Elements within Client tags only apply to the named client - (or vice-versa; see #element_negate below) - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name='Bundle' type='BundleType'> - <xsd:annotation> - <xsd:documentation> - Nesting Bundle tags is allowed in order to support - XInclude within Bundles. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:group ref="py:genshiElements"/> + <xsd:group ref="bundleElements"/> </xsd:choice> <xsd:attribute type='xsd:string' name='description' /> <xsd:attribute type='xsd:string' name='name'/> diff --git a/schemas/defaults.xsd b/schemas/defaults.xsd index c7e2edc7e..17ae84366 100644 --- a/schemas/defaults.xsd +++ b/schemas/defaults.xsd @@ -11,33 +11,6 @@ <xsd:include schemaLocation="types.xsd"/> <xsd:include schemaLocation="pkgtype.xsd"/> - <xsd:complexType name="ActionType"> - <xsd:attribute type="ActionTimingEnum" name="timing"/> - <xsd:attribute type="ActionWhenEnum" name="when"/> - <xsd:attribute type="ActionStatusEnum" name="status"/> - <xsd:attribute type="xsd:boolean" name="build"/> - <xsd:attribute type="xsd:string" name="name" use="required"/> - <xsd:attribute type="xsd:string" name="command"/> - </xsd:complexType> - - <xsd:complexType name="PathType"> - <xsd:attribute type="PathTypeEnum" name="type"/> - <xsd:attribute type="xsd:string" name="name" use="required"/> - <xsd:attribute type="xsd:string" name="dev_type"/> - <xsd:attribute type="xsd:string" name="major"/> - <xsd:attribute type="xsd:string" name="minor"/> - <xsd:attribute type="xsd:string" name="mode"/> - <xsd:attribute type="xsd:string" name="perms"/> - <xsd:attribute type="xsd:string" name="owner"/> - <xsd:attribute type="xsd:string" name="group"/> - <xsd:attribute type="xsd:string" name="recursive"/> - <xsd:attribute type="xsd:string" name="prune"/> - <xsd:attribute type="xsd:string" name="to"/> - <xsd:attribute type="xsd:string" name="vcstype"/> - <xsd:attribute type="xsd:string" name="revision"/> - <xsd:attribute type="xsd:string" name="sourceurl"/> - </xsd:complexType> - <xsd:complexType name="DContainerType"> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element name="Service" type="ServiceType"/> diff --git a/schemas/info.xsd b/schemas/info.xsd index 37232ab23..c45c40ebc 100644 --- a/schemas/info.xsd +++ b/schemas/info.xsd @@ -14,6 +14,7 @@ <xsd:attribute name='important' type='xsd:string'/> <xsd:attribute name='owner' type='xsd:string'/> <xsd:attribute name='perms' type='xsd:string'/> + <xsd:attribute name='secontext' type='xsd:string'/> <xsd:attribute name='paranoid' type='xsd:boolean'/> <xsd:attribute name='sensitive' type='xsd:boolean'/> </xsd:complexType> diff --git a/schemas/pathentry.xsd b/schemas/pathentry.xsd index 080758d0b..e5d2ef6af 100644 --- a/schemas/pathentry.xsd +++ b/schemas/pathentry.xsd @@ -16,25 +16,4 @@ <xsd:attribute type='xsd:string' name='altsrc' use='optional'/> <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> - - <xsd:complexType name='BoundPathEntry'> - <xsd:attribute type='xsd:string' name='name' use='required'/> - <xsd:attribute type='xsd:string' name='group' use='optional'/> - <xsd:attribute type='xsd:string' name='important' use='optional'/> - <xsd:attribute type='xsd:string' name='owner' use='optional'/> - <xsd:attribute type='xsd:string' name='paranoid' use='optional'/> - <xsd:attribute type='xsd:string' name='perms' use='optional'/> - <xsd:attribute type='xsd:string' name='prune' use='optional'/> - <xsd:attribute type='xsd:string' name='recursive' use='optional'/> - <xsd:attribute type='xsd:string' name='sensitive' use='optional'/> - <xsd:attribute type='xsd:string' name='to' use='optional'/> - <xsd:attribute type='xsd:string' name='type' use='optional'/> - <!-- device attributes --> - <xsd:attribute type='xsd:string' name='dev_type' use='optional'/> - <xsd:attribute type='xsd:string' name='major' use='optional'/> - <xsd:attribute type='xsd:string' name='minor' use='optional'/> - <xsd:attribute type='xsd:string' name='mode' use='optional'/> - <!-- end device attributes --> - <xsd:attributeGroup ref="py:genshiAttrs"/> - </xsd:complexType> </xsd:schema> diff --git a/schemas/rules.xsd b/schemas/rules.xsd index 924792b18..2f4f805c0 100644 --- a/schemas/rules.xsd +++ b/schemas/rules.xsd @@ -14,66 +14,91 @@ <xsd:import namespace="http://genshi.edgewall.org/" schemaLocation="genshi.xsd"/> - <xsd:complexType name='ActionType'> - <xsd:attribute type='ActionTimingEnum' name='timing'/> - <xsd:attribute type='ActionWhenEnum' name='when'/> - <xsd:attribute type='ActionStatusEnum' name='status'/> - <xsd:attribute type="xsd:boolean" name="build"/> - <xsd:attribute type='xsd:string' name='name'/> - <xsd:attribute type='xsd:string' name='command'/> - <xsd:attributeGroup ref="py:genshiAttrs"/> - </xsd:complexType> - <xsd:complexType name='PostInstallType'> <xsd:attribute type='xsd:string' name='name' use='required'/> </xsd:complexType> - <xsd:complexType name='PathType'> - <xsd:attribute type='PathTypeEnum' name='type' use='required'/> - <xsd:attribute type='xsd:string' name='name' use='required'/> - <xsd:attribute type='xsd:string' name='dev_type'/> - <xsd:attribute type='xsd:string' name='major'/> - <xsd:attribute type='xsd:string' name='minor'/> - <xsd:attribute type='xsd:string' name='mode'/> - <xsd:attribute type='xsd:string' name='perms'/> - <xsd:attribute type='xsd:string' name='owner'/> - <xsd:attribute type='xsd:string' name='group'/> - <xsd:attribute type='xsd:string' name='recursive'/> - <xsd:attribute type='xsd:string' name='prune'/> - <xsd:attribute type='xsd:string' name='to'/> - <xsd:attribute type='xsd:string' name='vcstype'/> - <xsd:attribute type='xsd:string' name='revision'/> - <xsd:attribute type='xsd:string' name='sourceurl'/> - <xsd:attributeGroup ref="py:genshiAttrs"/> - </xsd:complexType> + <xsd:group name="rulesElements"> + <xsd:choice> + <xsd:group ref="py:genshiElements"/> + <xsd:element name='Package' type='PackageType'> + <xsd:annotation> + <xsd:documentation> + Fully bound description of a software package to be managed. + </xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name='Path' type='PathType'> + <xsd:annotation> + <xsd:documentation> + Fully bound description of a filesystem path to be handled + by the POSIX driver. + </xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name='Service' type='ServiceType'> + <xsd:annotation> + <xsd:documentation> + Fully bound description of a system service to be managed. + </xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name='Action' type='ActionType'> + <xsd:annotation> + <xsd:documentation> + Fully bound description of a command to be run. + </xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name='SELinux' type='SELinuxType'> + <xsd:annotation> + <xsd:documentation> + Fully bound description of an SELinux entry. + </xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name='PostInstall' type='PostInstallType'> + <xsd:annotation> + <xsd:documentation> + PostInstall entries are deprecated in favor of Action + entries. Actions can do everything PostInstall entries can + do and more. + </xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name='Group' type='RContainerType'> + <xsd:annotation> + <xsd:documentation> + Elements within Group tags only apply to clients that are + members of that group (or vice-versa; see #element_negate + below) + </xsd:documentation> + </xsd:annotation> + </xsd:element> + <xsd:element name='Client' type='RContainerType'> + <xsd:annotation> + <xsd:documentation> + Elements within Client tags only apply to the named client + (or vice-versa; see #element_negate below) + </xsd:documentation> + </xsd:annotation> + </xsd:element> + </xsd:choice> + </xsd:group> <xsd:complexType name='RContainerType'> <xsd:choice minOccurs='0' maxOccurs='unbounded'> - <xsd:element name='Service' type='ServiceType'/> - <xsd:element name='Package' type='PackageType'/> - <xsd:element name='Path' type='PathType'/> - <xsd:element name='Action' type='ActionType'/> - <xsd:element name='Group' type='RContainerType'/> - <xsd:element name='Client' type='RContainerType'/> - <xsd:group ref="py:genshiElements"/> + <xsd:group ref="rulesElements"/> </xsd:choice> <xsd:attribute name='name' type='xsd:string'/> <xsd:attribute name='negate' type='xsd:boolean'/> <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> - <xsd:element name='Rules'> <xsd:complexType> <xsd:choice minOccurs='0' maxOccurs='unbounded'> - <xsd:element name='Service' type='ServiceType'/> - <xsd:element name='Package' type='PackageType'/> - <xsd:element name='Path' type='PathType'/> - <xsd:element name='Action' type='ActionType'/> - <xsd:element name='PostInstall' type='PostInstallType'/> - <xsd:element name='Group' type='RContainerType'/> - <xsd:element name='Client' type='RContainerType'/> - <xsd:group ref="py:genshiElements"/> + <xsd:group ref="rulesElements"/> </xsd:choice> <xsd:attribute name='priority' type='xsd:integer' use='required'/> <xsd:attributeGroup ref="py:genshiAttrs"/> diff --git a/schemas/servicetype.xsd b/schemas/servicetype.xsd index 4cab3716c..7de847c7f 100644 --- a/schemas/servicetype.xsd +++ b/schemas/servicetype.xsd @@ -13,7 +13,7 @@ schemaLocation="genshi.xsd"/> <xsd:simpleType name='RestartEnum'> - <xsd:restriction base='xsd:boolean'> + <xsd:restriction base='xsd:string'> <xsd:enumeration value='true'/> <xsd:enumeration value='false'/> <xsd:enumeration value='1'/> diff --git a/schemas/types.xsd b/schemas/types.xsd index ead377192..a7dae15c9 100644 --- a/schemas/types.xsd +++ b/schemas/types.xsd @@ -1,5 +1,6 @@ -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en"> - +<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 @@ -7,6 +8,9 @@ </xsd:documentation> </xsd:annotation> + <xsd:import namespace="http://genshi.edgewall.org/" + schemaLocation="genshi.xsd"/> + <xsd:simpleType name='PackageTypeEnum'> <xsd:restriction base='xsd:string'> <xsd:enumeration value='deb' /> @@ -86,4 +90,109 @@ </xsd:restriction> </xsd:simpleType> + <xsd:complexType name='ActionType'> + <xsd:attribute type='ActionTimingEnum' name='timing'/> + <xsd:attribute type='ActionWhenEnum' name='when'/> + <xsd:attribute type='ActionStatusEnum' name='status'/> + <xsd:attribute type="xsd:boolean" name="build"/> + <xsd:attribute type='xsd:string' name='name'/> + <xsd:attribute type='xsd:string' name='command'/> + <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:complexType name="PathType"> + <xsd:attribute type="PathTypeEnum" name="type"/> + <xsd:attribute type="xsd:string" name="name" use="required"/> + <xsd:attribute type="DeviceTypeEnum" name="dev_type"/> + <xsd:attribute type="xsd:integer" name="major"/> + <xsd:attribute type="xsd:integer" name="minor"/> + <xsd:attribute type="xsd:string" name="mode"/> + <xsd:attribute type="xsd:string" name="perms"/> + <xsd:attribute type="xsd:string" name="owner"/> + <xsd:attribute type="xsd:string" name="group"/> + <xsd:attribute type="xsd:string" name="secontext"/> + <xsd:attribute type="xsd:string" name="recursive"/> + <xsd:attribute type="xsd:string" name="prune"/> + <xsd:attribute type="xsd:string" name="to"/> + <xsd:attribute type="xsd:string" name="vcstype"/> + <xsd:attribute type="xsd:string" name="revision"/> + <xsd:attribute type="xsd:string" name="sourceurl"/> + <xsd:attributeGroup ref="py:genshiAttrs"/> + </xsd:complexType> + + <xsd:simpleType name='SELinuxTypeEnum'> + <xsd:restriction base='xsd:string'> + <xsd:enumeration value='boolean'/> + <xsd:enumeration value='module'/> + <xsd:enumeration value='port'/> + <xsd:enumeration value='fcontext'/> + <xsd:enumeration value='node'/> + <xsd:enumeration value='login'/> + <xsd:enumeration value='user'/> + <xsd:enumeration value='interface'/> + <xsd:enumeration value='permissive'/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name='SELinuxFileTypeEnum'> + <xsd:restriction base='xsd:string'> + <xsd:enumeration value='all'/> + <xsd:enumeration value='regular'/> + <xsd:enumeration value='directory'/> + <xsd:enumeration value='symlink'/> + <xsd:enumeration value='pipe'/> + <xsd:enumeration value='socket'/> + <xsd:enumeration value='block'/> + <xsd:enumeration value='char'/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name='SELinuxBooleanValueEnum'> + <xsd:restriction base='xsd:string'> + <xsd:enumeration value='on'/> + <xsd:enumeration value='off'/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name='SELinuxEntryTypeEnum'> + <xsd:restriction base='xsd:string'> + <xsd:enumeration value='boolean'/> + <xsd:enumeration value='module'/> + <xsd:enumeration value='port'/> + <xsd:enumeration value='fcontext'/> + <xsd:enumeration value='node'/> + <xsd:enumeration value='login'/> + <xsd:enumeration value='user'/> + <xsd:enumeration value='interface'/> + <xsd:enumeration value='permissive'/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:complexType name="SELinuxStructure"> + <xsd:attribute type='xsd:string' name='name' use='required'/> + <xsd:attribute type="xsd:boolean" name="disabled"/> + <xsd:attributeGroup ref="py:genshiAttrs"/> + </xsd:complexType> + + <xsd:complexType name="SELinuxType"> + <xsd:attribute type="xsd:string" name="name" use="required"/> + <xsd:attribute type="SELinuxEntryTypeEnum" name="type" use="required"/> + <xsd:attribute type="SELinuxBooleanValueEnum" name="value"/> + <xsd:attribute type="xsd:boolean" name="disabled"/> + <xsd:attribute type="xsd:string" name="selinuxtype"/> + <xsd:attribute type="SELinuxFileTypeEnum" name="filetype"/> + <xsd:attribute type="xsd:string" name="proto"/> + <xsd:attribute type="xsd:string" name="roles"/> + <xsd:attribute type="xsd:string" name="prefix"/> + <xsd:attribute type="xsd:string" name="selinuxuser"/> + <xsd:attributeGroup ref="py:genshiAttrs"/> + </xsd:complexType> </xsd:schema> |