Compare commits

...

7 Commits

Author SHA1 Message Date
Markus Opolka 99dfa449b4 Merge branch 'fix_url' 2016-12-07 09:44:38 +01:00
Markus Opolka 4530cc6252 Update version 2016-12-07 09:44:24 +01:00
Markus Opolka 30835b82f2 Set fixed beaker Gem
to ensure older Ruby version are running
2016-12-07 09:35:27 +01:00
Markus Opolka 71fd2c5ef3 Fix LimeSurvey tarball URL
They keep changing it... also streamlined tar extraction and folder creation
2016-12-07 09:30:55 +01:00
Markus Opolka 3454de6d47 Change download URL to GitHub so it won't change all the time 2016-09-21 14:45:23 +02:00
Markus Opolka cabab82dff Update metadate for v0.1.1 2016-09-13 15:20:16 +02:00
Markus Opolka 447b5e8c40 Add default variable assignment for optional Variables 2016-09-13 14:03:06 +02:00
7 changed files with 62 additions and 47 deletions

View File

@ -4,9 +4,6 @@ fixtures:
stdlib:
ref: "4.12.0"
repo: "https://github.com/puppetlabs/puppetlabs-stdlib"
archive:
ref: "v1.1.1"
repo: "https://github.com/voxpupuli/puppet-archive"
mysql:
ref: "3.8.0"
repo: "http://github.com/puppetlabs/puppetlabs-mysql"

View File

@ -8,6 +8,6 @@ gem 'rspec-puppet', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rake', :require => false
# beaker related gems
gem 'beaker-rspec', :require => false
gem 'beaker-rspec', '5.6.0'
gem 'serverspec', :require => false
gem 'specinfra', :require => false

View File

@ -1,9 +1,8 @@
---
limesurvey::archive_path: '/tmp/limesurvey.tar.gz'
limesurvey::dir_name: 'limesurvey'
limesurvey::dbhost: 'localhost'
limesurvey::download_url: 'https://www.limesurvey.org/stable-release?download=1853:limesurvey2514%20160908targz'
limesurvey::extract_path: '/opt/'
limesurvey::download_url: 'https://github.com/LimeSurvey/LimeSurvey/archive/'
limesurvey::version: '2.57.0+161202'
limesurvey::install_path: '/opt/limesurvey'
limesurvey::manage_database: true
limesurvey::manage_webserver: true
limesurvey::manage_php: true

View File

@ -6,9 +6,6 @@
# Parameters
# ----------
#
# * `sample parameter`
# Explanation of what this parameter affects and what it defaults to.
#
# Examples
# --------
#
@ -28,9 +25,8 @@
#
class limesurvey::extract (
String $archive_path = $limesurvey::archive_path,
String $download_url = $limesurvey::download_url,
String $extract_path = $limesurvey::extract_path,
String $version = $limesurvey::version,
String $install_path = $limesurvey::install_path,
String $runtime_dir_mode = $limesurvey::runtime_dir_mode,
String $www_group = $limesurvey::www_group,
@ -44,21 +40,32 @@ class limesurvey::extract (
group => $www_group,
}
archive { $archive_path:
ensure => present,
extract => true,
extract_path => $extract_path,
source => $download_url,
creates => "${install_path}/tmp",
user => $www_user,
group => $www_group,
require => File[$install_path],
exec { 'limesurvey-download':
path => '/bin:/usr/bin',
creates => "${install_path}/tmp/runtime",
command => "bash -c 'cd /tmp; wget ${download_url}${version}.tar.gz'",
require => File[$install_path],
user => $www_user,
}
exec { 'limesurvey-unzip':
path => '/bin:/usr/bin',
cwd => '/tmp',
creates => "${install_path}/tmp/runtime",
command => "bash -c 'cd /tmp; tar zxf /tmp/${version}.tar.gz -C ${install_path} --strip-components=1'",
require => Exec['limesurvey-download'],
user => $www_user,
}
file { "/tmp/${version}.tar.gz":
ensure => absent,
require => Exec['limesurvey-unzip'],
}
file { "${install_path}/tmp/runtime/":
ensure => directory,
mode => $runtime_dir_mode,
require => File[$install_path],
require => Exec['limesurvey-unzip'],
}
}

View File

@ -7,21 +7,14 @@
# Parameters
# ----------
#
# * `archive_path`
# Name of path to extract to
#
# * `dir_name`
# Name of directory to extract to
#
# * `install_path`
# Combination of archive_path and dir_name
#
# * `download_url`
# Where to download the limesurey code from.
# Note: They seem to change that quite often. Be aware.
#
# * `extract_path`
# Target folder path to extract archive
# * `version`
# What version to download.
#
# * `runtime_dir_mode`
# Mode of the limesurey runtime directory. Default is 0766,
@ -69,10 +62,9 @@
#
class limesurvey (
String $archive_path,
String $dir_name,
String $install_path,
String $download_url,
String $extract_path,
String $version,
String $runtime_dir_mode,
String $www_group,
String $www_user,
@ -81,21 +73,20 @@ class limesurvey (
Boolean $manage_webserver,
Boolean $manage_php,
Optional[String] $dbhost,
Optional[String] $dbname,
Optional[String] $dbpassword,
Optional[String] $dbuser,
Optional[String] $sql_root_password,
Optional[String] $vhost_name,
Optional[String] $vhost_port,
Optional[String] $mpm_module,
Optional[Hash] $php_packages,
Optional[String] $dbuser = undef,
Optional[String] $sql_root_password = undef,
Optional[String] $vhost_name = undef,
Optional[String] $vhost_port = undef,
Optional[String] $mpm_module = undef,
Optional[Hash] $php_packages = undef,
Optional[String] $dbhost = undef,
Optional[String] $dbname = undef,
Optional[String] $dbpassword = undef,
String $database_class = 'limesurvey::database',
String $webserver_class = 'limesurvey::webserver',
String $php_class = 'limesurvey::php',
String $install_path = "${extract_path}${dir_name}",
String $vhost_docroot = $install_path,
) {

View File

@ -1,6 +1,6 @@
{
"name": "martialblog-limesurvey",
"version": "0.1.0",
"version": "0.1.3",
"author": "martialblog",
"summary": "Installation and Configuration of Limesurvey",
"license": "Apache-2.0",
@ -9,7 +9,6 @@
"issues_url": "https://github.com/martialblog/puppet-limesurvey/issues",
"dependencies": [
{"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"},
{"name":"puppet-archive","version_requirement":">= 1.1.1"},
{"name":"puppetlabs-concat","version_requirement":">= 2.2.0"},
{"name":"puppetlabs-apache","version_requirement":">= 1.10.0"},
{"name":"puppetlabs-mysql","version_requirement":">= 3.8.0"}

View File

@ -0,0 +1,22 @@
require 'spec_helper_acceptance'
describe 'limesurvey' do
context 'apply without manage_' do
it 'should idempotently run' do
pp = <<-EOS
class { 'limesurvey':
www_user => 'www-data',
www_group => 'www-data',
manage_webserver => false,
manage_database => false,
manage_php => false,
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
end