I would write a recipe to manage the Passenger config file. The basic pattern is as follows:
- Create an erb version of your config file, replacing dynamic variables with erb script tags to be replaced at the time the recipe is run
- Write a recipe that uses the erb template and uploads the resulting file to your server
- Call this recipe after your ruby upgrade task
rvm:whatever_task_you_use_to_install_upgrade
This pattern is illustrated really nicely in this RailsCast: http://railscasts.com/episodes/337-capistrano-recipes?view=asciicast
Or, there are quite a few exmaples out there of cap recipes for installing and managing Passenger. Here's one that does not use erb, but rather inline text that gets written out to the Passenger config (see line 39): https://github.com/nesquena/cap-recipes/blob/master/lib/cap_recipes/tasks/passenger/install.rb