Hi,

Thank you for your replies. I found problem and also solution.

Inside clear_cache I was calling another cap task which didn't have roles
parameter so was running on all servers.

Just to explain more:

1) I have file called cache.rb:
namespace :cache do

  namespace :memcache do

    desc "Restart memcache to clear cache."
    task :restart, :roles => :cache_servers do
      run "sudo /etc/init.d/memcached restart"
    end

  end

end # cache namespace

And this file is included in Capify (probably should be called receipe) and
this file didn't have roles param.

Now everything works fine.

Thank you and have a nice day.

Ladislav

On Thu, Oct 30, 2008 at 2:13 PM, Jamis Buck <[EMAIL PROTECTED]> wrote:

> Can you paste the (entire) output from "cap clear_cache"?
>
> - Jamis
>
>
> On Oct 30, 2008, at 4:44 AM, Ladislav Martincik wrote:
>
>  Hi,
>>
>> I'm having problems with specifying role and than running it on particular
>> task.
>> I have specified roles like this:
>>
>> role :app, [aeryn.example.com, chiana.example.com]
>> role :db, aeryn.example.com
>> role :memcached_servers, keiko.example.com
>>
>> Here's task I'm using to run for memcached_servers:
>>
>> task :clear_cache, :roles => :memcached_servers do
>>  run "#{shared_path}/scripts/clear_cache.sh"
>> end
>> after "deploy:update_code", :clear_cache
>>
>> The problem I have is that when I run:
>>
>> cap clear_cache
>>
>> ... the task is running on [aeryn, keiko] and should be running only on
>> [keiko]?
>> I don't know why but aeryn is always included.
>>
>> My setup is:
>> GEMs:
>> capistrano 2.5.0
>> capistrano-ext 1.2.1
>>
>> Servers:
>> Ubuntu 7.10
>>
>> My personal computer:
>> Mac Intel, OS X
>>
>> Thank you for help.
>>
>> Ladislav
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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