ansible.builtin.hcloud_route (v2.9.25) — module

Create and delete cloud routes on the Hetzner Cloud.

| "added in version" 2.9 of ansible.builtin"

Authors: Lukas Kaemmerling (@lkaemmerling)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.25

Description

Create, update and delete cloud routes on the Hetzner Cloud.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a basic route
  hcloud_route:
    network: my-network
    destination: 10.100.1.0/24
    gateway: 10.0.1.1
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the route is absent
  hcloud_route:
    network: my-network
    destination: 10.100.1.0/24
    gateway: 10.0.1.1
    state: absent

Inputs

    
state:
    choices:
    - absent
    - present
    default: present
    description:
    - State of the route.
    type: str

gateway:
    description:
    - Gateway for the route.
    required: true
    type: str

network:
    description:
    - The name of the Hetzner Cloud Network.
    required: true
    type: str

endpoint:
    default: https://api.hetzner.cloud/v1
    description:
    - This is the API Endpoint for the Hetzner Cloud.
    type: str

api_token:
    description:
    - This is the API Token for the Hetzner Cloud.
    required: true
    type: str

destination:
    description:
    - Destination network or host of this route.
    required: true
    type: str

Outputs

hcloud_route:
  contains:
    destination:
      description: Destination network or host of this route
      returned: always
      sample: 10.0.0.0/8
      type: str
    gateway:
      description: Gateway of the route
      returned: always
      sample: 10.0.0.1
      type: str
    network:
      description: Name of the Network
      returned: always
      sample: my-network
      type: str
  description: One Route of a Network
  returned: always
  type: complex

See also