ckan

Puppet module for deploying CKAN

27,766 downloads

538 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 6.2.9 (latest)
  • 6.1.13
  • 6.1.11
  • 6.1.10
  • 6.1.9
  • 6.1.3
  • 6.1.1
  • 6.1.0
  • 3.1.0
  • 3.0.2
  • 3.0.1
  • 2.7.9
  • 2.7.8 (deleted)
  • 2.7.6
  • 2.7.5
  • 2.7.4
  • 2.7.2
  • 2.7.1
  • 2.6.10
  • 2.6.8
  • 2.6.5
  • 2.4.1
  • 2.4.0
  • 2.3.2
  • 2.3.1
  • 2.2.2
  • 2.2.1
  • 2.2.0
  • 2.1.15
  • 2.1.14
  • 2.1.9
  • 2.1.7
  • 2.1.6
  • 2.1.4
  • 2.1.2
  • 2.0.1
  • 1.0.13
released Sep 25th 2018
This version is compatible with:

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'landcareresearch-ckan', '2.7.6'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add landcareresearch-ckan
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install landcareresearch-ckan --version 2.7.6

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

landcareresearch/ckan — version 2.7.6 Sep 25th 2018

Reference

Classes

Defined types

  • ckan::ext: A type which can be used to install a CKAN extension in the default location.
  • ckan::lang: Manages installing a non default language.

Classes

ckan

Install Details: http://docs.ckan.org/en/ckan-2.0/install-from-package.html

Additional features:

  • Database can be backed up to <backup_dir>/ckan_database.pg_dump determined by the frequency selected.

COPYRIGHT

GPL-3.0+

Examples

Default Setup
class { 'ckan':
  site_url              => 'test.ckan.com',
  site_title            => 'CKAN Test',
  site_description      => 'A shared environment for managing Data.',
  site_intro            => 'A CKAN test installation',
  site_about            => 'Pilot data catalogue and repository.',
  plugins               =>
   text_preview recline_preview datastore resource_proxy pdf_preview',
  is_ckan_from_repo     => 'false',
  ckan_package_url      =>
   'http://packaging.ckan.org/python-ckan_2.1_amd64.deb',
  ckan_package_filename => 'python-ckan_2.1_amd64.deb',
}

Parameters

The following parameters are available in the ckan class.

site_url

Data type: String

The url for the ckan site.

Default value: 'localhost'

site_title

Data type: String

The title of the web site.

Default value: 'localhost'

site_description

Data type: Optional[String]

The description (found in header) of the web site.

Default value: undef

site_intro

Data type: Optional[String]

The introduction on the landing page.

Default value: undef

site_about

Data type: Optional[String]

Information on the about page.

Default value: undef

plugins

Data type: Optional[Array[String]]

Contains the ckan plugins to be used by the installation. Do not include the following plugins as they are defaults and are already included. DO NOT INCLUDE: ['stats','text_view','image_view','recline_view'] @example plugins => ['text_preview','datastore','resource_proxy', 'datapusher']

Default value: undef

app_instance_id

Data type: Optional[String]

The secret password for the app instance . To generate a config file that contains a new password, run the following command: @example 'paster make-config ckan /etc/ckan/default/dev.ini'

Default value: undef

beaker_secret

Data type: Optional[String]

The secret password for beaker. To generate a config file that contains a new password, run the following command. @example 'paster make-config ckan /etc/ckan/default/dev.ini'

Default value: undef

site_logo

Data type: Optional[String]

The source of the logo. Should be specified as puppet:////.png Requires the png file extension.

Default value: undef

license

Data type: String

The source to the json license file. Should be specified as puppet://// and maintained by your module

Default value: 'puppet:///modules/ckan/license.json'

ckan_version

Data type: Optional[String]

Helps identify settings and configuration necessary between the different version of ckan. Valid formats:

  • '2.2'
  • '2.3'
  • eq: 'x.y'

Note, ckan_package_url & ckan_package_filename are not set, than the ckan version will use the package url from ckan.org and the appropriate name.

Default value: undef

is_ckan_from_repo

