--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Execute the given command on all servers that are the target of the current task. If a block is given, it is invoked for all output generated by the command, and should accept three parameters: the SSH channel (which may be used to send data back to the remote process), the stream identifier (<tt>:err</tt> for stderr, and <tt>:out</tt> for stdout), and the data that was received."
- !ruby/struct:SM::Flow::P 
  body: "The <tt>options</tt> hash may include any of the following keys:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":hosts - this is either a string (for a single target host) or an array of strings, indicating which hosts the command should run on. By default, the hosts are determined from the task definition."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":roles - this is either a string or symbol (for a single target role) or an array of strings or symbols, indicating which roles the command should run on. If :hosts is specified, :roles will be ignored."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":only - specifies a condition limiting which hosts will be selected to run the command. This should refer to values set in the role definition. For example, if a role is defined with :primary =&gt; true, then you could select only hosts with :primary true by setting :only =&gt; { :primary =&gt; true }."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":except - specifies a condition limiting which hosts will be selected to run the command. This is the inverse of :only (hosts that do <em>not</em> match the condition will be selected)."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":once - if true, only the first matching server will be selected. The default is false (all matching servers will be selected)."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":max_hosts - specifies the maximum number of hosts that should be selected at a time. If this value is less than the number of hosts that are selected to run, then the hosts will be run in groups of max_hosts. The default is nil, which indicates that there is no maximum host limit. Please note this does not limit the number of SSH channels that can be open, only the number of hosts upon which this will be called."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":shell - says which shell should be used to invoke commands. This defaults to &quot;sh&quot;. Setting this to false causes Capistrano to invoke the commands directly, without wrapping them in a shell invocation."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":data - if not nil (the default), this should be a string that will be passed to the command's stdin stream."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":pty - if true, a pseudo-tty will be allocated for each command. The default is false. Note that there are benefits and drawbacks both ways. Empirically, it appears that if a pty is allocated, the SSH server daemon will <em>not</em> read user shell start-up scripts (e.g. bashrc, etc.). However, if a pty is <em>not</em> allocated, some commands will refuse to run in interactive mode and will not prompt for (e.g.) passwords."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: ":env - a hash of environment variable mappings that should be made available to the command. The keys should be environment variable names, and the values should be their corresponding values. The default is empty, but may be modified by changing the <tt>default_environment</tt> Capistrano variable."
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: "Note that if you set these keys in the <tt>default_run_options</tt> Capistrano variable, they will apply for all invocations of #run, #invoke_command, and #parallel."
full_name: Capistrano::Configuration::Actions::Invocation#run
is_singleton: false
name: run
params: (cmd, options={}, &block)
visibility: public
