Compare commits

...

3 Commits
master ... wmde

  1. 3
      data/common.yaml
  2. 20
      data/os/Debian.yaml
  3. 8
      manifests/init.pp
  4. 68
      templates/config.php.erb

3
data/common.yaml

@ -1,11 +1,12 @@
---
limesurvey::dbhost: 'localhost'
limesurvey::download_url: 'https://github.com/LimeSurvey/LimeSurvey/archive/'
limesurvey::version: '2.57.0+161202'
limesurvey::version: '3.23.0+200813'
limesurvey::install_path: '/opt/limesurvey'
limesurvey::manage_database: true
limesurvey::manage_webserver: true
limesurvey::manage_php: true
limesurvey::manage_config: false
limesurvey::mpm_module: 'prefork'
limesurvey::runtime_dir_mode: '0766'
limesurvey::vhost_name: 'limesurvey'

20
data/os/Debian.yaml

@ -2,17 +2,23 @@
limesurvey::www_group: 'www-data'
limesurvey::www_user: 'www-data'
limesurvey::php_packages:
php5:
php:
ensure: present
php5-mcrypt:
php-simplexml:
ensure: present
php5-gd:
# php-mcrypt:
#ensure: present
php-gd:
ensure: present
php5-ldap:
php-mbstring:
ensure: present
php5-mysql:
php-zip:
ensure: present
php5-imap:
php-ldap:
ensure: present
libapache2-mod-php5:
php-mysql:
ensure: present
php-imap:
ensure: present
libapache2-mod-php:
ensure: present

8
manifests/init.pp

@ -72,6 +72,7 @@ class limesurvey (
Boolean $manage_database,
Boolean $manage_webserver,
Boolean $manage_php,
Boolean $manage_config,
Optional[String] $dbuser = undef,
Optional[String] $sql_root_password = undef,
@ -105,4 +106,11 @@ class limesurvey (
contain $php_class
}
if $manage_config {
file {"/opt/limesurvey/application/config/config.php":
ensure => file,
content => template("limesurvey/config.php.erb"),
}
}
}

68
templates/config.php.erb

@ -0,0 +1,68 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| 'connectionString' Hostname, database, port and database type for
| the connection. Driver example: mysql. Currently supported:
| mysql, pgsql, mssql, sqlite, oci
| 'username' The username used to connect to the database
| 'password' The password used to connect to the database
| 'tablePrefix' You can add an optional prefix, which will be added
| to the table name when using the Active Record class
|
*/
return array(
'components' => array(
'db' => array(
'connectionString' => 'mysql:host=<%= @dbhost %>;port=3306;dbname=<%= @dbname %>;',
'emulatePrepare' => true,
'username' => '<%= @dbuser %>',
'password' => '<%= @dbpassword %>',
'charset' => 'utf8mb4',
'tablePrefix' => 'lime_',
),
'session' => array (
'sessionName'=>'LS-MRHASTXFBAQZMYWI'
// Uncomment the following lines if you need table-based sessions.
// Note: Table-based sessions are currently not supported on MSSQL server.
// 'class' => 'application.core.web.DbHttpSession',
// 'connectionID' => 'db',
// 'sessionTableName' => '{{sessions}}',
),
'urlManager' => array(
'urlFormat' => 'path',
'rules' => array(
// You can add your own rules here
),
'showScriptName' => true,
),
),
// For security issue : it's better to set runtimePath out of web access
// Directory must be readable and writable by the webuser
// 'runtimePath'=>'/var/limesurvey/runtime/'
// Use the following config variable to set modified optional settings copied from config-defaults.php
'config'=>array(
// debug: Set this to 1 if you are looking for errors. If you still get no errors after enabling this
// then please check your error-logs - either in your hosting provider admin panel or in some /logs directory
// on your webspace.
// LimeSurvey developers: Set this to 2 to additionally display STRICT PHP error messages and get full access to standard templates
'debug'=>0,
'debugsql'=>0, // Set this to 1 to enanble sql logging, only active when debug = 2
// Update default LimeSurvey config here
)
);
/* End of file config.php */
/* Location: ./application/config/config.php */
Loading…
Cancel
Save