From 0431e9fcd2fa3c6c40a7de9821f388bec3557364 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Fri, 26 Mar 2010 15:29:32 -0500 Subject: doc: Add information about unmanaged host public ssh keys Signed-off-by: Sol Jerome --- doc/client/modes.txt | 2 +- doc/server/configurationentries.txt | 2 +- doc/server/plugins/generators/rules.txt | 2 +- doc/server/plugins/generators/sshbase.txt | 23 ++++++++++++++++++ doc/server/plugins/generators/tcheetah.txt | 27 +++++++++++++--------- .../plugins/generators/tgenshi/clientsxml.txt | 18 +++++++-------- doc/server/plugins/generators/tgenshi/test.txt | 12 ++++++---- 7 files changed, 58 insertions(+), 28 deletions(-) diff --git a/doc/client/modes.txt b/doc/client/modes.txt index f2f2b175e..f3f48ca38 100644 --- a/doc/client/modes.txt +++ b/doc/client/modes.txt @@ -59,7 +59,7 @@ will also keep the five most recent backups of files. Overall client service mode =========================== -`New in version 1.0.0` +.. versionadded:: 1.0.0 Overall client service mode. Specified on the client using ``-s `_ -object, loaded from the data in ``/var/lib/bcfg2/etc/properties.xml``. -That file should have a ``Properties`` node at its root. +Properties is a python `ElementTree `_ +object, loaded from the data in ``/var/lib/bcfg2/Properties/.xml``. That file should have a ``Properties`` node at its root. -Example ``properties.xml``: +Example ``Properties/example.xml``: .. code-block:: xml @@ -75,13 +75,13 @@ You may use any of the ElementTree methods to access data in your template. Several examples follow, each producing an identical result on the host 'www.example.com':: - $self.properties.find('host').find('www.example.com').find('rootdev').text - $self.properties.find('host').find($self.metadata.hostname).find('rootdev').text - ${self.properties.xpath('host/www.example.com/rootdev')[0].text} - ${self.properties.xpath('host/' + self.metadata.hostname + '/rootdev')[0].text} + $self.Properties['example.xml'].find('host').find('www.example.com').find('rootdev').text + $self.Properties['example.xml'].find('host').find($self.metadata.hostname).find('rootdev').text + ${self.Properties['example.xml'].xpath('host/www.example.com/rootdev')[0].text} + ${self.Properties['example.xml'].xpath('host/' + self.metadata.hostname + '/rootdev')[0].text} #set $path = 'host/' + $self.metadata.hostname + '/rootdev' - ${self.properties.xpath($path)[0].text} - ${self.properties.xpath(path)[0].text} + ${self.Properties['example.xml'].xpath($path)[0].text} + ${self.Properties['example.xml'].xpath(path)[0].text} Simple Example ============== @@ -169,7 +169,12 @@ consistent, randomized time between midnight and 7am.:: 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly. .. note:: Comments and Cheetah - As Cheetah processes your templates it will consider hash "#" style comments to be actual comments in the template and will strip them from the final config file. If you would like to preserve the comment in the final config file you need to escape the hash character '\#' which will tell Cheetah (and Python) that you do in fact want the comment to appear in the final config file.:: + As Cheetah processes your templates it will consider hash "#" style + comments to be actual comments in the template and will strip them + from the final config file. If you would like to preserve the comment + in the final config file you need to escape the hash character '\#' + which will tell Cheetah (and Python) that you do in fact want the + comment to appear in the final config file.:: # This is a comment in my template which will be stripped when it's processed through Cheetah \# This comment will appear in the generated config file. diff --git a/doc/server/plugins/generators/tgenshi/clientsxml.txt b/doc/server/plugins/generators/tgenshi/clientsxml.txt index 3d5553570..10be3232c 100644 --- a/doc/server/plugins/generators/tgenshi/clientsxml.txt +++ b/doc/server/plugins/generators/tgenshi/clientsxml.txt @@ -12,17 +12,17 @@ Here is an example of maintaining the bcfg2 server's There are two main advantages: -#. Password storage is centralized in the ``etc/properties.xml`` file - this helps maintain consistency, makes changing passwords easier, - and also makes it easier to share your configurations with other - sites/people. +#. Password storage is centralized in the ``Properties/passwords.xml`` + file this helps maintain consistency, makes changing passwords + easier, and also makes it easier to share your configurations with + other sites/people. #. You can template the file using Genshi's `{% def %}` syntax, which makes `clients.xml` much more readable. An important thing to note is how the `name` variable is handled - when just referring to it the standard `${name}` syntax is used, but when it is used as a variable in the expression to get the password, - `password="${properties.properties.find('password').find('bcfg2-client').find(name).text}"`, + `password="${metadata.Properties['passwords.xml'].find('password').find('bcfg2-client').find(name).text}"`, it is just referred to as `name`. There is the disadvantage that sometimes 2 passes will be needed to get @@ -38,7 +38,7 @@ Possible improvements: #. We really don't care what the client passwords are, just that they exist, so instead of listing them a master password combined with some kind of one-way hash based on the `name` might make more sense, - and make `properties.xml` easier to maintain. + and make ``Properties/passwords.xml`` easier to maintain. * TGenshi/var/lib/bcfg2/Metadata/clients.xml/template.newtxt: @@ -53,7 +53,7 @@ Possible improvements: profile="${profile}" name="${name}" uuid="${name}" - password="${properties.properties.find('password').find('bcfg2-client').find(name).text}" + password="${metadata.Properties['passwords.xml'].find('password').find('bcfg2-client').find(name).text}" address="${address}" location="fixed" secure="true" @@ -64,7 +64,7 @@ Possible improvements: profile="${profile}" name="${name}" uuid="${name}" - password="${properties.properties.find('password').find('bcfg2-client').find(name).text}" + password="${metadata.Properties['passwords.xml'].find('password').find('bcfg2-client').find(name).text}" location="floating" secure="true" />\ @@ -77,7 +77,7 @@ Possible improvements: ${dynamic('group-person-somename','somename.office.example.com')} - * etc/properties.xml snippit: + * Properties/passwords.xml snippit: .. code-block:: xml diff --git a/doc/server/plugins/generators/tgenshi/test.txt b/doc/server/plugins/generators/tgenshi/test.txt index 5dd5efae8..a4f33bb14 100644 --- a/doc/server/plugins/generators/tgenshi/test.txt +++ b/doc/server/plugins/generators/tgenshi/test.txt @@ -5,10 +5,12 @@ test ==== +FIXME: This example needs to be retested with new Properties plugin. + As submitted by dclark This file just shows you what's available. It assumes a -``/var/lib/bcfg2/etc/properties.xml`` file with an entry like this: +``/var/lib/bcfg2/Properties/test.xml`` file with an entry like this: .. code-block:: xml @@ -35,16 +37,16 @@ This file just shows you what's available. It assumes a {% end %}\ {% end %}\ - {% if metadata.probes %}\ + {% if metadata.Probes %}\ Probes: - {% for probe, value in metadata.probes.iteritems() %}\ + {% for probe, value in metadata.Probes.iteritems() %}\ $probe $value {% end %}\ {% end %}\ Two main ways to get the same property value: - ${properties.properties.find('password').find('bcfg2').text} - ${properties.properties.xpath('password/bcfg2')[0].text} + ${metadata.Properties['test.xml'].find('password').find('bcfg2').text} + ${metadata.Properties['test.xml'].xpath('password/bcfg2')[0].text} One way to get information about metadata and properties: -- cgit v1.2.3-1-g7c22