Ansible modules to configure Solace PubSub+ event brokers with SEMP(v2).
Project description
Ansible Modules for Solace PubSub+ Event Brokers SEMP(v2) REST API
Ansible modules to configure Solace PubSub+ event brokers with SEMP v2.
QUICKSTART
Install
Install ansible & python3. Check that python points to the right version:
python -V
==> must be >=3.6
Install / upgrade ansible-solace:
pip3 install ansible-solace
Package location:
Get the location of the package:
pip3 show ansible-solace
Name: ansible-solace
...
Location: {your-install-path}/site-packages
...
If your Ansible install location is different to the ansible-solace package, you have to tell Ansible about these modules.
You can find a description here: Adding modules and plugins locally
or you can set the ANSIBLE_MODULE_UTILS
and ANSIBLE_LIBRARY
environment variables:
export ANSIBLE_MODULE_UTILS={your-install-path}/ansible/module_utils
export ANSIBLE_LIBRARY={your-install-path}/ansible/modules
# check:
ansible-doc -l | grep ansible-solace
Note: You can also have a look at set-ansible-env.sh
.
Python interpreter:
Depending on your OS/environment, you may have to set the python interpreter explicitly.
For example, set the ANSIBLE_PYTHON_INTERPRETER
variable:
# find the location of your python installation
brew info python
# or
which python
# set the location
# e.g.
export ANSIBLE_PYTHON_INTERPRETER=/usr/local/bin/python
Run the Example
Pre-requisites
- a Solace PubSub+ Broker (Cloud or Software)
- credentials for the admin (sempv2) interface
Configure the Inventory
Copy the example below to brokers.inventory.json
and enter the values:
{
"all": {
"hosts": {
"{your broker name}": {
"ansible_connection": "local",
"sempv2_host": "{host, e.g. xxxx.messaging.solace.cloud}",
"sempv2_port": 943,
"sempv2_is_secure_connection": true,
"sempv2_username": "{admin user name}",
"sempv2_password": "{admin user password}",
"sempv2_timeout": "60",
"vpn": "{message vpn}"
}
}
}
}
Copy the example below to setup-queue.playbook.yml
:
-
name: Setup A Queue with a Subscription
hosts: all
module_defaults:
solace_subscription:
host: "{{ sempv2_host }}"
port: "{{ sempv2_port }}"
secure_connection: "{{ sempv2_is_secure_connection }}"
username: "{{ sempv2_username }}"
password: "{{ sempv2_password }}"
timeout: "{{ sempv2_timeout }}"
msg_vpn: "{{ vpn }}"
solace_queue:
host: "{{ sempv2_host }}"
port: "{{ sempv2_port }}"
secure_connection: "{{ sempv2_is_secure_connection }}"
username: "{{ sempv2_username }}"
password: "{{ sempv2_password }}"
timeout: "{{ sempv2_timeout }}"
msg_vpn: "{{ vpn }}"
tasks:
- name: Add / update the queue
solace_queue:
name: "my-queue"
settings:
egressEnabled: true
ingressEnabled: true
permission: "consume"
state: present
- name: Create subscription on queues
solace_subscription:
queue: "my-queue"
topic: "my/subscription/topic"
state: present
Run the playbook
ansible-playbook -i brokers.inventory.json setup-queue.playbook.yml
MODULES
Status of the solace_*
modules:
Module | SEMP Endpoint | Type | Status | Example |
---|---|---|---|---|
solace_about | about | Query | ||
solace_acl_profile | aclProfile | Action | :sunny: | :page_facing_up: |
solace_acl_connect | aclProfile | Action | :sunny: | :page_facing_up: |
solace_acl_publish | aclProfile | Action | :sunny: | :page_facing_up: |
solace_acl_subscribe | aclProfile | Action | :sunny: | :page_facing_up: |
solace_acl_publish_exception (deprecated) | aclProfile | Action | :sunny: | |
solace_acl_subscribe_exception (deprecated) | aclProfile | Action | :sunny: | |
solace_authorization_group | authorizationGroup | Action | ||
solace_bridge | bridge | Action | :sunny: | :page_facing_up: |
solace_bridge_remote_subscription | bridge | Action | :sunny: | :page_facing_up: |
solace_bridge_remote_vpn | bridge | Action | :sunny: | :page_facing_up: |
solace_bridge_tls_cn | bridge | Action | :sunny: | :page_facing_up: |
solace_client | clientUsername | Action | :sunny: | :page_facing_up: |
solace_client_profile | clientProfile | Action | :sunny: | |
solace_jndi | jndi | Action | ||
solace_mqtt_session | mqttSession | Action | ||
solace_queue | queue | Action | :sunny: | :page_facing_up: :page_facing_up: |
solace_subscription | queue/{..}/subscriptions | Action | :sunny: | :page_facing_up: |
solace_topic | topicEndpoint | Action | :sunny: | |
solace_replay_log | replayLog | Action | ||
solace_replicated_topic | replicatedTopic | Action | ||
solace_rdp | restDeliveryPoint | Action | :sunny: | :page_facing_up: |
solace_rdp_rest_consumer | restDeliveryPoint | Action | :sunny: | :page_facing_up: |
solace_rdp_rest_consumer_trusted_common_name | restDeliveryPoint | Action | :sunny: | :page_facing_up: |
solace_rdp_queue_binding | restDeliveryPoint | Action | :sunny: | :page_facing_up: |
solace_vpn | msgVpn | Action | :sunny: | :page_facing_up: |
solace_cert_authority | certAuthority | Action | :sunny: | :page_facing_up: |
solace_dmr_bridge | dmrBridge | Action | :sunny: | :page_facing_up: |
solace_dmr | dmrCluster | Action | :sunny: | :page_facing_up: |
solace_link | dmrCluster | Action | :sunny: | :page_facing_up: |
solace_link_remote_address | dmrCluster | Action | :sunny: | :page_facing_up: |
solace_link_trusted_cn | dmrCluster | Action | :sunny: | :page_facing_up: |
Writing New Modules
See Guide to Creating new Modules.
Open Issues
Open items to potentially enhance the framework. See Open Issues.
The End.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ansible-solace-0.2.0.dev2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | decef69fd126115df09348c46e0df99351a98f5007a415a1149e60a8d19b69d0 |
|
MD5 | dd38f89c6c0b4ffa5d86cde361720fe6 |
|
BLAKE2b-256 | ab69057293274ca47cf34ca9612587dc14b1eab5d0731c9fe793d23242098d79 |
Hashes for ansible_solace-0.2.0.dev2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07aa3b0fc7c9d979977a374b237bb4d418f04fb997aadcf2a3521575cdd0d0ed |
|
MD5 | 9ea70986ac94953fdbee9743bc8f52b2 |
|
BLAKE2b-256 | 3b7b23f8fa439983ff8fe0c9587b5aaa3daae5a9b6075c992af62285e8d668db |