No project description provided
Project description
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
Enabling the emitter
By default the emitter is disabled.
In order to enable the emitter, either manually set a value for the key nats_subject_id
in the settings of the runner config, or set the environment variable RUNNER_NATS_SUBJECT_ID
.
If RUNNER_NATS_SUBJECT_ID
is set to hostname
, then hostname read using socket.gethostname()
is used as subject id.
Messages published by the emitter are published to the following subjects: pub.ansible.runner.{subject_id}.{runner_ident}.[event|status]
.
Only subject_id
can be configured.
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
,1
oron
.RUNNER_NATS_ALLOW_RECONNECT
: allow reconnect when value istrue
,yes
,y
,1
oron
.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
Project details
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-runner-nats-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4daa318b516d9883507463b82bf520aa94336c8b9460ef92c0c2818d9c4b5dc6 |
|
MD5 | 9fa61512d4cd4934e3cfbd9e6728e2bc |
|
BLAKE2b-256 | f473947858b6bdaad4c57d3da8c0d9168f352d76d10b04c9e23d293d5a5c12dd |
Hashes for ansible_runner_nats-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cbdb72372a2f50eb9180aaa39e6f2daa5fd244608b5d0229bee10f710dd10eb |
|
MD5 | 96f668c63ffbb875718a84e3c3f22a50 |
|
BLAKE2b-256 | 509b73b51b411bd5d6a251c60583ed807ca4ecb31c37c54d1f1344324d26fad2 |