Ansible develop lookup plugin - how to get target hostname? - plugins

I would like to develop a lookup plugin in ansible that will query a table in a database with the target hostname as a filter.
I managed to create the plugin that is able to query the table, but don't know how to get the hostname.
I don't know if it's feasible and I can't find detailed informations on that.
Any ideas or link to a good development book for ansible modules and plugins ?

Related

What's the anatomy of a Bluemix/Cloud Foundry node red project?

There's lots of documentation and a kludgy console to set up continuous deployment in Cloud Foundry, but I haven't found any documentation on what the artifacts inside a repository need to be.
I don't want to cut-n-paste flows from the node red editor. If that's the only way, then IBM is not ready for prime time. I also am aware of most everything about my flows being in the Cloudant nodered db.
A node red application is more than the flows though. What about my _design docs for my dbs?
I need device info and other stuff from the Watson console, Cloudant info and my flows packaged up into something deployable.
Has anyone scripted this?
What I mean by this is I can clone a Docker project, an npm project and all sorts of projects that implement a build->test->push mechanism. They employ a configuration script of some sort (e.g. package.json) and contain a bunch of source files for the actual application, test scripts, db scripts, whatever is necessary to deploy the application and its environment into a host. I see lots of documentation on the toolchain and its features, but I'm not clear on if it's possible to make use of it for my hosted node red application. Or if I have to write the scripting mechanisms to offload flow info from the nodered db and query all my other dbs for their respective _design docs and all the other configuration information required to set up an IoT node red application.
I forgot to mention, the copy/paste method loses information; you get no tab level metadata. The only way to get all the flow stuff is to pull if from the nodered flow record.
Node-RED will release a new version in a couple of days that will introduce projects, so you'll be able to use GitHub and all the usual tools to handle your app: https://twitter.com/NodeRED/status/956934949784956931 and https://nodered.org/docs/user-guide/projects/
While it doesn't address your short-term needs, I think it's the best long-term solution. Hopefully that helps.

Getting started for team development

I want to start developing with a team using a Neo4j DB, a Spring Boot backend and an AngularJS frontend.
For that, I want to have a Maven Repository and a Jenkins.
To enable my team to use this, I want to have some kind of server at home that can provide remote (sequred) access to the Maven Repo, the Jenkins and the Neo4j DB and that can host the AngularJS frontend communicating with the Spring Backend.
I don't really know where to start. After some googling I found a NAS, but I'm not sure if they suit my requirements.
I've found tutorials for configuring a VPN but there may be a simpler way.
What would you recommend?
So, after some more asking around and googling if found 2 possible solutions, that i want to try out in the future:
First of seems to be the NAS (I've only read about Synology), although it not seems to be intended for my requirements. However there are packages available in the DiskStation OS that allow the installation of a Jenkins, a Maven Repo and Docker, allowing to host a Neo4j DB. I was told, I should be cautious, because only the "x86 diskstation supports docker". At this point I'm not too sure what this means, but since I'm posting an answer, I don't want to keep this knowledge for myself.
I didn't really find anything on hosting applications.
Second solution seems to be, to build a homeserver. In my current understanding, it should suffice to have a spare PC at home for that. All the steps involved should be available under here (german).
I didn't find anything about hosting applications here too, but since this is a "real" system, I'm pretty sure it's possible.
I'm going to try the second one out and keep you updated as far as I don't forget it :)

Search Engine for MongoDB ?

i'm using mongodb to store data.
But to search I prefer to use elasticsearch or similar. But i didn't found solution.
Because I read some problems and issues with RIVER .
What's your experience and recommendations ?
I'm using elasticsearch with mongodb. I tried Solr but I didnt have the integration. The two tools are using the lucene so has "approximately" the same query syntax.
There are some tutorial, but it didnt work for me. I believe the reason is that the github doesnt allow now to upload and download binary files. So, we can not use the ./plugin command. To overcome this problem you have to git clone the repositories and make the .jar files on your own. To do that you have to use apache maven and make mvn package to create the packages.
Add both river and Mapper Attachments to elasticsearch. And make sure that you follow the compatible versions according to the river version table.
After that everything will working file.

Integrating eclipse with db2

I was doing a project related to the IBM competition and need to create a web application. I have done a web application before by connecting netbeans and mysql. But, now am facing problem right from installation.
Is there any workbench(like something for mysql) for db2 . If so can anyone give a link. Also, I need to make jdbc connections. So, is there any other software I need to install.
Kindly explain to me in detail as I'm not pretty sure about this.
All you need is a DB2 JDBC JAR. Pick the appropriate one for your version and add it to your CLASSPATH.
You should use either a DB2 admin client to create tables and view data or something like SQL Squirrel.

Discovering sqlserver installed on the machine

I'm going to deploy an application click once and wondered what the best technique for dealing with the database, since the click once install sqlserver to me I was wondering how I determine the sqlserver installed so that when the application is first run, see it and create the sqlserver database.
I would not use the windows install to distribute this application because it will have multiple versions of update, and would be easier with clickonce.
Which flavor of SQLServer are you using? Here's some helpful information.
If it is SQLServer Express, you need to add the database to your project and set the build action to 'content' and set 'copy to output directory' to 'copy if newer'. This will ensure the database is included in the deployment.
Next, go into the prerequisites dialog and select SQLServer Express. When the user runs the setup.exe, it will check and see if it is installed, and if not, will install it.
If you want the newest version of SQLServer Express, you can find how to create a bootstrapper package here -- Microsoft doesn't provide one, but this article provides the XML you need and provides links to the SQLServer Express downloads.
If you are using SQLCE, you need to attach the database (*.sdf) to your project and set the properties as noted above. However, you do not need to publish this as a prerequisite, you can just include the dll's in your project as noted here.
When your publish a new version, if the database has changed, ClickOnce will put the new database in the DataDirectory and put the old one in the \pre subfolder of the DataDirectory, and you have to write code to handle that. This sounds appealing, but I think it's dangerous. If you even so much as open your database to look at the structure, it will change the date/time stamp, and ClickOnce will think it's new and publish it, and you will get calls from your customer about their data missing, unless you handle this.
So I usually recommend you copy the database to LocalApplicationData when the user first installs your application, and handle any updates to the structure programmatically after that. There is an article about how to do that here.