mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-06-21 17:39:04 +02:00
391 lines
30 KiB
HTML
391 lines
30 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html class="writer-html5" lang="en" >
|
|||
|
<head>
|
|||
|
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
|||
|
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|||
|
<title>community.routeros.command module – Run commands on remote devices running MikroTik RouterOS — Ansible collections documentation</title>
|
|||
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|||
|
<link rel="stylesheet" href="_static/css/ansible.css" type="text/css" />
|
|||
|
<link rel="stylesheet" href="_static/antsibull-minimal.css" type="text/css" />
|
|||
|
<link rel="stylesheet" href="_static/css/rtd-ethical-ads.css" type="text/css" />
|
|||
|
<link rel="shortcut icon" href="_static/images/Ansible-Mark-RGB_Black.png"/>
|
|||
|
<!--[if lt IE 9]>
|
|||
|
<script src="_static/js/html5shiv.min.js"></script>
|
|||
|
<![endif]-->
|
|||
|
|
|||
|
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
|||
|
<script src="_static/jquery.js"></script>
|
|||
|
<script src="_static/underscore.js"></script>
|
|||
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
|||
|
<script src="_static/doctools.js"></script>
|
|||
|
<script src="_static/sphinx_highlight.js"></script>
|
|||
|
<script src="_static/js/theme.js"></script>
|
|||
|
<link rel="search" title="Search" href="search.html" />
|
|||
|
<link rel="next" title="community.routeros.facts module – Collect facts from remote devices running MikroTik RouterOS" href="facts_module.html" />
|
|||
|
<link rel="prev" title="community.routeros.api_modify module – Modify data at paths with API" href="api_modify_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
|
|||
|
<body class="wy-body-for-nav"><!-- extra body elements for Ansible beyond RTD Sphinx Theme -->
|
|||
|
|
|||
|
<div class="DocSite-globalNav ansibleNav">
|
|||
|
<ul>
|
|||
|
<li><a href="https://www.ansible.com/ansiblefest" target="_blank">AnsibleFest</a></li>
|
|||
|
<li><a href="https://www.ansible.com/tower" target="_blank">Products</a></li>
|
|||
|
<li><a href="https://www.ansible.com/community" target="_blank">Community</a></li>
|
|||
|
<li><a href="https://www.ansible.com/webinars-training" target="_blank">Webinars & Training</a></li>
|
|||
|
<li><a href="https://www.ansible.com/blog" target="_blank">Blog</a></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
|
|||
|
<a class="DocSite-nav" href="/" style="padding-bottom: 30px;">
|
|||
|
|
|||
|
<img class="DocSiteNav-logo"
|
|||
|
src="_static/images/Ansible-Mark-RGB_White.png"
|
|||
|
alt="Ansible Logo">
|
|||
|
<div class="DocSiteNav-title">Ansible Collections Documentation</div>
|
|||
|
</a>
|
|||
|
<div class="wy-grid-for-nav">
|
|||
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|||
|
<div class="wy-side-scroll">
|
|||
|
<div class="wy-side-nav-search" >
|
|||
|
<a href="index.html" class="icon icon-home"> Ansible collections
|
|||
|
</a><!--- Based on https://github.com/rtfd/sphinx_rtd_theme/pull/438/files -->
|
|||
|
|
|||
|
<div class="version">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
<div role="search">
|
|||
|
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
|||
|
<label class="sr-only" for="q">Search docs:</label>
|
|||
|
<input type="text" class="st-default-search-input" id="q" name="q" placeholder="Search docs" />
|
|||
|
<input type="hidden" name="check_keywords" value="yes" />
|
|||
|
<input type="hidden" name="area" value="default" />
|
|||
|
</form>
|
|||
|
</div>
|
|||
|
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|||
|
|
|||
|
<ul>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="docsite/api-guide.html">How to connect to RouterOS devices with the RouterOS API</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="docsite/ssh-guide.html">How to connect to RouterOS devices with SSH</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="docsite/quoting.html">How to quote and unquote commands and arguments</a></li>
|
|||
|
</ul>
|
|||
|
<ul class="current">
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="routeros_cliconf.html">community.routeros.routeros cliconf – Use routeros cliconf to run command on MikroTik RouterOS platform</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="join_filter.html">community.routeros.join filter – Join a list of arguments to a command</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="list_to_dict_filter.html">community.routeros.list_to_dict filter – Convert a list of arguments to a dictionary</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="quote_argument_filter.html">community.routeros.quote_argument filter – Quote an argument</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="quote_argument_value_filter.html">community.routeros.quote_argument_value filter – Quote an argument value</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="split_filter.html">community.routeros.split filter – Split a command into arguments</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="api_module.html">community.routeros.api module – Ansible module for RouterOS API</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="api_facts_module.html">community.routeros.api_facts module – Collect facts from remote devices running MikroTik RouterOS using the API</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="api_find_and_modify_module.html">community.routeros.api_find_and_modify module – Find and modify information using the API</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="api_info_module.html">community.routeros.api_info module – Retrieve information from API</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="api_modify_module.html">community.routeros.api_modify module – Modify data at paths with API</a></li>
|
|||
|
<li class="toctree-l1 current"><a class="current reference internal" href="#">community.routeros.command module – Run commands on remote devices running MikroTik RouterOS</a><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="#synopsis">Synopsis</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="#parameters">Parameters</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="#attributes">Attributes</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="#notes">Notes</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="#see-also">See Also</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="#return-values">Return Values</a><ul>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="#authors">Authors</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="#collection-links">Collection links</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="facts_module.html">community.routeros.facts module – Collect facts from remote devices running MikroTik RouterOS</a></li>
|
|||
|
</ul>
|
|||
|
<!-- extra nav elements for Ansible beyond RTD Sphinx Theme -->
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</nav>
|
|||
|
|
|||
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|||
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|||
|
<a href="index.html">Ansible collections</a>
|
|||
|
</nav>
|
|||
|
|
|||
|
<div class="wy-nav-content">
|
|||
|
<div class="rst-content">
|
|||
|
<div role="navigation" aria-label="Page navigation">
|
|||
|
<ul class="wy-breadcrumbs">
|
|||
|
<li><a href="index.html" class="icon icon-home"></a></li>
|
|||
|
<li class="breadcrumb-item active">community.routeros.command module – Run commands on remote devices running MikroTik RouterOS</li>
|
|||
|
<li class="wy-breadcrumbs-aside">
|
|||
|
<!-- User defined GitHub URL -->
|
|||
|
<a href="https://github.com/ansible-collections/community.routeros/edit/main/plugins/modules/command.py?description=%23%23%23%23%23%20SUMMARY%0A%3C!—%20Your%20description%20here%20–%3E%0A%0A%0A%23%23%23%23%23%20ISSUE%20TYPE%0A-%20Docs%20Pull%20Request%0A%0A%2Blabel:%20docsite_pr" class="fa fa-github"> Edit on GitHub</a>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<hr/>
|
|||
|
</div>
|
|||
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|||
|
|
|||
|
|
|||
|
<div itemprop="articleBody">
|
|||
|
|
|||
|
<span class="target" id="ansible-collections-community-routeros-command-module"></span><section id="community-routeros-command-module-run-commands-on-remote-devices-running-mikrotik-routeros">
|
|||
|
<h1>community.routeros.command module – Run commands on remote devices running MikroTik RouterOS<a class="headerlink" href="#community-routeros-command-module-run-commands-on-remote-devices-running-mikrotik-routeros" title="Permalink to this heading"></a></h1>
|
|||
|
<div class="admonition note">
|
|||
|
<p class="admonition-title">Note</p>
|
|||
|
<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/community/routeros">community.routeros collection</a> (version 2.4.0).</p>
|
|||
|
<p>To install it, use: <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">install</span> <span class="pre">community.routeros</span></code>.</p>
|
|||
|
<p>To use it in a playbook, specify: <code class="code docutils literal notranslate"><span class="pre">community.routeros.command</span></code>.</p>
|
|||
|
</div>
|
|||
|
<div class="contents local topic" id="contents">
|
|||
|
<ul class="simple">
|
|||
|
<li><p><a class="reference internal" href="#synopsis" id="id1">Synopsis</a></p></li>
|
|||
|
<li><p><a class="reference internal" href="#parameters" id="id2">Parameters</a></p></li>
|
|||
|
<li><p><a class="reference internal" href="#attributes" id="id3">Attributes</a></p></li>
|
|||
|
<li><p><a class="reference internal" href="#notes" id="id4">Notes</a></p></li>
|
|||
|
<li><p><a class="reference internal" href="#see-also" id="id5">See Also</a></p></li>
|
|||
|
<li><p><a class="reference internal" href="#examples" id="id6">Examples</a></p></li>
|
|||
|
<li><p><a class="reference internal" href="#return-values" id="id7">Return Values</a></p></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<section id="synopsis">
|
|||
|
<h2><a class="toc-backref" href="#id1">Synopsis</a><a class="headerlink" href="#synopsis" title="Permalink to this heading"></a></h2>
|
|||
|
<ul class="simple">
|
|||
|
<li><p>Sends arbitrary commands to an RouterOS node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.</p></li>
|
|||
|
<li><p>The module always indicates a (changed) status. You can use <a class="reference external" href="https://docs.ansible.com/ansible/devel/playbook_guide/playbooks_error_handling.html#override-the-changed-result" title="(in Ansible vdevel)"><span class="xref std std-ref">the changed_when task property</span></a> to determine whether a command task actually resulted in a change or not.</p></li>
|
|||
|
</ul>
|
|||
|
</section>
|
|||
|
<section id="parameters">
|
|||
|
<h2><a class="toc-backref" href="#id2">Parameters</a><a class="headerlink" href="#parameters" title="Permalink to this heading"></a></h2>
|
|||
|
<table class="colwidths-auto ansible-option-table docutils align-default" style="width: 100%">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p>Parameter</p></th>
|
|||
|
<th class="head"><p>Comments</p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="parameter-commands"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-parameter-commands"><strong>commands</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#parameter-commands" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span> / <span class="ansible-option-required">required</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>List of commands to send to the remote RouterOS device over the configured provider. The resulting output from the command is returned. If the <em>wait_for</em> argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired.</p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="parameter-interval"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-parameter-interval"><strong>interval</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#parameter-interval" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again.</p>
|
|||
|
<p class="ansible-option-line"><span class="ansible-option-default-bold">Default:</span> <code class="ansible-option-default docutils literal notranslate"><span class="pre">1</span></code></p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="parameter-match"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-parameter-match"><strong>match</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#parameter-match" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>The <em>match</em> argument is used in conjunction with the <em>wait_for</em> argument to specify the match policy. Valid values are <code class="docutils literal notranslate"><span class="pre">all</span></code> or <code class="docutils literal notranslate"><span class="pre">any</span></code>. If the value is set to <code class="docutils literal notranslate"><span class="pre">all</span></code> then all conditionals in the wait_for must be satisfied. If the value is set to <code class="docutils literal notranslate"><span class="pre">any</span></code> then only one of the values must be satisfied.</p>
|
|||
|
<p class="ansible-option-line"><span class="ansible-option-choices">Choices:</span></p>
|
|||
|
<ul class="simple">
|
|||
|
<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">"any"</span></code></p></li>
|
|||
|
<li><p><code class="ansible-option-default-bold docutils literal notranslate"><span class="pre">"all"</span></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
|
|||
|
</ul>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="parameter-retries"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-parameter-retries"><strong>retries</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#parameter-retries" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the <em>wait_for</em> conditions.</p>
|
|||
|
<p class="ansible-option-line"><span class="ansible-option-default-bold">Default:</span> <code class="ansible-option-default docutils literal notranslate"><span class="pre">10</span></code></p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="parameter-wait_for"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-parameter-wait-for"><strong>wait_for</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#parameter-wait_for" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples.</p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</section>
|
|||
|
<section id="attributes">
|
|||
|
<h2><a class="toc-backref" href="#id3">Attributes</a><a class="headerlink" href="#attributes" title="Permalink to this heading"></a></h2>
|
|||
|
<table class="colwidths-auto ansible-option-table docutils align-default" style="width: 100%">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p>Attribute</p></th>
|
|||
|
<th class="head"><p>Support</p></th>
|
|||
|
<th class="head"><p>Description</p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="attribute-check_mode"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-attribute-check-mode"><strong>check_mode</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#attribute-check_mode" title="Permalink to this attribute"></a></div></td>
|
|||
|
<td><div class="ansible-option-cell"><p><span class="ansible-attribute-support-label">Support: </span><span class="ansible-attribute-support-partial">partial</span></p>
|
|||
|
<p>The module claims to support check mode, but it simply always executes the command.</p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>Can run in <code class="docutils literal notranslate"><span class="pre">check_mode</span></code> and return changed status prediction without modifying target.</p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="attribute-diff_mode"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-attribute-diff-mode"><strong>diff_mode</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#attribute-diff_mode" title="Permalink to this attribute"></a></div></td>
|
|||
|
<td><div class="ansible-option-cell"><p><span class="ansible-attribute-support-label">Support: </span><span class="ansible-attribute-support-none">none</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>Will return details on what has changed (or possibly needs changing in <code class="docutils literal notranslate"><span class="pre">check_mode</span></code>), when in diff mode.</p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="attribute-platform"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-attribute-platform"><strong>platform</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#attribute-platform" title="Permalink to this attribute"></a></div></td>
|
|||
|
<td><div class="ansible-option-cell"><p><span class="ansible-attribute-support-property">Platform:</span> <span class="ansible-attribute-support-full">RouterOS</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>Target OS/families that can be operated against.</p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</section>
|
|||
|
<section id="notes">
|
|||
|
<h2><a class="toc-backref" href="#id4">Notes</a><a class="headerlink" href="#notes" title="Permalink to this heading"></a></h2>
|
|||
|
<div class="admonition note">
|
|||
|
<p class="admonition-title">Note</p>
|
|||
|
<ul class="simple">
|
|||
|
<li><p>The module declares that it <strong>supports check mode</strong>. This is a bug and will be changed in community.routeros 3.0.0.</p></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
<section id="see-also">
|
|||
|
<h2><a class="toc-backref" href="#id5">See Also</a><a class="headerlink" href="#see-also" title="Permalink to this heading"></a></h2>
|
|||
|
<div class="admonition seealso">
|
|||
|
<p class="admonition-title">See also</p>
|
|||
|
<dl class="simple">
|
|||
|
<dt><a class="reference internal" href="docsite/ssh-guide.html#ansible-collections-community-routeros-docsite-ssh-guide"><span class="std std-ref">How to connect to RouterOS devices with SSH</span></a></dt><dd><p>How to connect to RouterOS devices with SSH</p>
|
|||
|
</dd>
|
|||
|
<dt><a class="reference internal" href="docsite/quoting.html#ansible-collections-community-routeros-docsite-quoting"><span class="std std-ref">How to quote and unquote commands and arguments</span></a></dt><dd><p>How to quote and unquote commands and arguments</p>
|
|||
|
</dd>
|
|||
|
</dl>
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
<section id="examples">
|
|||
|
<h2><a class="toc-backref" href="#id6">Examples</a><a class="headerlink" href="#examples" title="Permalink to this heading"></a></h2>
|
|||
|
<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run command on remote devices</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">community.routeros.command</span><span class="p">:</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">commands</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/system routerboard print</span><span class="w"></span>
|
|||
|
|
|||
|
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run command and check to see if output contains routeros</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">community.routeros.command</span><span class="p">:</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">commands</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/system resource print</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">wait_for</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">result[0] contains MikroTik</span><span class="w"></span>
|
|||
|
|
|||
|
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run multiple commands on remote nodes</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">community.routeros.command</span><span class="p">:</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">commands</span><span class="p">:</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/system routerboard print</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/system identity print</span><span class="w"></span>
|
|||
|
|
|||
|
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run multiple commands and evaluate the output</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">community.routeros.command</span><span class="p">:</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">commands</span><span class="p">:</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/system routerboard print</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/interface ethernet print</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="nt">wait_for</span><span class="p">:</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">result[0] contains x86</span><span class="w"></span>
|
|||
|
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">result[1] contains ether1</span><span class="w"></span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
<section id="return-values">
|
|||
|
<h2><a class="toc-backref" href="#id7">Return Values</a><a class="headerlink" href="#return-values" title="Permalink to this heading"></a></h2>
|
|||
|
<p>Common return values are documented <a class="reference external" href="https://docs.ansible.com/ansible/devel/reference_appendices/common_return_values.html#common-return-values" title="(in Ansible vdevel)"><span class="xref std std-ref">here</span></a>, the following are the fields unique to this module:</p>
|
|||
|
<table class="colwidths-auto ansible-option-table docutils align-default" style="width: 100%">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p>Key</p></th>
|
|||
|
<th class="head"><p>Description</p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="return-failed_conditions"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-return-failed-conditions"><strong>failed_conditions</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#return-failed_conditions" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>The list of conditionals that have failed</p>
|
|||
|
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> failed</p>
|
|||
|
<p class="ansible-option-line ansible-option-sample"><span class="ansible-option-sample-bold">Sample:</span> <code class="ansible-option-sample docutils literal notranslate"><span class="pre">["...",</span> <span class="pre">"..."]</span></code></p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="return-stdout"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-return-stdout"><strong>stdout</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#return-stdout" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>The set of responses from the commands</p>
|
|||
|
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> always apart from low level errors (such as action plugin)</p>
|
|||
|
<p class="ansible-option-line ansible-option-sample"><span class="ansible-option-sample-bold">Sample:</span> <code class="ansible-option-sample docutils literal notranslate"><span class="pre">["...",</span> <span class="pre">"..."]</span></code></p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><div class="ansible-option-cell">
|
|||
|
<div class="ansibleOptionAnchor" id="return-stdout_lines"></div><p class="ansible-option-title" id="ansible-collections-community-routeros-command-module-return-stdout-lines"><strong>stdout_lines</strong></p>
|
|||
|
<a class="ansibleOptionLink" href="#return-stdout_lines" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
|
|||
|
</div></td>
|
|||
|
<td><div class="ansible-option-cell"><p>The value of stdout split into a list</p>
|
|||
|
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> always apart from low level errors (such as action plugin)</p>
|
|||
|
<p class="ansible-option-line ansible-option-sample"><span class="ansible-option-sample-bold">Sample:</span> <code class="ansible-option-sample docutils literal notranslate"><span class="pre">[["...",</span> <span class="pre">"..."],</span> <span class="pre">["..."],</span> <span class="pre">["..."]]</span></code></p>
|
|||
|
</div></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
<section id="authors">
|
|||
|
<h3>Authors<a class="headerlink" href="#authors" title="Permalink to this heading"></a></h3>
|
|||
|
<ul class="simple">
|
|||
|
<li><p>Egor Zaitsev (@heuels)</p></li>
|
|||
|
</ul>
|
|||
|
</section>
|
|||
|
<section id="collection-links">
|
|||
|
<h3>Collection links<a class="headerlink" href="#collection-links" title="Permalink to this heading"></a></h3>
|
|||
|
<p class="ansible-links">
|
|||
|
<a href="https://github.com/ansible-collections/community.routeros/issues" aria-role="button" target="_blank" rel="noopener external">Issue Tracker</a>
|
|||
|
<a href="https://github.com/ansible-collections/community.routeros" aria-role="button" target="_blank" rel="noopener external">Repository (Sources)</a>
|
|||
|
<a href="https://github.com/ansible-collections/community.routeros/issues/new?assignees=&labels=&template=bug_report.md" aria-role="button" target="_blank" rel="noopener external">Submit a bug report</a>
|
|||
|
<a href="https://github.com/ansible-collections/community.routeros/issues/new?assignees=&labels=&template=feature_request.md" aria-role="button" target="_blank" rel="noopener external">Request a feature</a>
|
|||
|
<a href="./#communication-for-community-routeros" aria-role="button" target="_blank">Communication</a>
|
|||
|
</p></section>
|
|||
|
</section>
|
|||
|
</section>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
|||
|
<a href="api_modify_module.html" class="btn btn-neutral float-left" title="community.routeros.api_modify module – Modify data at paths with API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|||
|
<a href="facts_module.html" class="btn btn-neutral float-right" title="community.routeros.facts module – Collect facts from remote devices running MikroTik RouterOS" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|||
|
</div>
|
|||
|
|
|||
|
<hr/>
|
|||
|
|
|||
|
<div role="contentinfo">
|
|||
|
<p>© Copyright Ansible contributors.</p>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</footer>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
</div>
|
|||
|
<script>
|
|||
|
jQuery(function () {
|
|||
|
SphinxRtdTheme.Navigation.enable(true);
|
|||
|
});
|
|||
|
</script><!-- extra footer elements for Ansible beyond RTD Sphinx Theme -->
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|