solace.pubsub_plus.solace_cloud_get_service_hostnames (1.12.2) — module

get all service hostnames

Authors: Ricardo Gomez-Ulmke (@rjgu)

preview | supported by community

Install collection

Install with ansible-galaxy collection install solace.pubsub_plus:==1.12.2


Add to requirements.yml

  collections:
    - name: solace.pubsub_plus
      version: 1.12.2

Description

Get a list of additional hostnames configured on the service.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Copyright (c) 2022, Solace Corporation, Ricardo Gomez-Ulmke, <ricardo.gomez-ulmke@solace.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

-
  name: solace_cloud_service_hostnames doc example
  hosts: all
  gather_facts: no
  any_errors_fatal: true
  collections:
    - solace.pubsub_plus
  module_defaults:
    solace.pubsub_plus.solace_cloud_get_service_hostnames:
      solace_cloud_api_token: "{{ SOLACE_CLOUD_API_TOKEN if broker_type=='solace_cloud' else omit }}"
      solace_cloud_service_id: "{{ solace_cloud_service_id | default(omit) }}"
    solace.pubsub_plus.solace_cloud_service_hostname:
      solace_cloud_api_token: "{{ SOLACE_CLOUD_API_TOKEN if broker_type=='solace_cloud' else omit }}"
      solace_cloud_service_id: "{{ solace_cloud_service_id | default(omit) }}"
  tasks:

    - name: exit if not solace cloud
      meta: end_play
      when: broker_type != 'solace_cloud'

    - set_fact:
        additionalHostnames:
        - hostname-1
        - hostname-2

    - name: ensure all hostnames in list are absent
      solace_cloud_service_hostname:
        hostname: "{{ item }}"
        state: absent
      loop: "{{ additionalHostnames }}"

    - name: add all hostnames in list
      solace_cloud_service_hostname:
        hostname: "{{ item }}"
        state: present
      loop: "{{ additionalHostnames }}"

    - name: get list of existing hostnames
      solace_cloud_get_service_hostnames:

    - name: ensure all hostnames in list are absent
      solace_cloud_service_hostname:
        hostname: "{{ item }}"
        state: absent
      loop: "{{ additionalHostnames }}"

Inputs

    
timeout:
    default: 60
    description: Connection timeout in seconds for the http request or overall call interaction
      timeout for Solace Cloud API.
    required: false
    type: int

validate_certs:
    default: true
    description: Flag to switch validation of client certificates on/off when using a
      secure connection.
    required: false
    type: bool

solace_cloud_home:
    choices:
    - us
    - au
    - US
    - AU
    - ''
    description: The Solace Cloud home region.
    required: false
    type: str

solace_cloud_api_token:
    aliases:
    - api_token
    description:
    - The API Token.
    - Generate using Solace Cloud console with the appropriate permissions for the operations
      you want to enable.
    required: true
    type: str

solace_cloud_service_id:
    aliases:
    - service_id
    description:
    - The service id of a service in Solace Cloud.
    - Click on the service in Solace Cloud - the service id is in the URL.
    required: true
    type: str

Outputs

msg:
  description: The response from the HTTP call in case of error.
  returned: error
  type: dict
rc:
  description: Return code. rc=0 on success, rc=1 on error.
  returned: always
  sample:
    error:
      rc: 1
    success:
      rc: 0
  type: int
result_list:
  description: The list of objects found containing requested fields. Results differ
    based on the api called.
  elements: dict
  returned: success
  type: list
result_list_count:
  description: Number of items in result_list.
  returned: success
  type: int

See also