Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Data sources plugin 4.1-1.0

Latest
Compare
Choose a tag to compare
@fanf fanf released this 06 Apr 16:51
· 18 commits to branches/rudder/4.1 since this release

Rudder data sources plugin for Rudder 4.1.0 and up

This is a release for Rudder 4.1.0 and up of the Rudder data sources plugin.

This plugin allows to automatically fetch external information from third party REST API and use them as node properties. Fetching data can be done periodically and/or on triggers (node accepted, policy generation started).

Documentation

Documentation on data sources can be find here: http://www.rudder-project.org/doc-4.1/node-properties-data-sources.html#node-properties-data-sources

Rudder 4.1.1 and up

As of Rudder 4.1.1, Rudder provides an enhance plugin format and the related management tool.

Build

The build is done with "make":

git clone https://github.com/Normation/rudder-plugin-datasources.git
cd rudder-plugin-datasources
git checkout 4.1-1.0
make
....
ar: creation of rudder-plugin-datasources-4.1-1.0.rpkg

Installation

Copy the package file rudder-plugin-datasources-4.1-1.0.rpkg to the server, then install it:

$ /opt/rudder/bin/rudder-pkg install-file /path/to/rudder-plugin-datasources-4.1-1.0.rpkg
...
Stopping Jetty: OK
Setting umask to 0007
Starting Jetty: . . . OK Thu Apr  6 15:46:32 UTC 2017

That's all! rudder-pkg tool takes care of the database configuration and to restart Rudder.

Rudder 4.1.0 and previous

Build

To build that package, you need a working installation of maven (version 3.3.x) and JDK 8 or up.

First, clone the repository and build the plugin:

git clone https://github.com/Normation/rudder-plugin-datasources.git
cd rudder-plugin-datasources
git checkout 4.1-1.0
mvn clean package
.......
  [INFO] Building jar: /home/fanf/java/workspaces/rudder-project/rudder-plugin-datasources/target/datasources-4.1-1.0-plugin-with-own-dependencies.jar

To proceed to installation, you will need that jar and file "src/main/resources/datasource-schema.sql".

Installation

Install the plugin by copying the jar in /opt/rudder/share/rudder-plugins/ on your Rudder root server and the file datasource-schema.sql, then execute:

# Copy the plugin in Rudder plugin directory
scp or whatever datasources-4.1-1.0-plugin-with-own-dependencies.jar into /opt/rudder/share/rudder-plugins/

# create table for Rudder data sources plugin:
# note that if you installed Rudder 4.1~alpha or 4.1~beta1, or a previous version
# of the plugin, you can skip that step (which would fail with a "table exists" error)
psql -U rudder -h localhost -d rudder -f /path/to/datasource-schema.sql

# declare plugin use 
#note: 
# - the plugin must be in /opt/rudder/share/rudder-plugins/
# - the command parameter is the file name without ".jar"
/opt/rudder/bin/rudder-plugin register datasources-4.1-1.0-plugin-with-own-dependencies
Rudder plugin handling utility.
INFO: Plugin found in /opt/rudder/share/rudder-plugins.
INFO: Registering plugin datasources-4.1-1.0-plugin-with-own-dependencies...

# then restart Rudder:
/etc/init.d/rudder-jetty restart

If everything is OK, you will see in Rudder log (/var/log/rudder/webapp/YYYY_MM_DD.stderrout.log) the following INFO line:

[2017-02-01 09:35:21] INFO  application - Initializing plugin 'data sources' [com.normation.plugins.datasources.DataSourcesPluginDef]
[2017-02-01 09:35:21] INFO  application.plugin - loading 'datasources' plugin

You should also see in Rudder administration screen, in the plugin list, data sources plugin and a new menu entry "Data sources".