summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-02-05 11:36:49 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-02-14 14:56:18 -0500
commitcfa4ce0a6fe82ed8578fe4668998012ad3833e05 (patch)
tree6f9ff6b2e6dd41230a9abd2db3ef471784acbbfe /doc
parentab208819c734f6cf46e88b24653fd02b1805773a (diff)
downloadbcfg2-cfa4ce0a6fe82ed8578fe4668998012ad3833e05.tar.gz
bcfg2-cfa4ce0a6fe82ed8578fe4668998012ad3833e05.tar.bz2
bcfg2-cfa4ce0a6fe82ed8578fe4668998012ad3833e05.zip
added support for wildcard XInclude in XMLFileBacked
Diffstat (limited to 'doc')
-rw-r--r--doc/server/plugins/grouping/metadata.txt42
1 files changed, 39 insertions, 3 deletions
diff --git a/doc/server/plugins/grouping/metadata.txt b/doc/server/plugins/grouping/metadata.txt
index a6ed37f8e..11b3d5496 100644
--- a/doc/server/plugins/grouping/metadata.txt
+++ b/doc/server/plugins/grouping/metadata.txt
@@ -197,9 +197,9 @@ useful results:
.. code-block:: xml
- <Groups version='3.0' xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="my-groups.xml" />
- <xi:include href="their-groups.xml" />
+ <Groups xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="my-groups.xml" />
+ <xi:include href="their-groups.xml" />
</Groups>
Each of the included groups files has the same format. These files are
@@ -207,6 +207,42 @@ properly validated by ``bcfg2-lint``. This mechanism is useful for
composing group definitions from multiple sources, or setting
different permissions in an svn repository.
+You can also optionally include a file that may or may not exist with
+the ``fallback`` tag:
+
+.. code-block:: xml
+
+ <Groups xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="my-groups.xml"/>
+ <xi:include href="their-groups.xml"><xi:fallback/></xi:include>
+ </Groups>
+
+In this case, if ``their-groups.xml`` does not exist, no error will be
+raised and everything will work fine. (You can also use ``fallback``
+to include a different file, or explicit content in the case that the
+parent include does not exist.)
+
+Wildcard XInclude
+~~~~~~~~~~~~~~~~~
+
+.. versionadded:: 1.3.1
+
+Bcfg2 supports an extension to XInclude that allows you to use shell
+globbing in the hrefs. (Stock XInclude doesn't support this, since
+the href is supposed to be a URL.)
+
+For instance:
+
+ <Groups xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="groups/*.xml"/>
+ </Groups>
+
+This would include all ``*.xml`` files in the ``groups`` subdirectory.
+
+Note that if a glob finds no files, that is treated the same as if a
+single included file does not exist. You should use the ``fallback``
+tag, described above, if a glob may potentially find no files.
+
Probes
======