Data type: Boolean

A boolean to indicate if the ckan package should be installed through an already configured repository setup outside of this module. If using Ubuntu/Deb should be able to do "apt-get install python-ckan" Its the same idea for yum and other package managers.

Default value: false

ckan_package_url

Data type: Optional[String]

If not using a repo, then this url needs to be specified with the location to download the package. Note, this is using dpkg so deb/ubuntu only.

Default value: undef

ckan_package_filename

Data type: Optional[String]

The filename of the ckan package.

Default value: undef

custom_css

Data type: String

The source to a css file used for the ckan site. This replaces the default main.css. Should be specified as puppet://// and maintained by your module. Images used in the custom css should be set in custom_imgs.

Default value: 'main.css'

custom_imgs

Data type: Optional[Array[String]]

An array of source for the images to be used by the css. Should be specified as ['puppet:////','...']

Default value: undef

recaptcha_version

Data type: String

The version of recaptcha. Valid options:

  • 1 Older style with a red box. The user enters text
  • 2 Newer style that the user clicks on a checkbox (cleaner).

@see recaptcha-version

Default value: '2'

recaptcha_publickey

Data type: Optional[String]

The public key for recaptcha. @see ckan-recaptcha-publickey

Default value: undef

recaptcha_privatekey

Data type: Optional[String]

The private key for recaptcha. @see recaptcha-privatekey

Default value: undef

max_resource_size

Data type: String

The maximum in megabytes a resource upload can be. @see max-resource-size

Default value: '100'

max_image_size

Data type: String

The maximum in megabytes an image upload can be. @see max-image-size

Default value: '10'

max_file_size

Data type: String

This sets the upper file size limit for in-line previews. @see resource-proxy-max-file-size

Default value: '1048576'

datapusher_formats

Data type: String

File formats that will be pushed to the DataStore by the DataPusher. When adding or editing a resource which links to a file in one of these formats, the DataPusher will automatically try to import its contents to the DataStore.

Default value: 'csv xls application/csv application/vnd.ms-excel'

default_views

Data type: Array[String]

Defines the resource views that should be created by default when creating or updating a dataset. From this list only the views that are relevant to a particular resource format will be created. This is determined by each individual view.

Default value: ['image_view','recline_view']

text_formats

Data type: String

Formats used for the text preview. @see http://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-preview-text-formats

Default value: 'text plain text/plain'

json_formats

Data type: String

JSON based resource formats that will be rendered by the Text view plugin @see http://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-preview-json-formats

Default value: 'json'

xml_formats

Data type: String

XML based resource formats that will be rendered by the Text view plugin @see http://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-preview-xml-formats

Default value: 'xml rdf rss'

image_formats

Data type: String

Space-delimited list of image-based resource formats that will be rendered by the Image view plugin @see http://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-preview-image-formats

Default value: 'png jpeg jpg gif'

postgres_pass

Data type: String

The password for the postgres user of the database (admin user).

Default value: 'pass'

ckan_pass

Data type: String

The password for the ckan user of the database.

Default value: 'pass'

pg_hba_conf_defaults

Data type: Boolean

True if use the default hbas and false to configure your own. This module uses postgresql so this setting informs the postgresql module that the hba's should be handled outside of this module. Requires your own hba configuration.

Default value: true

pg_hba_rules

Data type: Optional[Hash]

This is a hash which uses create_resources to create the hba rules. Optional. The hba rules can also be defined outside of this class.

Default value: undef

postgis_version

Data type: String

The version of postgis to use.

  • '2.1' uses postgresql 9.4
  • '2.2' uses postgresql 9.5
  • '2.3' uses postgresql 9.6
  • '2.4' uses postgresql 9.6
  • '2.5' uses postgresql 10

Default value: $ckan::params::postgis_version

install_ckanapi

Data type: Boolean

Installs the ckan api if set to true. Also installs a helper script in /usr/bin/ckan/ckanapi.bash which launches ckanapi with the environment setup.

@see https://github.com/ckan/ckanapi

Default value: false

enable_backup

