solace / solace.pubsub_plus / 1.12.2 / module / solace_cloud_service_hostnames list of hostnames on a service Authors: Ricardo Gomez-Ulmke (@rjgu) preview | supported by communitysolace.pubsub_plus.solace_cloud_service_hostnames (1.12.2) — module
Install with ansible-galaxy collection install solace.pubsub_plus:==1.12.2
collections: - name: solace.pubsub_plus version: 1.12.2
Manage a list of additional hostnames on a service in a single transaction.
Allows addition and removal of a list of additional hostnames as well as replacement of all existing additional hostnames on a service.
Supports 'transactional' behavior with rollback to original list in case of error.
De-duplicates hostname list.
Reports which hostnames were added, deleted and omitted (duplicates). In case of an error, reports the invalid hostname.
To delete all Subscription objects, use state='exactly' with an empty/null list (see examples).
# 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_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) }}" tasks: - name: exit if not solace cloud meta: end_play when: broker_type != 'solace_cloud' - set_fact: additionalHostnames: - manage-list-hostname-1 - manage-list-hostname-2 - name: ensure all hostnames in list are absent solace_cloud_service_hostnames: hostnames: "{{ additionalHostnames }}" state: absent - name: add all hostnames in list solace_cloud_service_hostnames: hostnames: "{{ additionalHostnames }}" state: exactly - name: ensure all hostnames in list are absent solace_cloud_service_hostnames: hostnames: null state: exactly
state: choices: - present - absent - exactly default: present description: Target state for CRUD list operation. required: false type: str 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 hostnames: description: The list of additional hostnames to manage on the service. elements: str required: true type: list 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
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 response: description: The response of the operation. returned: always sample: success: response: - added: manage-list-hostname-1.messaging.solace.cloud - added: manage-list-hostname-2.messaging.solace.cloud type: dict