Puppet Class: ckan::params

Inherited by:
ckan
Defined in:
manifests/params.pp

Summary

The os specific parameters for ckan installs.

Overview

GPL-3.0+



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'manifests/params.pp', line 5

class ckan::params {

  # variables
  # due to issue, have to supply https://github.com/ckan/ckan/issues/2110
  # our own license file
  # additional variables imported from config
  $ckan_etc       = '/etc/ckan'
  $ckan_default   = "${ckan_etc}/default"
  $ckan_src       = '/usr/lib/ckan/default/src/ckan'
  $ckan_lang_dir  = "${ckan_src}/ckan/i18n"
  $ckan_lang_base = "${ckan_src}/ckan/public/base/i18n"
  $ckan_ext       = '/usr/lib/ckan/default/src'
  $ckan_img_dir   = "${ckan_src}/ckan/public/base/images"
  $ckan_css_dir   = "${ckan_src}/ckan/public/base/css"
  $license_file   = 'license.json'
  $ckan_conf      = "${ckan_default}/production.ini"
  $paster         = '/usr/lib/ckan/default/bin/paster'

  # used for setting jts for spatial search
  $jts_base_url = 'https://repo1.maven.org/maven2/com/vividsolutions/jts'
  $jts_1_13     = "${jts_base_url}/1.13/jts-1.13.jar"
  $jts_1_12     = "${jts_base_url}/1.12/jts-1.12.jar"
  $jts_url      = $jts_1_13

  # OS Specific configuration
  case $::osfamily {
    'redhat': {
      $required_packages = ['epel-release',
                            'httpd',
                            'mod-wsgi',
                            'nginx',
                            'libpqxx-devel',
                            'python-paste-script',
                            'expect',
                            'redis',
                            'wget']
      # wsgi specific configuration
      $wsgi_command  = '/usr/sbin/a2enmod wsgi'
      $wsgi_creates  = '/etc/httpd/mods-enabled/wsgi.conf'
      $apache_server = 'httpd'
    }

    'debian':{
      $required_packages = [ 'libpq5',
                            'python-pastescript',
                            'python-future',
                            'expect',
                            'python-dev',
                            'python',
                            'python-pip',
                            'python-virtualenv',
                            'libpq-dev',
                            'git-core',
                            'software-properties-common',
                            'build-essential',
                            'libxslt1-dev',
                            'libxml2-dev',
                            'libffi-dev',
                            'redis-server',
                            'wget']

      # wsgi specific configuration
      $wsgi_command   = '/usr/sbin/a2enmod wsgi'
      $wsgi_creates   = '/etc/apache2/mods-enabled/wsgi.conf'
      $apache_service = 'apache2'
    }

    default: {
      fail("Unsupported OS ${::osfamily}.  Please use a debian or redhat based system")
    }
  }

  # path to the activate & run command command
  $activate_exec = '/usr/local/bin/ckan_activate_exec.bash'

  # Ubuntu specific
  if $::operatingsystem == 'Ubuntu' {
    case $::lsbdistrelease {
      '12.04': {
        $python             = '/usr/lib/ckan/default/bin/python'
        $pip                = '/usr/bin/pip'
        $postgresql_version = '9.3'
        $postgis_version    = '2.0'
      }
      '14.04': {
        $python             = '/usr/lib/ckan/default/bin/python'
        $pip                = '/usr/lib/ckan/default/bin/pip'
        $postgresql_version = '9.6'
        $postgis_version    = '2.4'
      }
      '16.04': {
        $python             = '/usr/lib/ckan/default/bin/python'
        $pip                = '/usr/lib/ckan/default/bin/pip'
        $postgresql_version = '9.6'
        $postgis_version    = '2.4'
      }
      '18.04': {
        $python             = '/usr/bin/python'
        $pip                = '/usr/bin/pip'
        $postgresql_version = '9.6'
        $postgis_version    = '2.4'
      }
      default: {
        $python             = '/usr/lib/ckan/default/bin/python'
        $pip                = '/usr/lib/ckan/default/bin/pip'
        $postgresql_version = '9.6'
        $postgis_version    = '2.4'
      }
    }
  }else {
    $python             = '/usr/lib/ckan/default/bin/python'
    $pip                = '/usr/bin/pip'
    $postgresql_version = '9.4'
    $postgis_version    = '2.2'
  }
}