Data type: Boolean

Backs up the database to /backup/ckan_database.pg_dump.

Default value: true

backup_daily

Data type: Boolean

If backups enabled, sets backups to either daily (true) or weekly (false).

Default value: true

backup_dir

Data type: String

The location where backups are stored.

Default value: '/backup'

solr_url

Data type: String

The base url for downloading solr.

Default value: 'http://archive.apache.org/dist/lucene/solr'

solr_version

Data type: String

The version of solr to install.

Default value: '5.5.3'

solr_schema_version

Data type: String

The version of the solr schema to use. Valid options:

  • '1.2'
  • '1.3'
  • '1.4'
  • '2.0'
  • 'spatial' - configures solar with the spatial extensions. Only supports bounding box.
  • 'spatial-ext' - configures solar with the extended spatial extension. This allows for bounding box, point, and Polygon.
  • 'default'

The options correspond to the following structure:

/usr/lib/ckan/default/src/ckan/ckan/config/solr/schema-<solr_schema_version>

The only exception is default which means schema.xml (required as of ckan 2.3).

Default value: 'default'

solr_jts_url

Data type: String

The url to be used to download the jts library for solr spatial ext. Only used if spatial-ext option is set.

Default value: $ckan::params::jts_url

locale_default

Data type: String

Use this to specify the locale (language of the text) displayed in the CKAN Web UI.

Default value: 'en'

i18n_directory

Data type: Optional[String]

By default, the locales are searched for in the ckan/i18n directory. Use this option if you want to use another folder.

Default value: undef

ckan_storage_path

Data type: String

The location where files will be stored for the file store. Note, this module handles creating the directory; however, ensure the path leading up to the directory has already been created.

Default value: '/var/lib/ckan/default'

display_timezone

Data type: String

By default, all datetimes are considered to be in the UTC timezone. Use this option to change the displayed dates on the frontend. Internally, the dates are always saved as UTC. This option only changes the way the dates are displayed. The valid values for this options can be found at pytz Available from CKAN 2.5+ (has no effect on previous versions).

Default value: 'UTC'

feeds_author_name

Data type: String

This controls the feed author’s name. If unspecified, it’ll use ckan.site_id. @see feeds-author-name

Default value: ''

feeds_author_link

Data type: String

This controls the feed author’s link. If unspecified, it’ll use ckan.site_url. @see feeds-author-link

Default value: ''

feeds_authority_name

Data type: String

The domain name or email address of the default publisher of the feeds and elements. If unspecified, it’ll use ckan.site_url. @see feeds-authority-name

Default value: ''

feeds_date

Data type: String

A string representing the default date on which the authority_name is owned by the publisher of the feed. @see feeds-date

Default value: ''

smtp_server

Data type: Optional[String]

The SMTP server to connect to when sending emails with optional port. The format is : @example: smtp.example.com:587 @see smtp-server

Default value: undef

smtp_starttls

Data type: Optional[String]

Whether or not to use STARTTLS when connecting to the SMTP server. @see smtp-starttls

Default value: undef

smtp_user

Data type: Optional[String]

The username used to authenticate with the SMTP server. Example: username@example.com @see smtp-user

Default value: undef

smtp_password

Data type: Optional[String]

The password used to authenticate with the SMTP server. @see smtp-password

Default value: undef

smtp_mail_from

Data type: Optional[String]

The email address that emails sent by CKAN will come from. Note that, if left blank, the SMTP server may insert its own. Example: ckan@example.com @see smtp-mail-from

Default value: undef

email_errors_to

Data type: Optional[String]

An e-mail address to send any error reports to. Example: errors@example.com @see email-errors-to

Default value: undef

email_errors_from

Data type: Optional[String]

The from e-mail address to use when sending any error reports. Example: ckan-errors@example.com @see email-errors-from

Default value: undef

roles_cascade

Data type: Optional[String]

Makes role permissions apply to all the groups down the hierarchy from the groups that the role is applied to. @see roles-cascade

Default value: undef

featured_orgs

Data type: Optional[String]

