How to enable callback plugin in Ansible Tower? - plugins

I need to enable few callback plugins in my Ansible Tower. For example consider
stdout_callback = yaml
bin_ansible_callbacks = True
these plugins I can directly add to my ansible.cfg file when I use Ansible Engine, but I'm not able to find any solution, where to add these to reflect in Ansible Tower.

You may have a look into the documentation Using callback plugins with Tower. Please take note that
Ansible Tower does not support the stdout callback plugin because Ansible only allows one, and it is already being used by Ansible Tower for streaming event data.

Related

How to call builtin Ansible module from custom Ansible module?

I have a custom Ansible module written that will query my cmdb for host details. Next I need to call the builtin add_host module to iterate over those results and update the Ansible inventory.
Could someone please show a simple example of how to call the builtin module add_host from a custom Ansible module? I have looked around online and can't find any documents that describe specifically this.
When I look at the builin add_host stuff, it appears the module is just being used for the DOC section and as a pointer to the plugin. Looking at the plugin, I'm not sure how I could import/call that remotely.
These are the two files I have on my machine for add_host :
/opt/pyats/lib/python3.7/site-packages/ansible/modules/inventory/add_host.py
/opt/pyats/lib/python3.7/site-packages/ansible/plugins/action/add_host.py
Thank you!
add_host is implemented as an action plugin. Ansible engine will check if an action plugin exists with the same name as a task (add_host) if yes it will invoke that action plugin if not it will try to search for module file name corresponding to the task name.
This is generally done for modules that execute on the control node itself.
Here’s an example of calling one module from another https://github.com/ansible-collections/community.yang/blob/main/plugins/action/get.py#L123. In this case the community.yang.get module (action plugin) internally invokes ansible.netcommon.netconf_get module

Does anyone have tried the HLF 2.0 feature "External Builders and Launchers" and wants to get in touch?

I'm getting my way through the HLF 2.0 docs and would love to discuss and try out the new features "External Builders and Launchers" and "Chaincode as an external service".
My goal is to run HLF2.0 on an K8s cluster (OpenShift). Does anyone wants to get in touch or has anyone already figured his way through?
Cheers from Germany
Also trying to use the ExternalBuilder. Setup core.yaml, rebuilt the containers to use it. I get an error that on "peer lifecycle chaincode install .tgz...", that the path to the scripts in core.yaml can not be found.
I've added volume bind commands in the peer-base.yaml, and in docker-compose-cli.yaml, and am using the first-network setup. Dropped out the part of the byfn.sh that would connect to the cli container, so that I do that part manually, do the create, join, update anchors successfully, and then try to do the install and fail. However, on the install, I'm failing on the /bin/detect, because it can't find that file to fork/exec it. To get that far, peer was able to read my external configuration, and read the core.yaml file. At the moment, trying the "mode: dev" in the core.yaml which seems to indicate that the scripts and the chaincode will be run "locally", which I think means it should run in the cli container. Otherwise, tried to walk the code to see how the docker containers are being created dynamically, and from what image, but haven't been able to nail that down yet.

How to change configuration in play dynamically via JMX

I have my configuration for my Scala Play application in my application.conf file.
For now, everytime I want to change the configuration I have to make a deployment.
Can anybody help me finding out, how to expose the Configuration as a MBean?
I would like to change the configuration without deployment.
Didn't find any documentation on this.
Redeploy just for a configuration change is really boring and I understand you want to avoid that.
Changing configuration while the application is running is a risky operation and I would not recommend going in that direction.
But there are a few techniques that the framework provides that would only require a restart of the application.
Play allows you to point to an external file with your configuration
$ your-app -Dconfig.file=/full/path/to/conf/application-prod.conf
Besides that in your conf file you can use environment variables, so you can configure different servers differently using the same application.conf
my.key = defaultvalue
my.key = ${?MY_KEY_ENV}
And run your app using
$ your-app -DMY_KEY_ENV=bar
Reference:
https://www.playframework.com/documentation/2.4.x/Production
https://www.playframework.com/documentation/2.4.x/ProductionConfiguration

How to use Jenkins Build Keeper Plugin

I would like to use the Jenkins 'Build Keeper Plugin' but I don't know how. The plugin site doesn't describe how to use it. Plugin Site
On this page I found the extension points which I would like to use, e.g. the org.jenkins_ci.plugins.build_keeper.KeepFirstFailedPolicy
But in the configuration part of my project, I can't find any place to configure it to use that policy. So where do I have to add it?
Jenkins version is 1.544
Have you tried to open Job configuration page and look for settings ?
For example it is another plugin but it is very similar : Build Discard plugin, may be you will use it for your purposes:
Build discard old build settings
You can configure it in the job under the section Build Environment.
For screenshots see also https://issues.jenkins-ci.org/browse/JENKINS-25293
If used from within a pipeline, it is enough to write
'currentBuild.rawBuild.keepLog(true)'
That is unfortunately not an interface to the plugin, just a jobs setting, but can solve it when You want to keep all builds, or decide within the build if to keep it.

Installing Nagios plugins on Centreon

I am very new to monitoring and with linux.
So i took the easy path and Installed FullyAutomatedNagios (FAN) on a linux machine (CentOS).
and installed/configured NSclient++ on windows machine i wanted to monitor. Via webinterfece of FAN which is centreon i started to monitor basic parameters like (memory,cpu,disks,services etc) Via CHECK_NT commands.
Now i want to move forward and want to monitor something more like DB performance,queries etc , but inorder to do that i need to install nagios plugins and i have no idea how can i do that.please help.
The first things to do in my opinion are :
Know exactly what do you want to check (DB, Web server, ...)
Search on http://exchange.nagios.org/ or others (why not) if there are already some plugins who responding to your demand.
Search if the check can be done directly on the monitoring server or in the client server (the protocol will change, NRPE, NSClient++ or SNMP for example)
If yes, you have to implement them on your monitoring server, on your plugins directory (where are your CPU, memory plugins) and execute the script with corrects parameters if the plugin works.
If yes, you can now implement them on your interface and make them automatic, like create command, create service...
Define your metrics and check when you want your plugins output Warning alert or Critical alert and all these things are set in the interface.
If you don't find plugins, you must create one.
This is way to do and can be optimized obviously.
Nicolas B.