Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #12 from tremblaysimon/useIgoRepoConfigfile
Browse files Browse the repository at this point in the history
Use igo repo configfile
  • Loading branch information
tremblaysimon committed Aug 4, 2015
2 parents 8711f04 + 260ee6e commit 3814e68
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 198 deletions.
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
sudo: false
language: ruby
script: "bundle exec rake lint"
matrix:
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.6
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
notifications:
email: false
18 changes: 18 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end

gem 'rake'
gem 'puppet-lint'

# vim:ft=ruby
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#IGO

#puppet-igo
[![Build Status](https://travis-ci.org/infra-geo-ouverte/puppet-igo.svg)](https://travis-ci.org/infra-geo-ouverte/puppet-igo)
####Table of Contents

1. [Overview - What is the IGO module?](#overview)
Expand Down
10 changes: 9 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.relative = true
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
84 changes: 36 additions & 48 deletions manifests/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,69 +17,57 @@
user => $appUser,
group => $appGroup
}
class { '::apache::mod::php':
class { '::apache::mod::php':
}
apache::vhost { 'igo':
vhost_name => '*',
port => '80',
docroot => $igoRootPath,
docroot_owner => $appUser,
docroot_group => $appGroup,
aliases => [
{ alias => '/pilotage',
path => "${igoAppPath}/pilotage/",
},
{ alias => '/navigateur/',
path => "${igoAppPath}/interfaces/navigateur/",
},
{ alias => '/api/',
path => "${igoAppPath}/interfaces/navigateur/api/",
},
],
directories => [
vhost_name => '*',
port => '80',
docroot => $igoRootPath,
docroot_owner => $appUser,
docroot_group => $appGroup,
aliases => [
{
path => "${igoAppPath}/pilotage/",
provider => 'directory',
php_value => 'max_input_vars 2000',
rewrites => [
{ rewrite_rule => [ '^$ public/ [L]' ] },
{ rewrite_rule => [ '(.*) public/$1 [L]' ] },
],
},
alias => '/igo_navigateur/',
path => "${igoAppPath}/interfaces/navigateur/" },
{
path => "${igoAppPath}/pilotage/public/",
provider => 'directory',
add_default_charset => 'UTF-8',
rewrites => [
{ rewrite_cond => [ '%{REQUEST_FILENAME} !-d' ] },
{ rewrite_cond => [ '%{REQUEST_FILENAME} !-f' ] },
{ rewrite_rule => [ '^(.*)$ index.php?_url=/$1 [QSA,L]' ] },
],
},
alias => '/navigateur/',
path => "${igoAppPath}/interfaces/navigateur/" },
{
path => "${igoAppPath}/interfaces/navigateur/",
provider => 'directory',
rewrites => [
{ rewrite_rule => [ '^$ public/ [L]' ] },
{ rewrite_rule => [ '(.*) public/$1 [L]' ] },
alias => '/api/',
path => "${igoAppPath}/interfaces/navigateur/api/" },
],
directories => [
{
path => "${igoAppPath}/interfaces/navigateur/",
provider => 'directory',
rewrites => [
{
rewrite_rule => [ '^$ public/ [L]' ] },
{
rewrite_rule => [ '(.*) public/$1 [L]' ] },
],
},
{
path => "${igoAppPath}/interfaces/navigateur/public/",
provider => 'directory',
add_default_charset => 'UTF-8',
rewrites => [
{ rewrite_cond => [ '%{REQUEST_FILENAME} !-d' ] },
{ rewrite_cond => [ '%{REQUEST_FILENAME} !-f' ] },
{ rewrite_rule => [ '^(.*)$ index.php?_url=/$1 [QSA,L]' ] },
{
rewrite_cond => [ '%{REQUEST_FILENAME} !-d' ] },
{
rewrite_cond => [ '%{REQUEST_FILENAME} !-f' ] },
{
rewrite_rule => [ '^(.*)$ index.php?_url=/$1 [QSA,L]' ] },
],
},
{
path => "${igoAppPath}/interfaces/navigateur/api/",
provider => 'directory',
rewrites => [
{ rewrite_cond => [ '%{REQUEST_FILENAME} !-f' ] },
{ rewrite_rule => [ '^(.*)$ index.php?_url=/$1 [QSA,L]' ] },
path => "${igoAppPath}/interfaces/navigateur/api/",
provider => 'directory',
rewrites => [
{
rewrite_cond => [ '%{REQUEST_FILENAME} !-f' ] },
{
rewrite_rule => [ '^(.*)$ index.php?_url=/$1 [QSA,L]' ] },
],
},
],
Expand Down
51 changes: 32 additions & 19 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
$pgUser = $::igo::params::pgUser,
$appUser = $::igo::params::appUser,
$appGroup = $::igo::params::appGroup,
$pgsqlScriptPath = $::igo::params::pgsqlScriptPath,
$mapserverVersion = $::igo::params::mapserVerversion,
$igoGitRepo = $::igo::params::igoGitRepo,
$igoVersion = $::igo::params::igoVersion,
$librairieGitRepo = $::igo::params::librairieGitRepo,
$librairieVersion = $::igo::params::librairieVersion,
$cphalconGitRepo = $::igo::params::cphalconGitRepo,
$cphalconVersion = $::igo::params::cphalconVersion,
$pgsqlEtcPath = $::igo::params::pgsqlEtcPath,
$pgsqlScriptPath = $::igo::params::pgsqlScriptPath,
$srcPath = $::igo::params::srcPath,
$configTemplate = $::igo::params::configTemplate,

) inherits ::igo::params {
Expand All @@ -38,22 +40,22 @@
package { 'git':
ensure => present,
}
file { "$igoRootPath":
file { $igoRootPath:
ensure => 'directory',
owner => $appUser,
group => $appGroup,
mode => '0775',
}
if $usedByVagrant == true {
file { "$igoAppPath":
file { $igoAppPath:
ensure => 'link',
target => '/vagrant',
force => true,
require => File[$igoRootPath]
}
$requiredIgoAppPath = File["$igoAppPath"]
$requiredIgoAppPath = File[$igoAppPath]
} else {
vcsrepo { "$igoAppPath":
vcsrepo { $igoAppPath:
ensure => present,
provider => git,
source => $igoGitRepo,
Expand All @@ -63,9 +65,9 @@
File[$igoRootPath],
],
}
$requiredIgoAppPath = Vcsrepo["$igoAppPath"]
$requiredIgoAppPath = Vcsrepo[$igoAppPath]
}
vcsrepo { "${igoRootPath}/librairie":
vcsrepo { "${igoAppPath}/librairie":
ensure => present,
provider => git,
source => $librairieGitRepo,
Expand All @@ -87,11 +89,22 @@
mode => '0775',
require => $requiredIgoAppPath,
}
file { "${igoAppPath}/config/config.php":
owner => $appUser,
group => $appGroup,
content => template($configTemplate),
require => $requiredIgoAppPath,
# Keep compatibility with users who want to use their own config template file.
if $configTemplate != '' {
file { "${igoAppPath}/config/config.php":
owner => $appUser,
group => $appGroup,
content => template($configTemplate),
require => $requiredIgoAppPath,
}
}
else {
file { "${igoAppPath}/config/config.php":
owner => $appUser,
group => $appGroup,
source => "${igoAppPath}/config/config.exempleSimple.php",
require => $requiredIgoAppPath,
}
}
class { '::igo::apache':
igoRootPath => $igoRootPath,
Expand Down Expand Up @@ -126,7 +139,7 @@
require => Package['git'],
}
exec { 'installAndBuild-cphalcon':
command => "./install",
command => './install',
cwd => "${srcPath}/cphalcon/build",
path => $execPath,
creates => '/usr/lib/php5/20121212/phalcon.so',
Expand All @@ -144,16 +157,16 @@
}
class { 'postgresql::server::postgis':
}
postgresql::server::db { "$databaseName":
postgresql::server::db { $databaseName:
user => $databaseUser,
password => $databasePassword,
}
postgresql::server::extension { 'plpgsql':
database => $databaseName,
ensure => present,
database => $databaseName,
}
exec { 'psql-postgis':
command =>
command =>
"psql -d ${databaseName} -f ${pgsqlScriptPath}/postgis.sql && \
touch ${pgsqlEtcPath}/psql-postgis.done",
path => $execPath,
Expand All @@ -162,16 +175,16 @@
require => Postgresql::Server::Extension['plpgsql'],
}
exec { 'psql-postgis_comments':
command =>
command =>
"psql -d ${databaseName} -f ${pgsqlScriptPath}/postgis_comments.sql && \
touch ${pgsqlEtcPath}/psql-postgis_comments.done",
path => $execPath,
user => $pgUser,
creates => "${pgsqlEtcPath}/psql-postgis_comments.done",
require => Exec['psql-postgis'],
}
exec { "psql-spatial_ref_sys":
command =>
exec { 'psql-spatial_ref_sys':
command =>
"psql -d ${databaseName} -f ${pgsqlScriptPath}/spatial_ref_sys.sql && \
touch ${pgsqlEtcPath}/psql-spatial_ref_sys.done",
path => $execPath,
Expand Down
8 changes: 4 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@

$igoGitRepo = 'https://github.com/infra-geo-ouverte/igo.git'
$igoVersion = 'master'

$librairieGitRepo = 'https://github.com/infra-geo-ouverte/igo-lib.git'
$librairieVersion = 'master'

$cphalconGitRepo = 'https://github.com/phalcon/cphalcon.git'
$cphalconVersion = 'v1.3.1'

$pgsqlEtcPath = "/etc/postgresql/${::postgresql::globals::default_version}"
$pgsqlScriptPath = "/usr/share/postgresql/${::postgresql::globals::default_version}/contrib/postgis-${::postgresql::globals::default_postgis_version}"
$srcPath = '/usr/src'
$configTemplate = 'igo/config.php.erb'

$configTemplate = ''

}
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"operatingsystem_support": [],
"project_page": "",
"requirements": [],
"source": "git@gitlab.forge.gouv.qc.ca:puppet/igo.git",
"source": "git@github.com:infra-geo-ouverte/puppet-igo.git",
"summary": "Install and setup IGO-Navigator server",
"tags": ["igo", "gis"],
"version": "1.1.0"
"version": "1.3.0"
}
Loading

0 comments on commit 3814e68

Please sign in to comment.