<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>This option is used only with state <em>parsed</em>.</div>
<div>The value of this option should be the output received from the vyos device by executing the command <b>"show configuration commands | grep host-name"</b>.</div>
<div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the <em>parsed</em> key within the result.</div>
<div>The state the configuration should be left in</div>
<div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div>
<div>The state <em>rendered</em> will transform the configuration in <code>config</code> option to platform specific CLI commands which will be returned in the <em>rendered</em> key within the result. For state <em>rendered</em> active connection to remote host is not required.</div>
<div>The states <em>merged</em>, <em>replaced</em> and <em>overridden</em> have identical behaviour for this module.</div>
<div>The state <em>gathered</em> will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the <em>gathered</em> key within the result.</div>
<div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into JSON format as per the resource module parameters and the value is returned in the <em>parsed</em> key within the result. The value of <code>running_config</code> option should be the same format as the output of command <em>show configuration commands | grep host-name</em> executed on device. For state <em>parsed</em> active connection to remote host is not required.</div>
</td>
</tr>
</table>
<br/>
Notes
-----
..note::
- Tested against vyos 1.1.8
- This module works with connection ``network_cli``.
- The Configuration defaults of the Vyos network devices are supposed to hinder idempotent behavior of plays
-name:Render the commands for provided configuration
vyos.vyos.vyos_hostname:
config:
hostname:vyosTest
state:rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "set system host-name vyosTest",
# ]
# Using state: parsed
# File: parsed.cfg
# ----------------
# set system host-name 'vyos'
# Parsed play:
# ------------
-name:Parse the provided configuration with the existing running configuration
vyos.vyos.vyos_hostname:
running_config:"{{lookup('file','parsed.cfg')}}"
state:parsed
# Module Execution Result:
# ------------------------
# "parsed": {
# "hostname": "vyos"
# }
Return Values
-------------
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">This output will always be in the same format as the module argspec.</div>