You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<code>-H</code> or <code>-G</code> options, or with the <code>on</code> option of
143
147
<ahref="https://metacpan.org/pod/Rex::Commands#run_task"><code>run_task</code></a> from code.</p>
144
148
145
-
<h2id="override-the-tasks-target-to-local"><ahref="#override-the-tasks-target-to-local">Override the task’s target to <code><local></code></a></h2>
149
+
</section>
150
+
<sectionid="section-5">
151
+
<h2id="override-the-tasks-target-to-local"><ahref="#override-the-tasks-target-to-local">Override the task’s target to <code><local></code></a></h2>
146
152
147
153
<p>The <code>-H</code> command line option supports the same special <code><local></code> hostname:</p>
<p>This approach allows users to intentionally choose local execution, regardless
167
173
of a task having an explicit target or not.</p>
168
174
169
-
<h2id="disable-ssh-per-task-with-no_ssh-task"><ahref="#disable-ssh-per-task-with-no_ssh-task">Disable SSH per task with <code>no_ssh task</code></a></h2>
175
+
</section>
176
+
<sectionid="section-6">
177
+
<h2id="disable-ssh-per-task-with-no_ssh-task"><ahref="#disable-ssh-per-task-with-no_ssh-task">Disable SSH per task with <code>no_ssh task</code></a></h2>
170
178
171
179
<p>The <code>no_ssh</code> command hints individual tasks to not use SSH:</p>
<p>See also the <ahref="https://metacpan.org/pod/Rex::Commands#no_ssh">no_ssh</a>
213
223
documentation.</p>
214
224
215
-
<h2id="running-parts-of-a-task-within-local-blocks"><ahref="#running-parts-of-a-task-within-local-blocks">Running parts of a task within <code>LOCAL{}</code> blocks</a></h2>
225
+
</section>
226
+
<sectionid="section-8">
227
+
<h2id="running-parts-of-a-task-within-local-blocks"><ahref="#running-parts-of-a-task-within-local-blocks">Running parts of a task within <code>LOCAL{}</code> blocks</a></h2>
216
228
217
229
<p>Wrapping parts of the task steps in a <code>LOCAL{}</code> block forces these to run on
218
230
the local machine instead of on the target in effect otherwise:</p>
<pre><codeclass="highlight">$ rex <spanclass="synSpecial">-e</span><spanclass="synOperator">'</span><spanclass="synString">say run q(hostname)</span><spanclass="synOperator">'</span>
0 commit comments