Defines a list of organization names or ids. Example: 'org_one' @see featured-orgs

Default value: undef

featured_groups

Data type: Optional[String]

Defines a list of group names or group ids. Example: 'group_one' @see featured-groups

Default value: undef

activity_streams_enabled

Data type: Boolean

Turns on and off the activity streams used to track changes on datasets, groups, users, etc @see activity-streams-enabled

Default value: true

activity_streams_email_notifications

Data type: Boolean

Turns on and off the activity streams’ email notifications. @see activity-streams-email-notifications

Default value: false

tracking_enabled

Data type: Boolean

This controls if CKAN will track the site usage. @see tracking-enabled

Default value: false

use_ssl

Data type: Boolean

Enable SSL for the site.

Default value: false

use_google_verification

Data type: Boolean

Enable google verification in the nginx configuration.

Default value: false

use_nagios

Data type: Boolean

Use a /nagios.txt in the nginx configuration file.

Default value: false

google_verification_string

Data type: Optional[String]

The google verification string.

Default value: undef

ssl_cert_path

Data type: Optional[String]

The path to the ssl certificate for nginx.

Default value: undef

ssl_key_path

Data type: Optional[String]

The path to the ssl key for nginx.

Default value: undef

ckan::ext::archiver

Installs the archiver extension.

Parameters

The following parameters are available in the ckan::ext::archiver class.

ckan_conf

Data type: String

Default value: $ckan::params::ckan_conf

paster

Data type: String

Default value: $ckan::params::paster

ckan::ext::dcat

Note, requires the harvest extension.

Parameters

The following parameters are available in the ckan::ext::dcat class.

revision

Data type: String

The version of dcat to install from github. Can be a git branch or git label.

Default value: 'v0.0.7'

ckan::ext::galleries

This extension allows storing and referencing image and video assets.

This extension does not install properly on Ubuntu 12.04.

ckan::ext::geoview

Requirements:

In order for this module to update the default_views parameter, it MUST be declared before the ckan module in the manifests. This will allow all of the variables to be evaulated.

Also, ensure that resource_proxy plugin has been enabled.

Parameters

The following parameters are available in the ckan::ext::geoview class.

openlayers_viewer_enable

Data type: Boolean

Default value: true

openlayers_formats

Data type: String

A string seperated by spaces. Available formats

  • Web Map Service (WMS) wms
  • Web Feature Service (WFS) wfs
  • GeoJSON geojson
  • GML gml
  • KML kml
  • ArcGIS REST API arcgis_rest
  • Google Fusion Tables gft (requires google_api_key)

Default value: 'wms geojson'

openlayers_hide_overlays

Data type: Boolean

Overlays won't be visible by default (only the base layer)

Default value: false

openlayers_hoveron

Data type: Boolean

The feature data popup will be displayed when hovering on.

Default value: true

openlayers_google_api_key

Data type: Optional[String]

The google api key required to render google fusion table resources. @see https://developers.google.com/fusiontables/docs/v1/using#APIKey

Default value: undef

leaflet_geojson_viewer_enable

Data type: Boolean

Default value: true

leaflet_wmts_viewer_enable

Data type: Boolean

Default value: true

ckan::ext::googleanalytics

Sends tracking data to Google Analytics and retrieves statistics from Google Analytics and inserts them into CKAN pages.

You should enable the "googleanalytics" plugin to use this extension.

Parameters

The following parameters are available in the ckan::ext::googleanalytics class.

id

Data type: String

The Google Analytics tracking ID (usually of the form UA-XXXXXX-X).

account

Data type: String

The account name @example example.com @see https://www.google.com/analytics).

username

Data type: String

Google Analytics username.

password

Data type: String

Google Analytics password.

track_events

Data type: Boolean

Adds Google Analystics Event tracking.

Default value: false

revision

Data type: String

The revision (or version) of the source to checkout with git.

Default value: 'master'

ckan::ext::harvest

Installs the harvest extension.

Parameters

The following parameters are available in the ckan::ext::harvest class.

revision

Data type: String

The revision to use (a git label or git branch).

