Skip to content

Commit

Permalink
Add hacks to prevent the module from failing after 4.0 upgrade.
Browse files Browse the repository at this point in the history
The changes prevent the module from failing after an upgrade
to perfsonar 4.0.
The module cannot be used to configure a fresh 4.0 installation.
  • Loading branch information
rwf14f committed Apr 28, 2017
1 parent a52eeb6 commit 3442d91
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 28 deletions.
28 changes: 28 additions & 0 deletions files/patches/03_augeas_httpd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--- dist/httpd.aug.org 2017-04-28 11:17:04.010737996 +0100
+++ dist/httpd.aug 2017-04-28 11:27:57.115688414 +0100
@@ -34,6 +34,9 @@

*)

+(*
+# puppet perfsonar::patches applied patch: 03_augeas_httpd.patch
+*)

module Httpd =

@@ -63,13 +66,14 @@
let char_arg_sec = /[^ '"\t\r\n>]|\\\\"|\\\\'/
let dquot = /"([^"\\\r\n]|\\\\.)*"/
let squot = /'([^'\\\r\n]|\\\\.)*'/
+let comp = /[<>=]?=/

(******************************************************************
* Attributes
*****************************************************************)

let arg_dir = [ label "arg" . store (char_arg_dir+|dquot|squot) ]
-let arg_sec = [ label "arg" . store (char_arg_sec+|dquot|squot) ]
+let arg_sec = [ label "arg" . store (char_arg_sec+|comp|dquot|squot) ]

let argv (l:lens) = l . (sep_spc . l)*

