Search code examples
capistranorolescapistrano3

How to set multiple users for 1 server in Capistrano to run tasks being logged in with different accounts?


I try to run some tasks with different users on 1 server. The possible solution was to create additional roles like

role :root, %w{root@ip}

It works but if I run

cap stage deploy

it fails, as some default tasks are run on root role too , though I need this role for my tasks only.

It there a way to define a role so that default deploy task won't run on this role?


Solution

  • I know this question is old but I found it while Googling the problem so I'll answer for anyone else who finds this question.

    To keep something out of release add no_release: true as an option. So in your example define the root role like this:

    role :root, %w{root@ip}, no_release: true