.. _vyos.rest.vyos_system_module:
*********************
vyos.rest.vyos_system
*********************
**Manage system settings on VyOS devices using REST API**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Manages basic system settings on VyOS devices via the REST API.
- Uses REST API (``connection=httpapi``) instead of CLI.
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
domain_name
string
|
|
Device domain name.
|
|
domain_search
list
/ elements=string
|
|
List of domain search suffixes.
|
|
host_name
string
|
|
Device hostname.
|
|
name_server
list
/ elements=string
|
|
List of DNS name servers.
aliases: name_servers
|
|
state
string
|
Choices:
present ←
- absent
|
present applies the configuration.
absent removes the configuration.
|
Notes
-----
.. note::
- Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin.
- ``ansible_network_os`` must be set to ``vyos.rest.vyos``.
Examples
--------
.. code-block:: yaml
- name: Configure hostname and domain
vyos.rest.vyos_system:
host_name: router1
domain_name: example.com
name_server:
- 8.8.8.8
- 8.8.4.4
state: present
- name: Remove domain name and name servers
vyos.rest.vyos_system:
domain_name: example.com
name_server:
- 8.8.8.8
state: absent
Return Values
-------------
Common return values are documented `here `_, the following are the fields unique to this module:
.. raw:: html
| Key |
Returned |
Description |
|
after
dictionary
|
when changed |
Module-owned system configuration after this module ran.
|
|
before
dictionary
|
always |
Module-owned system configuration before this module ran.
|
|
commands
list
|
always |
List of API command tuples sent to the device.
|
|
response
dictionary
|
when changes are applied |
Raw API response.
|
|
saved
boolean
|
when changes are applied |
Whether the config was saved after changes.
|
Status
------
Authors
~~~~~~~
- VyOS Community (@vyos)