Using Ansible to configure a Solace Appliance or VMR

mkst
1 min readJul 14, 2019

Consistency is one of the enemies of surprise.

Being able to roll out the same configuration between or across multiple environments in an automated fashion is a problem we have solved by leveraging Ansible.

We use physical Solace appliances in our Production infrastructure, and dockerised VMRs for all other environments. These devices share similar settings in terms of VPNs, Topics, Queues, and therefore it makes sense to use the same tool for configuration.

Whilst there is a GUI tool available, SolAdmin, and CLI tool, neither lend themselves to automation — enter the REST API.

Ansible has a uri module that allows for POST-ing data to an endpoint (this is used by srajgopalan), however this was not complex enough for our needs, therefore I started writing a custom Ansible module, ansible-solace, which supports a handful of basic operations (VPNs, Clients, Topics, Queues etc) and allows us to create a playbook that provisions all of our Solace appliances.

Simple example to add a VPN:

- name: Playbook to add a vpn named 'foo'
hosts: localhost
tasks:
- name: Add 'foo' VPN
solace_vpn:
name: foo
state: present # default state
settings:
enabled: true
dmrEnabled: false
eventTransactionCountThreshold:
clearPercent: 66
setPercent: 98

Pull requests are welcome!

--

--