steampunk.unit.listener_info (0.7.1) — module

List NGINX Unit listener(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 NGINX Unit listener configuration.

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve information about all listeners
  steampunk.unit.listener_info:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve information about a specific listener
  steampunk.unit.listener:
    pattern: "127.0.0.1:80"

Inputs

    
pattern:
    description:
    - A pattern to retrieve information about. Retrieve all listeners of not set.
    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:
    pass:
      description: Destination for incomming requests.
      returned: always
      sample: applications/test
      type: str
    pattern:
      description: Listener pattern.
      returned: always
      sample: 127.0.0.1:3000
      type: str
    tls:
      contains:
        certificate:
          description: Certificate bundle
          returned: always
          sample: certificates/my-bundle
          type: str
      description: SSL/TLS configuration
      returned: if set
      type: complex
  description: Objects representing NGINX Unit listeners.
  elements: dict
  returned: always
  type: list