route_info – Retrieve NGINX Unit route(s)

Retrieve information about all NGINX Unit routes of about a speficic one.

Upstream docs are at https://unit.nginx.org/configuration/#routes.

Examples

- name: Retrieve information about all routes
  steampunk.unit.route_info:

- name: Retrieve information about a specific route
  steampunk.unit.route:
    name: static-site

Parameters

name (optional)

Name of the route to retrieve. If parameter is not specified, retrieve information about all routes.

type: str
provider (optional)

Connection parameters.

type: dict
ca_path (optional)

Path to the CA bundle that should be used to validate the backend certificate.

If this parameter is not set, module will use the CA bundle that python is using.

Can also be set using the UNIT_CA_PATH environment variable.

type: path
endpoint (optional)

HTTP or UNIX uri that should be used to communicate with the Unit.

The uri MUST be prefixed by either http://, https://, or unix://.

By default, modules will try to connect to unix:///var/run/unit/control.sock, and if this socket does not exist, fallback to unix:///var/run/control.unit.sock.

Can also be set using the UNIT_ENDPOINT environment variable.

type: str
password (optional)

Password that is used when the endpoint is protected using the basic authentication.

This parameter is ignored when the enpoint parameter points to an unix socket.

Value is masked in the logs.

Can also be set using the UNIT_ENDPOINT environment variable.

type: str
username (optional)

Username that is used when the enpoint is protected using the basic authentication.

This parameter is ignored when the enpoint parameter points to an unix socket.

Can also be set using the UNIT_ENDPOINT environment variable.

type: str
verify (optional)

Flag that controls the certificate validation.

If you are using self-signed certificates, you can set this parameter to false.

ONLY USE THIS PARAMETER IN DEVELOPMENT SCENARIOS! In you use self-signed certificates in production, see the auth.ca_path parameter.

Can also be set using the UNIT_VERIFY environment variable.

type: bool
default: True

Return Values

objects (On success and if I(state) == C(present)), list, )

Object representing NGINX Unit route.

name (if I(global) == C(false)), str, my-route)

Route name.

steps (always), list, )

List of steps in route

match (if specified), dict, )

Step’s conditions to be matched.

arguments (if specified), list, )

Parameter arguments supplied in the request URI.

cookies (if specified), list, )

Cookies supplied with the request.

destination (if specified), list, )

Target IP address and optional port of the request.

headers (if specified), list, )

Header fields supplied with the request.

host (if specified), list, )

Host from the Host header field without port number.

method (if specified), list, )

Method from the request line.

scheme (if specified), str, )

URI scheme.

source (if specified), list, )

Source IP address and optional port of the request.

uri (if specified), list, )

URI path without arguments.

action (always), dict, )

Action to take if the step’s matches.

pass (if specified), str, )

Route’s destination.

share (if specified), str, )

A static path from where files are served upon a match.

fallback (if specified), dict, )

A fallback route step.

proxy (if specified), str, )

Socket address of an HTTP server where the request is proxied.

return (if specified), int, )

The HTTP response status code to be returned.

location (if specified), str, )

The location taht request should be redirected to.