Default value: 'v1.1.1'

ckan_conf

Data type: String

Default value: $ckan::params::ckan_conf

paster

Data type: String

Default value: $ckan::params::paster

cron_job

Data type: String

Sets the ensure state of the cron job. Options: the standard options for the ensure parameter.

Default value: 'present'

cron_interval

Data type: String

The minute that cron will run (so will run every hour at the specified minute).

Default value: '5'

cron_warning

Data type: String

Check if there is no previous long running harvester instance, if there is and has been running longer then $WARN seconds complain about it as it might be stuck.

Default value: '21600'

ckan::ext::hierarchy

This extension allows organizations to have parents, and displays them in a tree.

ckan::ext::lcrnz

Requirements:

Installs the following extensions.

  • ckan::ext::repeating
  • ckan::ext::ldap

The id can be found at the following url: http://<CKAN URL/api/action/organization_show?id=

Parameters

The following parameters are available in the ckan::ext::lcrnz class.

uri

Data type: String

The uri to the ldap server to connect. @example 'ldap://localhost:389'

base_dn

Data type: String

The ldap base dn to use for user authentication. @example 'ou=users,dc=landcareresearch,dc=co,dc=nz'

source

Data type: String

The source of the git repository for this extension.

Default value: 'http://github.com/okfn/ckanext-lcrnz'

revision

Data type: String

The revision (or version) of the source to checkout with git.

Default value: 'master'

organization_id

Data type: Optional[String]

If this is set, users that log in using LDAP will automatically get added to the given organization.

Default value: undef

ckan::ext::ldap

Installs the "ldap" extension.

Parameters

The following parameters are available in the ckan::ext::ldap class.

uri

Data type: String

The uri to the ldap server to connect. @example 'ldap://localhost:389'

base_dn

Data type: String

The ldap base dn to use for user authentication. @example 'ou=users,dc=landcareresearch,dc=co,dc=nz'

search_filter

Data type: String

The filter for searching through identities in ldap.

Default value: 'uid={login}'

username

Data type: String

The user name to use as a lookup.

Default value: 'uid'

email

Data type: String

The field that contains the user's email address.

Default value: 'mail'

fullname

Data type: String

The field that contains the user's full name.

Default value: 'cn'

organization_role

Data type: String

The role of the user when logged in through ldap.

Default value: 'member'

organization_id

Data type: Optional[String]

If this is set, users that log in using LDAP will automatically get added to the given organization.

To create the organisation specified in ckanext.ldap.organization.id use the paste command:

