Hi Gerhardus,

I manage lots of servers (>50) and keep all the config files under
version control. That way deploying is a snap. I don't know if this is
of interest to you but here's how I do it with deprec.

I generate config files for services using templates in deprec[1].
These ERB templates use allow me to put values in
deploy.rb or in a higher level shared capistrano config file.

I don't generate files and send them straight to the server though as
there are often odd cases that require config
tweaks but don't warrant changing the template. Instead, the
'config_gen' task generates them locally. If they would
overwrite the existing files I get a warning and choices to view a
diff, accept or cancel.

I see config files as sitting in two camps, System (e.g. apache2.conf)
and Project (e.g. some_virtual_host.conf)

System level files should be identical on all systems (if practical!).
It's the project files that differ for each project deployed to a
system. I keep these in a project level of my file hierarchy, and I
keep one copy of the system level files.

If you want to play with it, run the following:

# Prepare a sandbox dir
sudo gem install deprec
mkdir -p deprec_sandbox/config
cd deprec_sandbox
depify .

# Generate configs
cap deprec:passenger:config_gen_project
.
|-- Capfile
`-- config
    |-- deploy.rb
    `-- passenger
        `-- apache_vhost

cap deprec:passenger:config_gen_system
.
|-- Capfile
`-- config
    |-- deploy.rb
    `-- passenger
        |-- apache_vhost
        `-- etc
            `-- apache2
                `-- mods-available
                    |-- passenger.conf
                    `-- passenger.load

cap deprec:passenger:config # => would push configs if deploy.rb had
been configured

The code to achieve this is pretty simple and it's trivial to create
your own recipes based on the recipes in deprec.

Hope this is useful,

Mike


[1] 
http://github.com/mbailey/deprec/tree/a17be8421c24214feb31164b0a9a5bd331740c52/lib/deprec/templates

On Tue, Mar 3, 2009 at 1:50 AM, Gerhardus Geldenhuis
<[email protected]> wrote:
>
> Hi
> I want to create custom config files and would appreciate any tips if
> anyone has attempted the same thing.
>
> I am planning to do it in the following way:
> Download the config files using run command with svn
> insert and append the config files using the run command with sed and
> awk based on the servers in my roles.
>
> Typically what I am going to do is setup our modjk loadbalancer
> according the the list of tomcat application servers.
>
> We also loadbalance accross our apaches that run modjk and I intend
> using capistrano to build/customize there config files too.
>
> What I am trying to achieve is that after having build the servers the
> only other step I need to do is write a capistrano config and then run
> 1 or 2 cap commands to deploy new configs and applications to my
> environment.
>
> Eventually I can reverse the steps; write the config file first which
> then takes care of building the virtual servers and configuring them.
>
> Regards
> >
>

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to