16 changes: 11 additions & 5 deletions manifests/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,18 @@
}
if $have_auth > 0 {
# additions for new web gui
$changes40 = versioncmp($perfsonar_version, '4.0') ? {
/^[01]$/ => [
"rm Location[arg='\"/toolkit/auth\"']/*/directive[.='AuthUserFile']",
],
default => [],
}
$changes35 = versioncmp($perfsonar_version, '3.5') ? {
/^[01]$/ => [
"rm Location[arg='\"/toolkit/auth\"']/directive[.='AuthShadow']",
"rm Location[arg='\"/toolkit/auth\"']/directive[.='AuthType']",
"rm Location[arg='\"/toolkit/auth\"']/directive[.='AuthName']",
"rm Location[arg='\"/toolkit/auth\"']/directive[.='Require']",
"rm Location[arg='\"/toolkit/auth\"']/*/directive[.='AuthShadow']",
"rm Location[arg='\"/toolkit/auth\"']/*/directive[.='AuthType']",
"rm Location[arg='\"/toolkit/auth\"']/*/directive[.='AuthName']",
"rm Location[arg='\"/toolkit/auth\"']/*/directive[.='Require']",
"setm Location[arg='\"/toolkit/auth\"'] directive[.='Include'] 'Include'",
"setm Location[arg='\"/toolkit/auth\"'] *[.='Include']/arg '${perfsonar::params::httpd_dir}/ssl_auth.conf'",
],
Expand Down Expand Up @@ -147,7 +153,7 @@
notify => Service[$::perfsonar::params::httpd_service],
require => Package[$::perfsonar::params::httpd_package],
}
$auges_changes = concat($changes34, $changes35, $remove_redirect)
$auges_changes = concat($changes34, $changes35, $changes40, $remove_redirect)
augeas { 'update perfsonar apache config':
incl => "${perfsonar::params::conf_dir}/apache-toolkit_web_gui.conf",
lens => 'Httpd.lns',
Expand Down
2 changes: 1 addition & 1 deletion manifests/esmond.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class perfsonar::esmond (
$use_db_module = $::perfsonar::params::esmond_use_db_module,
$use_db_module = $::perfsonar::params::esmond_use_db_module_real,
$dbname = $::perfsonar::params::esmond_dbname,
$dbuser = $::perfsonar::params::esmond_dbuser,
$dbpassword = $::perfsonar::params::esmond_dbpass,
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
include 'perfsonar::service'
include 'perfsonar::apache'
include 'perfsonar::esmond'
include 'perfsonar::regular_testing'
if $::perfsonar_version and versioncmp($::perfsonar_version, '4.0') < 0 {
include 'perfsonar::regular_testing'
}
include 'perfsonar::mesh_config'
include 'perfsonar::owamp'
include 'perfsonar::bwctl'
Expand Down
4 changes: 3 additions & 1 deletion manifests/logrotate_all.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class perfsonar::logrotate_all {
include 'perfsonar::logrotate'
include 'perfsonar::regular_testing::logrotate'
if $::perfsonar_version and versioncmp($::perfsonar_version, '4.0') < 0 {
include 'perfsonar::regular_testing::logrotate'
}
include 'perfsonar::ls_registration_daemon::logrotate'
include 'perfsonar::ls_cache_daemon::logrotate'
}
38 changes: 20 additions & 18 deletions manifests/mesh_config/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@
content => template("${module_name}/agent_configuration.conf.erb"),
require => Package['perfsonar-meshconfig-agent'],
}
# needs notty in sudoers
exec { 'generate mesh configuration':
command => '/usr/bin/sudo -u perfsonar /usr/lib/perfsonar/bin/generate_configuration',
logoutput => 'on_failure',
subscribe => File['/etc/perfsonar/meshconfig-agent.conf'],
require => [
Exec['run regular testing configuration script'],
File['/etc/sudoers.d/perfsonar_mesh_config'],
],
refreshonly => true,
notify => Service['perfsonar-regulartesting'],
}
file { '/etc/sudoers.d/perfsonar_mesh_config':
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0440',
content => "Defaults!/usr/lib/perfsonar/bin/generate_configuration !requiretty\n",
if $::perfsonar_version and versioncmp($::perfsonar_version, '4.0') < 0 {
# needs notty in sudoers
exec { 'generate mesh configuration':
command => '/usr/bin/sudo -u perfsonar /usr/lib/perfsonar/bin/generate_configuration',
logoutput => 'on_failure',
subscribe => File['/etc/perfsonar/meshconfig-agent.conf'],
require => [
Exec['run regular testing configuration script'],
File['/etc/sudoers.d/perfsonar_mesh_config'],
],
refreshonly => true,
notify => Service['perfsonar-regulartesting'],
}
file { '/etc/sudoers.d/perfsonar_mesh_config':
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0440',
content => "Defaults!/usr/lib/perfsonar/bin/generate_configuration !requiretty\n",
}
}
}
7 changes: 7 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,11 @@
send_error_emails => 1,
skip_redundant_tests => 1,
}

# disable db after upgrade to perfsonar 4.0
if $::perfsonar_version and versioncmp($::perfsonar_version, '4.0') >= 0 {
$esmond_use_db_module_real = false
} else {
$esmond_use_db_module_real = true
}
}
13 changes: 11 additions & 2 deletions manifests/patches.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
$patchpackage_require = undef
}
case $perfsonar_version {
/^3\.5\.1/: {
/^(3\.5\.1|4\.0)/: {
package { 'augeas-libs':
ensure => 'present',
}
$patches = {
'01_perfsonar_webservice_auth.patch.3.5.0' => {
path => '/usr/lib/perfsonar/lib/perfSONAR_PS/NPToolkit/WebService',
Expand All @@ -30,7 +33,13 @@
strip => 1,
deps => Package['perfsonar-toolkit'],
checkfile => 'index.cgi', # relative to path
}
},
'03_augeas_httpd.patch' => {
path => '/usr/share/augeas/lenses/dist',
strip => 1,
deps => Package['augeas-libs'],
checkfile => 'httpd.aug', # relative to path
},
}
}
default: {
Expand Down

0 comments on commit 3442d91

Please sign in to comment.