Open kirkhw opened 2 months ago
For an interim work around, can someone point out how we might deploy our own customization to this plugin?
!component =plugins/callback/logdna.py
Another finding is self.conf_tags
though being pulled in from [callback_logdna]
var conf_tags
is not being passed to the Logdna Python Library and as such unable to set the Logdna tagging desired.
Summary
With many Cloud Service Providers (CSP) offering a managed hosted version of Logdna on their platforms, it is necessary to send logs for aggregation and analysis against Logdna endpoints for that CSP's service endpoints.
The Ansbile 2.9 implementation of this callback does not expose a method to pass in a custom url (i.e.
conf_url
) to which the dependent Logdna Python Library does support as an inbound option (url
). As a result the Logdna Python Library uses it's default config url athttps://logs.logdna.com/logs/ingest
. An example endpoint url ishttps://logs.ca-tor.logging.cloud.ibm.com/logs/ingest
for an instance provisioned in the Toronto multizone region of this CSP. We believe the same applies to the latest implementation too.By modifying the file
python/3.8.19/lib/python3.8/site-packages/ansible/plugins/callback/logdna.py
, this can be easily achieved. Line 145 for example can be expanded to pass theurl
option from a new Ansible callback plugin variableconf_url
(naming convention to match existing variables).Before: self.options = {'hostname': self.conf_hostname, 'mac': self.mac, 'index_meta': True} After: self.conf_url = self.get_option('conf_url') self.options = {'hostname': self.conf_hostname, 'mac': self.mac, 'index_meta': True, 'url': self.conf_url}
We'd also appreciate guidance on how we could extend this plugin for the short term. These alterations worked in a local development workspace. Managing the manual edits on remote bare metal and virtual servers is something we haven't figured out yet.
Issue Type
Feature Idea
Component Name
logdna callback
Additional Information
Code of Conduct