steampunk.unit.route_info (0.7.1) — module

Retrieve NGINX Unit route(s)

Authors: Tadej Borovšak (@tadeboro)

Install collection

Install with ansible-galaxy collection install steampunk.unit:==0.7.1


Add to requirements.yml

  collections:
    - name: steampunk.unit
      version: 0.7.1

Description

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

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve information about all routes
  steampunk.unit.route_info:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve information about a specific route
  steampunk.unit.route:
    name: static-site

Inputs

    
name:
    description:
    - Name of the route to retrieve. If parameter is not specified, retrieve information
      about all routes.
    type: str

provider:
    description:
    - Connection parameters.
    suboptions:
      ca_path:
        description:
        - 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  I(UNIT_CA_PATH) environment variable.
        type: path
      endpoint:
        description:
        - HTTP or UNIX uri that should be used to communicate with the Unit.
        - The uri B(MUST) be prefixed by either C(http://), C(https://), or C(unix://).
        - By default, modules will try to connect to I(unix:///var/run/unit/control.sock),
          and if this socket does not exist, fallback to I(unix:///var/run/control.unit.sock).
        - Can also be set using the I(UNIT_ENDPOINT) environment variable.
        type: str
      password:
        description:
        - Password that is used when the I(endpoint) is protected using the basic authentication.
        - This parameter is ignored when the I(enpoint) parameter points to an unix socket.
        - Value is masked in the logs.
        - Can also be set using the I(UNIT_ENDPOINT) environment variable.
        type: str
      username:
        description:
        - Username that is used when the I(enpoint) is protected using the basic authentication.
        - This parameter is ignored when the I(enpoint) parameter points to an unix socket.
        - Can also be set using the I(UNIT_ENDPOINT) environment variable.
        type: str
      verify:
        default: true
        description:
        - Flag that controls the certificate validation.
        - If you are using self-signed certificates, you can set this parameter to C(false).
        - ONLY USE THIS PARAMETER IN DEVELOPMENT SCENARIOS! In you use self-signed certificates
          in production, see the I(auth.ca_path) parameter.
        - Can also be set using the  I(UNIT_VERIFY) environment variable.
        type: bool
    type: dict

Outputs

objects:
  contains:
    name:
      description: Route name.
      returned: if I(global) == C(false)
      sample: my-route
      type: str
    steps:
      contains:
        action:
          contains:
            fallback:
              description: A fallback route step.
              returned: if specified
              type: dict
            location:
              description: The location taht request should be redirected to.
              returned: if specified
              type: str
            pass:
              description: Route's destination.
              returned: if specified
              type: str
            proxy:
              description: Socket address of an HTTP server where the request is proxied.
              returned: if specified
              type: str
            return:
              description: The HTTP response status code to be returned.
              returned: if specified
              type: int
            share:
              description: A static path from where files are served upon a match.
              returned: if specified
              type: str
          description: Action to take if the step's matches.
          returned: always
          type: dict
        match:
          contains:
            arguments:
              description: Parameter arguments supplied in the request URI.
              elements: dict
              returned: if specified
              type: list
            cookies:
              description: Cookies supplied with the request.
              elements: dict
              returned: if specified
              type: list
            destination:
              description: Target IP address and optional port of the request.
              elements: str
              returned: if specified
              type: list
            headers:
              description: Header fields supplied with the request.
              elements: dict
              returned: if specified
              type: list
            host:
              description: Host from the Host header field without port number.
              elements: str
              returned: if specified
              type: list
            method:
              description: Method from the request line.
              elements: str
              returned: if specified
              type: list
            scheme:
              description: URI scheme.
              returned: if specified
              type: str
            source:
              description: Source IP address and optional port of the request.
              elements: str
              returned: if specified
              type: list
            uri:
              description: URI path without arguments.
              elements: str
              returned: if specified
              type: list
          description: Step's conditions to be matched.
          returned: if specified
          type: dict
      description: List of steps in route
      elements: dict
      returned: always
      type: list
  description: Object representing NGINX Unit route.
  elements: dict
  returned: On success and if I(state) == C(present)
  type: list