I’m at a point in my Ansible development where I think I need to write a module. We use a third party messaging server called SwiftMQ. It’s very similar to RabbitMQ & ActiveMQ. SwiftMQ (SMQ) doesn’t provide an API for determining if objects exist or attribute values. Instead, it provides a CLI to execute a series of commands & you can execute the CLI with an input file.
Likewise, if you want to retrieve values via the CLI, you can output to a text file. It’s primative, but it works and runtime is extremely fast.
Does anyone have experience with having to parse CLI output to determine if & what values need to change? If so, do you have any advice? Is there an alternative approach that I haven’t considered?
I've got a similar job on my todo list - using the JBoss CLI to
get/set state on a runtime
domain (ansible-xml would make managing config a doddle but editing
the raw xml is a big no-no
in JBoss land).
I made a start on a role to manage it, mainly with command: tasks,
register variables and when: clauses.
One task would check desired state, then a 'setter' would fire
conditionally if state needed to change.
It's nigh on impossible in my case since the jboss CLI is so
inconsistent, but you might get somewhere
if your CLI is less quirky.