ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <>
Subject RE: Infrastructure Configuration Management
Date Wed, 03 Nov 2004 17:33:53 GMT
See my comments below...

-Rob A

> -----Original Message-----
> From: Bhadra, Jatin []
> Sent: Wednesday, November 03, 2004 5:21 AM
> To: ''
> Subject: Infrastructure Configuration Management
> All,
> 	This email might be off topic as it is not specific to ANT so
> apologies for that and also for length of the email.
> 	I have been assigned a task to propose tools, solutions and
> processes for Infrastructure Configuration Management. 
> 	We have got a decent Software Configuration Management system in
> place that uses PVCS for Version Control System, ANT to build J2EE
> application and wscp Scripts to deploy on WebSphere and simple bespoke
> Release Management System. This has been working for couple 
> of years and we
> always have knowledge of what version of application is 
> running in Dev,
> Test, Pre-Prod or Prod environment.
> 	This is what we want. Following are the main areas that 
> I am looking
> at
> 1: Managing Configuration changes of WebSphere, IBM Http 
> Server, DB2, MQ
> Server across environments: We have got the templates for 
> creating base
> configuration of each of the above. If any configuration changes are
> required with new application release then these changes are 
> implemented in
> test environment and tested. If all it well these changes are 
> documented and
> the deployer has to read through this document to implement 
> these changes in
> Pre-Production and Production which is time consuming and 
> error prone. I
> want to get away from documents and ideally have some tool 
> that will promote
> the configuration changes to next. Has anybody got any ideas 
> or tools that
> they know or have used that will read the config and promote 
> these to the
> next environment?

What I have done to address this need is to version the config files for things like WebSphere,
HTTPD, etc. With WebSphere 3.x and 4.x, you can export an XML file of the whole configuration.
Check this file into version control. When you need to migrate changes, do a find and replace
on the necessary differences between environments and import the XML config to the next environment.
With some configs, like the HTTPD config, you could version a template config file and use
Ant, with the <replace> task, generate a config for a specific environment. For example;
let's say I have environments dev, test, prod. Here is what I version....


The might contain:


The might contain:


Then in the httpd.conf.template file:
Port _VAR_listenport_
ServerName _VAR_servername_

The build.xml would have a target that generates the config for the environment:
	<property name="conf.file" value="httpd.conf"/>
	<property name="conf.file.template" value="httpd.conf.template"/>

	<target name="replace" depends="init,check-env-props" description="replace the tokens
in the config files with actual environment specific values">
		<!-- first get a fresh copy of the template -->
            <delete file="${conf.file}" failonerror="false"/>
		<copy file="${conf.file.template}" tofile="${conf.file}"/>

		<replace file="${conf.file}"

	<!-- Error checking targets -->

	<target name="check-env-props">
		<available property="env-props-exist" file="${env}.properties"/>
		<fail unless="env-props-exist" message="Cannot find ${env}.properties"/>

With all this in place, you would run Ant with the following command, to generate a config
for dev:

ant -Denv=dev replace

This has worked well for me. It would be a challenge to make this work with the WebSphere
XML configs, but it might be worth it. With WebSphere configs, I just version one copy of
the XML config for each environment and then used a diff tool to merge changes from one to
the next. Then import the updated XML config into the environment.

> 2: Compare 2 environment: When application does not work in 
> test or pre prod
> environment developers always have this one thing to say "It 
> works in my
> environment, Can you tell me difference between these 2 
> environment?". So my
> questions is, Are there any tools in market that can compare 
> 2 environment (
> may be specific to WebSphere, DB2, IBM MQ Series Server, 
> Apache Server)? 

I use a tool called BeyondCompare for diffing. You can diff
entire directories recursively, including FTP directories. Very handy tool.

> 3: Configuration of whole Infrastructure (Not must, but good to have):
> Taking it one more step ahead we would like to have complete 
> knowledge of
> Network infrastructure that was being use and configuration 
> on all these
> boxes to be captured. This includes firewalls, operating 
> system, ports,
> Routers etc. Any tools or ideas on this?

Check it all in to version control. Well not everything, but just enough so that you can recreate
your environment. Like for the OS, say you use RedHat Enterprise 3. Produce a list of all
the packages installed by running 'rpm -qa > packagelist.txt' and check in the packagelist.txt.
This may be overkill, but there is some value in it. It may be a pain to keep up to date unless
you have a strict change management process that details the steps to updating anything and

-Rob Anderson

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message