Package: bacula_configuration
Bacula Configuration====================Scripts for Bacula configuration managementMOTIVATION----------Bacula's worst weakness is configuration.  Adding one more host to yourcurrent setup involves the following steps:1. Install the client software2. Create a bacula-fd.conf.  It needs:- Director stanza, with new passwords, for each director- Messages stanza- FileDaemon/Client stanza3. Update your director(s) configuration:- Client entry (with the name and password from bacula-fd.conf)- One or more Job entries- (Optional) Storage/Pool entries.- (Optional) Create new Fileset/Schedule entries4. (Optional) Update your storage(s) configuration:- Pool- Storage- DeviceAll that data has to mesh together perfectly, or Bacula won't work.Admittedly, you can short-circuit some of this by using the same passwordseverywhere and a standard set of directors and only one Messageconfiguration, and all hosts share the same storage pool and devices.Then there's auditing.  *You* know perfectly well what hosts are backed upwith which scheuldes, and the filesets involved.  But do your coworkers?What about your boss?  Do you answer all the questions about which hostsare backed up, and how, or do you want to delegate all of that to yourfront-line support?  How about the possibility of giving your install teaman easy tool for setting up new backups?Finally, there's maintenance.  Storage servers are taken (temporarily)offline.  Clients are decommissioned (which means all the jobs left in thecatalog at that point will never be pruned) or change roles.  Directors arereplaced.  New Filesets (and associated Jobs) need to be added to groups ofClients.  All of these events require tedious, error prone, manual updates.WHAT IT DOES------------CLI tool to import an existing configurationCLI tools to create/delete/edit all of the resources used by BaculaCLI tools designed to drop into cron that will keep the director(s) andstorage daemon(s) configuration up-to-date, with appropriate activitychecks around restarts.Web interface that yields an appropriate bacula-fd.conf like this:`wget -O /etc/bacula/bacula-fd.conf http://director.example.com/cgi-bin/fd`CLI tool for updating Confluence with live documentation.  This willinclude service and host notes, as well as schedules and filesets (wherepossible: filesets that use < syntax will be incomplete).CURRENT STATUS--------------Modulo any bugs, this seems to be complete as a framework.  Tests areincomplete, though, and I think it could use a little more polishdocumentation-wise.DEPENDENCIES-------------If you do not have mysql-python installed, setuptools will install it as adependency.  If you would rather have it installed from an OS package, youshould do that first.pyparsing is required if and only if you want to import an existingconfiguration.  I should note that this is making DRY code difficult, asadding the parsing bits to the base class would make pyparsing requiredeverywhere, which is really not desirable.DATABASE---------You'll need to create the database schema usingbacula_tools/data/bacula_configuration.schemaToday, we are MySQL-only.  Adding support for PostgreSQL shouldn't bedifficult, but I'd have to see a desire for that before doing the work.OS SETUP---------You will need to customize several values, whose defaults are inbacula_tools/\_\_init\_\_.py.  The easiest way to do so is to drop valueassignments into any/all of the configuration files:/etc/bacula/bacula.conf/usr/local/etc/bacula/bacula.conf/usr/local/etc/bacula.conf~/.bacula.confThe files are read in that order, and all updates applied in that order.In particular, you will want to set values for:MYSQL_DBMYSQL_HOSTMYSQL_USERMYSQL_PASSHere is an example script that will set it all up for you:#! /bin/shpython setup.py installmysql -u root -p <<EOFcreate schema baculacfg;grant all on baculacfg.* to baculacfg identified by 'baculacfg';use baculacfg\. bacula_tools/data/bacula_configuration.schemaEOFcat > /usr/local/etc/bacula.conf <<EOFMYSQL_DB='baculacfg'MYSQL_HOST='localhost'MYSQL_USER='baculacfg'MYSQL_PASS='baculacfg'EOF# import the current configuration./bin/import_configuration /etc/bacula/*.confexit