Defined Type: graphdb::plugin

Defined in:
manifests/plugin.pp

Summary

This define allows you to install GraphDB plugin from given source

Overview

Parameters:

  • ensure (Graphdb::Ensure) (defaults to: $graphdb::ensure)

    String. Controls if the managed resources shall be present or absent. If set to absent:

    • The managed plugin is being uninstalled.

    • Any traces of installation will be purged as good as possible. This may include existing configuration files. The exact behavior is provider dependent. Q.v.:

    • System modifications (if any) will be reverted as good as possible (e.g. removal of created users, services, changed log settings, …).

    • This is thus destructive and should be used with care.

    Defaults to present.

  • instance (String)

    GraphDB instance to install plugin on.

  • source (Optional[String]) (defaults to: undef)

    The source of GraphDB plugin.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'manifests/plugin.pp', line 23

define graphdb::plugin (
  String            $instance,
  Graphdb::Ensure   $ensure = $graphdb::ensure,
  Optional[String]  $source = undef,
) {
  require graphdb

  $instance_plugins_dir = "${graphdb::data_dir}/${instance}/plugins"

  $plugin_file_name = basename($source)

  file { "${instance_plugins_dir}/${plugin_file_name}":
    ensure => $ensure,
    source => $source,
  }
  ~> exec { "unpack-graphdb-plugin-${title}":
    command     => "rm -rf ${instance_plugins_dir}/${title} && \
                    unzip ${instance_plugins_dir}/${plugin_file_name} -d ${instance_plugins_dir} && \
                    chown -R ${graphdb::graphdb_user}:${graphdb::graphdb_group} ${instance_plugins_dir}/${title}",
    refreshonly => true,
    require     => Package['unzip'],
    notify      => Service["graphdb-${instance}"],
  }
}