Ansible Runner NATS Event Emitter
This project is a plugin for Ansible Runner that allows emitting Ansible status and events to NATS in the form of published messages. This can allow Runner to notify other systems as Ansible jobs are run and to deliver key events to that system if it's interested.
For more details and the latest documentation see: https://ansible-runner.readthedocs.io/en/latest
Configuring the emitter
Default behaviour
By default the emitter is disabled.
Enabling the emitter
In order to enable the emitter, subject ID must be configured either as nats_subject_id variable or as an environment variable:
RUNNER_NATS_SUBJECT_ID: Subject ID
When subject ID is configured, messages are published to the following subjects:
-
pub.ansible.runner.{subject_id}.{runner_ident}.event: message contains an event -
pub.ansible.runner.{subject_id}.{runner_ident}.status: message contains a status update
runner_identis an auto-generated UUID assigned to each runner instance.
Special case: if
RUNNER_NATS_SUBJECT_IDis set tohostname, then hostname read usingsocket.gethostname()is used as subject id.
Configuring headers
Headers can be configured to be sent with each message.
They can be provided as comma separated list of keyvalues (using =).
Example: RUNNER_NATS_HEADERS="producer=ansible-runner,foo=bar"
Configuring NATS client
NATS client options can be provided as nats_options settings in the runner config settings.
Configuring client authentication
The following environment variables can be set to authenticate the client:
RUNNER_NATS_USERNAME: user nameRUNNER_NATS_PASSWORD: user passwordRUNNER_NATS_TOKEN: connection tokenRUNNER_NATS_USER_CREDENTIALS: user credentialsRUNNER_NATS_NKEYS_SEED: user nkey seed
Configuring servers
RUNNER_NATS_SERVERS: comma separated list of NATS server URLs.
Advanced configuration
RUNNER_NATS_CLIENT_NAME: client nameRUNNER_NATS_CLIENT_VERBOSE: enable verbose mode when value istrue,yes,y,1oron.RUNNER_NATS_ALLOW_RECONNECT: allow reconnect when value istrue,yes,y,1oron.RUNNER_NATS_CONNECT_TIMEOUT: connection timeout in secondsRUNNER_NATS_RECONNECT_TIME_WAIT: time to wait before reconnectingRUNNER_NATS_MAX_RECONNECT_ATTEMPTS: maximum number of reconnect attemptsRUNNER_NATS_PING_INTERVAL: interval between system pingsRUNNER_MAX_OUTSTANDING_PINGS: maximum number of outstanding ping before considering connection staleRUNNER_NATS_FLUSHER_QUEUE_SIZE: maximum size of flusher queue
Metadata
Release files for ansible-runner-nats 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ansible-runner-nats-0.4.0.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ansible_runner_nats-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.4 kB
Release files / ansible-runner-nats-0.4.0.tar.gz
| Download URL | ansible-runner-nats-0.4.0.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ca632b820be1f8cdf2ed5e72081f0abcafa59035fb544bd6377f02a722dabd0
|
|
BLAKE2b-256 checksum How to use checksums |
1a70dcb741c1273428302a67e28e3e4ca239c65ec2f35de6b3f40e98a6cc8dd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / ansible_runner_nats-0.4.0-py3-none-any.whl
| Download URL | ansible_runner_nats-0.4.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed6e9ded0cd63cbfadc275693589778d45210df921102cfcbb08099fb09d3b3e
|
|
BLAKE2b-256 checksum How to use checksums |
3d2d01ff0a8f06a581226f145d4758cd4deb105c2038ad34bd1815a80705f2d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|