/etc/ckan/default/development.ini```

Default value: `undef`

### ckan::ext::officedocs

For this extension to work, the documents to be previewed must be accessible
to the wider internet, and will only work if you use a hostname, and not just
an IP address.

* **See also**
http://extensions.ckan.org/extension/officedocs/

#### Parameters

The following parameters are available in the `ckan::ext::officedocs` class.

##### `ckan_conf`

Data type: `String`



Default value: $ckan::params::ckan_conf

##### `paster`

Data type: `String`



Default value: $ckan::params::paster

### ckan::ext::pages

Installs the pages extension.

* **See also**
https://github.com/ckan/ckanext-pages

### ckan::ext::pdfview

If you want to enable pdf views of documents outside of
the ckan instance, you will need to enable resource_proxy plugin.

* **See also**
https://github.com/ckan/ckanext-pdfview

### ckan::ext::private_datasets

Only certain users will be able to see. When a dataset is being created,
it's possible to specify the list of users that can see this dataset.

* **See also**
https://github.com/conwetlab/ckanext-privatedatasets

#### Parameters

The following parameters are available in the `ckan::ext::private_datasets` class.

##### `show_acquire_url_on_create`

Data type: `Boolean`

To show the Acquire URL when the user is creating a dataset.

Default value: `false`

##### `show_acquire_url_on_edit`

Data type: `Boolean`

To show the Acquire URL when the user is editing a dataset

Default value: `false`

### ckan::ext::repeating

This extension provides a way to store repeating fields in CKAN datasets,
resources, organizations and groups.

* **See also**
https://github.com/open-data/ckanext-repeating

### ckan::ext::report

Installs the report extension.

* **See also**
https://github.com/datagovuk/ckanext-report

#### Parameters

The following parameters are available in the `ckan::ext::report` class.

##### `ckan_conf`

Data type: `String`



Default value: $ckan::params::ckan_conf

##### `paster`

Data type: `String`



Default value: $ckan::params::paster

### ckan::ext::showcase

Installs the showcase extension.

* **See also**
https://github.com/ckan/ckanext-showcase

### ckan::ext::spatial

Allows for the association of datasets with geographic locations, and
for searches across datasets to be restricted to a particular geographical
area. Additionally, it provides some support for previewing
geographical datasets.

* **See also**
http://docs.ckan.org/projects/ckanext-spatial/en/latest/

#### Parameters

The following parameters are available in the `ckan::ext::spatial` class.

##### `template`

Data type: `String`

The name the template that spatial will modify.
Note, this will overwrite the following files:

* templates/package/search.html
* templates/package/read_base.html

##### `map_provider`

Data type: `String`

Which map provider to use. Options:

* 'mapquest'
* 'openstreetmap'

Default value: 'mapquest'

##### `default_extent`

Data type: `Optional[String]`

Sets the default extent for the map.  Should be a string in the format:

'[[15.62, -139.21], [64.92, -61.87]]'


 or GeoJSON

'{ \"type\": \"Polygon\", \"coordinates\": [[[74.89, 29.39],[74.89, 38.45], [60.50, 38.45], [60.50, 29.39], [74.89, 29.39]]]}'


If undefined, will not set an extent.

Default value: `undef`

### ckan::ext::viewhelpers

Installs the viewhelpers extension.

* **See also**
https://github.com/ckan/ckanext-viewhelpers

### ckan::ext::zippreview

Installs the zippreview extension.

* **See also**
https://github.com/datagovau/ckanext-zippreview

### ckan::redis

There's too many redis modules in the forge to make a good assessment or to
enforce the use of any particular one of them for CKAN.  Enhancement
possibilities exist in making this optional in the harvest module
(e.g. supply your own).

#### Examples

##### include ckan::redis

```puppet

Defined types

ckan::ext

The ext directory classes utilize the ckan modularization framework known as extensions. To fully install the plugin, puppet needs to be run twice. The first time puppet runs, the extension won't be added to ckan due to how this module manages the plugins.

Parameters

The following parameters are available in the ckan::ext defined type.

extname

Data type: Optional[String]

The name of the extension. Defaults to $title.

Default value: undef

provider

Data type: String

The name of the VCS repository provider where the extension is hosted. Can be any provider supported by puppetlabs/vcsrepo. Defaults to 'git'.

Default value: 'git'

Optional[String]source

Data type: Optional[String]source The URL of the remote VCS repository. Defaults to "http://github.com/ckan/ckanext-$extname".

The URL of the remote VCS repository. Defaults to "http://github.com/ckan/ckanext-$extname".

revision

Data type: String

The revision of the VCS repository to check out and install.

Default value: 'stable'

plugin

Data type: Optional[Array[String]]

An array of strings that are plugins to add to the plugin configuration in the production.ini.

Default value: undef

views

Data type: Optional[Array[String]]

An array of string that are views to add to the view configuration in the production.ini.

Default value: undef

pip_requirements

Data type: String

The name of the requirements pip file to be installed. Only the name of the file which is found in the root directory of ext.

Default value: 'pip-requirements.txt'

user

Data type: Optional[String]

Uses the user's $HOME/.ssh setup

Default value: undef

source

Data type: Optional[String]

Default value: undef

ckan::lang

This class expects a zip file that has the contents of the language. The contents of the zip file should have the following:

  • LC_MESSAGES/ckan.mo
  • LC_MESSAGES/ckan.po

Parameters

The following parameters are available in the ckan::lang defined type.

url

Data type: Any

The url to the language build. The build is a zip file with a root directory.

language

Data type: Any

The language that is to be installed.

Default value: $title