From ef3ded9ace9d7c650e15104698acdf629c57f797 Mon Sep 17 00:00:00 2001 From: omnom62 Date: Sun, 23 Aug 2026 08:39:18 +1000 Subject: T8989: vyos_hostname rework --- docs/vyos.rest.vyos_hostname_module.rst | 152 +++----------------------------- 1 file changed, 12 insertions(+), 140 deletions(-) (limited to 'docs') diff --git a/docs/vyos.rest.vyos_hostname_module.rst b/docs/vyos.rest.vyos_hostname_module.rst index c8ea1c5..7e4e37e 100644 --- a/docs/vyos.rest.vyos_hostname_module.rst +++ b/docs/vyos.rest.vyos_hostname_module.rst @@ -17,18 +17,10 @@ Version added: 1.0.0 Synopsis -------- -- Manages the ``set system host-name`` configuration on a VyOS device using the HTTPS REST API. -- Mirrors the behaviour of ``vyos.vyos.vyos_hostname`` but uses the HTTP API instead of SSH/network_cli. -- The states ``replaced``, ``overridden`` behave identically to ``merged`` for this single-value resource. +- Manages the ``system host-name`` configuration on a VyOS device using the HTTPS REST API. -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- VyOS 1.3+ - Parameters ---------- @@ -41,21 +33,6 @@ Parameters Choices/Defaults Comments - - -
- api_key - -
- string -
- - - - -
API key configured on the device.
- -
@@ -89,53 +66,6 @@ Parameters - - -
- hostname - -
- string -
- - - - -
IP address or FQDN of the VyOS device (not needed with httpapi inventory).
- - - - -
- port - -
- integer -
- - - Default:
443
- - -
HTTPS port for the REST API.
- - - - -
- running_config - -
- string -
- - - - -
Used only with state parsed.
-
The value should be the output of show configuration commands | grep host-name from the device.
- -
@@ -152,53 +82,13 @@ Parameters
  • overridden
  • deleted
  • gathered
  • -
  • rendered
  • -
  • parsed
  • merged - Ensure the hostname is set to the value in config.
    -
    replaced - Identical to merged for this single-value resource.
    -
    overridden - Identical to merged for this single-value resource.
    -
    deleted - Remove the configured hostname (resets to default).
    -
    gathered - Read the current hostname from the device and return it in gathered without making changes.
    -
    rendered - Return the CLI commands for the given config without connecting to the device.
    -
    parsed - Parse the running_config string and return structured data without connecting to the device.
    - - - - -
    - timeout - -
    - integer -
    - - - Default:
    30
    - - -
    Request timeout in seconds.
    - - - - -
    - verify_ssl - -
    - boolean -
    - - - - - -
    Validate the device's TLS certificate.
    +
    replaced and overridden behave identically to merged for this single-value resource -- there is nothing else to distinctly replace or override when there is only one field.
    +
    deleted - Remove the configured hostname.
    +
    gathered - Read the current hostname from the device without making changes.
    @@ -226,32 +116,14 @@ Examples hostname: vyos-core-01 state: merged - - name: Replace hostname - vyos.rest.vyos_hostname: - config: - hostname: vyos-core-02 - state: replaced - - name: Gather current hostname vyos.rest.vyos_hostname: state: gathered - register: result - name: Delete hostname configuration vyos.rest.vyos_hostname: state: deleted - - name: Render commands without connecting - vyos.rest.vyos_hostname: - config: - hostname: vyos-core-01 - state: rendered - - - name: Parse running config - vyos.rest.vyos_hostname: - running_config: "set system host-name 'vyos'" - state: parsed - Return Values @@ -307,7 +179,7 @@ Common return values are documented `here always -
    REST API commands dispatched.
    +
    List of API command tuples sent to the device.

    @@ -329,30 +201,30 @@ Common return values are documented `here
    - parsed + response
    dictionary
    - when state is parsed + when changes are applied -
    Structured data parsed from running_config (state=parsed only).
    +
    Raw API response.

    - rendered + saved
    - list + boolean
    - when state is rendered + when changes are applied -
    CLI commands for the provided config (state=rendered only).
    +
    Whether the config was saved after changes.

    -- cgit v1.2.3