Changeset [d103dda7ee3f7696007d230c76c7739dd57115ec] by Mike Bailey
September 4th, 2008 @ 05:09 PM
Restricted tasks to roles.
I like restricting tasks to roles, partly out of laziness. I don't need to specify HOSTS or ROLES on the command line as long as I've defined the relevant roles somewhere. It also provides a safety net. Without specifying HOSTS or ROLES on the command line, a task will get run on all defined hosts. This can be avoided by restricting the tasks themselves in deprec.
A problem with restricting tasks to roles in deprec was that Capistrano complained when I ran a task in an ad-hoc manner without any hosts being defined for the roles it was restricted to.
Sometimes I want to run a task on hosts but don't want to add them to a deploy.rb. Editing a file just to use a command line is extra work!
e.g. cap deprec:mysql:install HOSTS=foo,bar
This problem caused me to remove a lot of role restrictions from deprec over the last year or so.
My Capistrano patch (included in capistrano-2.5.0) causes Capistrano to not complain about an undefined role if HOSTS or ROLES are specified on the command line.
http://github.com/jamis/capistra...
So, I'm putting the roles back in.
Committed by Mike Bailey
- M lib/deprec/recipes/mongrel.rb
- M lib/deprec/recipes/mysql.rb
- M lib/deprec/recipes/nginx.rb
- M lib/deprec/recipes/rails.rb
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
<h1>Source available from github</h1>
The Git repository resides at <a href="http://github.com/mbailey">http://github.com/mbailey</a><br/><br/>
Check out the current development trunk with:<br/>
git clone git://github.com/mbailey/deprec.git
<br/>
<h1>Creating a bug report</h1>
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.<br/><br/>
Security vulnerabilities should be reported via an email to mike@bailey.net.au, do not use lighthouse for reporting security vulnerabilities. All content in lighthouse is publicly available as soon as it is posted.<br/><br/>
Then don't get your hopes up. Unless you have a "Code Red, Mission Critical, The World is Coming to an End" kinda bug, you're creating this ticket in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the ticket automatically will see any activity or that others will jump to fix it. Creating a ticket like this is mostly to help yourself start on the path of fixing the problem and for others to sign on to with a "I'm having this problem too".<br/><br/>
(Wording copied from <a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails">Rails lighthouse page</a>)