Skip to content

Commit

Permalink
Merge pull request #5 from STFC-RAL-PPD/master
Browse files Browse the repository at this point in the history
Various changes for compatibility with perfSONAR 3.5.1
  • Loading branch information
rwf14f committed Apr 1, 2016
2 parents 46c1d18 + e85cc77 commit d088f61
Show file tree
Hide file tree
Showing 26 changed files with 116 additions and 86 deletions.
2 changes: 1 addition & 1 deletion lib/facter/perfsonar_systemenvironment.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Facter.add(:perfsonar_systemenvironment) do
confine :osfamily => 'RedHat'
setcode do
ps_se = Facter::Util::Resolution::exec('/bin/rpm -q --qf "%{NAME}\n" perl-perfSONAR_PS-Toolkit-SystemEnvironment | grep "^perl-perfSONAR_PS-Toolkit-SystemEnvironment$"')
ps_se = Facter::Util::Resolution::exec('/bin/rpm -q --qf "%{NAME}\n" perfsonar-toolkit-systemenv | grep "^perfsonar-toolkit-systemenv$"')
ps_se && !ps_se.empty? ? true : false
end
end
2 changes: 1 addition & 1 deletion lib/facter/perfsonar_version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Facter.add(:perfsonar_version) do
confine :osfamily => 'RedHat'
setcode do
perfsonar = Facter::Util::Resolution::exec('/bin/rpm -q --qf "%{NAME} %{VERSION}\n" perl-perfSONAR_PS-Toolkit | grep "^perl-perfSONAR_PS-Toolkit "')
perfsonar = Facter::Util::Resolution::exec('/bin/rpm -q --qf "%{NAME} %{VERSION}\n" perfsonar-toolkit | grep "^perfsonar-toolkit "')
perfsonar.split(/ /)[1] if perfsonar
end
end
1 change: 1 addition & 0 deletions manifests/bwctl.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class perfsonar::bwctl {
include 'perfsonar::bwctl::install'
include 'perfsonar::bwctl::service'
Class['perfsonar::bwctl::install'] -> Class['perfsonar::bwctl::service']
}
2 changes: 1 addition & 1 deletion manifests/bwctl/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$ensure = $::perfsonar::params::bwctl_ensure,
$enable = $::perfsonar::params::bwctl_enable,
) inherits perfsonar::params {
service { 'bwctld':
service { 'bwctl-server':
ensure => $ensure,
enable => $enable,
hasstatus => false,
Expand Down
4 changes: 2 additions & 2 deletions manifests/cleanup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
}
if ! $::perfsonar_systemenvironment {
# don't remove the following packages if
# perl-perfSONAR_PS-Toolkit-SystemEnvironment is installed
# perfsonar-toolkit-systemenv is installed
# they are dependencies and can't be removed without removing
# perl-perfSONAR_PS-Toolkit-SystemEnvironment as well
# perfsonar-toolkit-systemenv as well
package { [ 'php-common', 'perl-DBD-MySQL', ]:
ensure => 'absent',
}
Expand Down
8 changes: 4 additions & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@
# we need the onlyif because the above command produces an error if the regex can't find any values
onlyif => 'match readahead/*[label()!=\'#comment\'][.=~regexp(\'"?yes"?\')] size > 0',
}
file { '/opt/perfsonar_ps/toolkit/etc/administrative_info':
file { '/etc/perfsonar/toolkit/administrative_info':
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0644',
content => template("${module_name}/administrative_info.erb"),
require => Package['perl-perfSONAR_PS-Toolkit']
require => Package['perfsonar-toolkit']
}
# update owner / permissions on directories
file { '/var/lib/perfsonar/db_backups':
ensure => 'directory',
owner => 'perfsonar',
group => 'perfsonar',
mode => '0755',
require => Package['perl-perfSONAR_PS-Toolkit']
require => Package['perfsonar-toolkit']
}
file { '/var/lib/perfsonar/log_view':
ensure => 'directory',
owner => 'perfsonar',
group => 'perfsonar',
mode => '0755',
require => Package['perl-perfSONAR_PS-Toolkit']
require => Package['perfsonar-toolkit']
}
}

Expand Down
6 changes: 3 additions & 3 deletions manifests/esmond.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
}

file { '/opt/esmond/esmond.conf':
file { '/etc/esmond/esmond.conf':
ensure => 'file',
owner => 'root',
group => 'root',
Expand All @@ -54,15 +54,15 @@
group => 'root',
mode => '0750',
content => template("${module_name}/configure_esmond.erb"),
require => File['/opt/esmond/esmond.conf'],
require => File['/etc/esmond/esmond.conf'],
}
exec { 'run esmond configuration script':
command => '/usr/local/sbin/puppet_perfsonar_configure_esmond',
logoutput => true, #'on_failure',
creates => '/var/lib/esmond/.configured.puppet',
require => [
File['/usr/local/sbin/puppet_perfsonar_configure_esmond'],
File['/opt/esmond/esmond.conf'],
File['/etc/esmond/esmond.conf'],
],
}
}
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
include 'perfsonar::bwctl'
include 'perfsonar::ls_registration_daemon'
include 'perfsonar::ls_cache_daemon'
Class['perfsonar::install'] -> Class['perfsonar::config'] -> Class['perfsonar::service']
}
4 changes: 2 additions & 2 deletions manifests/ls_cache_daemon/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
) inherits perfsonar::params {
$tn = $snotify ? {
false => undef,
default => Service['ls_cache_daemon'],
default => Service['perfsonar-lscachedaemon'],
}
file { '/opt/perfsonar_ps/ls_cache_daemon/etc/ls_cache_daemon-logger.conf':
file { '/etc/perfsonar/lscachedaemon-logger.conf':
ensure => 'file',
owner => 'perfsonar',
group => 'perfsonar',
Expand Down
2 changes: 1 addition & 1 deletion manifests/ls_cache_daemon/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
) inherits perfsonar::params {
package { $::perfsonar::params::ls_cache_daemon_packages:
ensure => $ensure,
before => File['/opt/perfsonar_ps/ls_cache_daemon/etc/ls_cache_daemon-logger.conf'],
before => File['/etc/perfsonar/lscachedaemon-logger.conf'],
}
}
5 changes: 3 additions & 2 deletions manifests/ls_cache_daemon/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
$enable = $::perfsonar::params::ls_cache_daemon_enable,
) inherits perfsonar::params {
# start stop restart
service { 'ls_cache_daemon':
service { 'perfsonar-lscachedaemon':
ensure => $ensure,
enable => $enable,
hasstatus => false,
pattern => 'lscachedaemon',
hasrestart => true,
require => Package['perl-perfSONAR_PS-LSCacheDaemon'],
require => Package['perfsonar-lscachedaemon'],
}
}
21 changes: 15 additions & 6 deletions manifests/ls_registration_daemon/config.pp
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
class perfsonar::ls_registration_daemon::config(
$snotify = $::perfsonar::params::ls_registration_daemon_snotify,
$loglvl = $::perfsonar::params::ls_registration_daemon_loglvl,
$logger = $::perfsonar::params::ls_registration_daemon_logger,
$logfile = $::perfsonar::params::ls_registration_daemon_logfile,
$snotify = $::perfsonar::params::ls_registration_daemon_snotify,
$loglvl = $::perfsonar::params::ls_registration_daemon_loglvl,
$logger = $::perfsonar::params::ls_registration_daemon_logger,
$logfile = $::perfsonar::params::ls_registration_daemon_logfile,
$admininfo = {},
) inherits perfsonar::params {
$tn = $snotify ? {
false => undef,
default => Service['ls_registration_daemon'],
default => Service['perfsonar-lsregistrationdaemon'],
}
file { '/opt/perfsonar_ps/ls_registration_daemon/etc/ls_registration_daemon-logger.conf':
file { '/etc/perfsonar/lsregistrationdaemon-logger.conf':
ensure => 'file',
owner => 'perfsonar',
group => 'perfsonar',
mode => '0644',
content => template("${module_name}/log4perl-logger.conf.erb"),
notify => $tn,
}

# TODO: use Augeas to write this config instead of a cat
exec { 'append_info':
command => '/bin/cat /etc/perfsonar/toolkit/administrative_info >> /etc/perfsonar/lsregistrationdaemon.conf',
unless => '/bin/grep ^site_project /etc/perfsonar/lsregistrationdaemon.conf > /dev/null',
require => File['/etc/perfsonar/toolkit/administrative_info'],
notify => Service['perfsonar-lsregistrationdaemon']
}
}
2 changes: 1 addition & 1 deletion manifests/ls_registration_daemon/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
) inherits perfsonar::params {
package { $::perfsonar::params::ls_registration_daemon_packages:
ensure => $ensure,
before => File['/opt/perfsonar_ps/ls_registration_daemon/etc/ls_registration_daemon-logger.conf'],
before => File['/etc/perfsonar/lsregistrationdaemon-logger.conf'],
}
}
5 changes: 2 additions & 3 deletions manifests/ls_registration_daemon/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
$enable = $::perfsonar::params::ls_registration_daemon_enable,
) inherits perfsonar::params {
# start stop restart
service { 'ls_registration_daemon':
service { 'perfsonar-lsregistrationdaemon':
ensure => $ensure,
enable => $enable,
hasstatus => false,
hasrestart => true,
require => Package['perl-perfSONAR_PS-LSRegistrationDaemon'],
require => Package['perfsonar-lsregistrationdaemon'],
}
}
1 change: 1 addition & 0 deletions manifests/mesh_config.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class perfsonar::mesh_config {
include 'perfsonar::mesh_config::install'
include 'perfsonar::mesh_config::config'
Class['perfsonar::mesh_config::install'] -> Class['perfsonar::mesh_config::config']
}
10 changes: 5 additions & 5 deletions manifests/mesh_config/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
$agentconfig = $::perfsonar::params::mesh_config_agent,
) inherits perfsonar::params {
$agent_options = merge($perfsonar::params::agentconfig, $agentconfig)
file { '/opt/perfsonar_ps/mesh_config/etc/agent_configuration.conf':
file { '/etc/perfsonar/meshconfig-agent.conf':
ensure => 'present',
owner => 'perfsonar',
group => 'perfsonar',
mode => '0644',
content => template("${module_name}/agent_configuration.conf.erb"),
require => Package['perl-perfSONAR_PS-MeshConfig-Agent'],
require => Package['perfsonar-meshconfig-agent'],
}
# needs notty in sudoers
exec { 'generate mesh configuration':
command => '/usr/bin/sudo -u perfsonar /opt/perfsonar_ps/mesh_config/bin/generate_configuration',
command => '/usr/bin/sudo -u perfsonar /usr/lib/perfsonar/bin/generate_configuration',
logoutput => 'on_failure',
subscribe => File['/opt/perfsonar_ps/mesh_config/etc/agent_configuration.conf'],
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['regular_testing'],
notify => Service['perfsonar-regulartesting'],
}
file { '/etc/sudoers.d/perfsonar_mesh_config':
ensure => 'file',
Expand Down
1 change: 1 addition & 0 deletions manifests/owamp.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class perfsonar::owamp {
include 'perfsonar::owamp::install'
include 'perfsonar::owamp::service'
Class['perfsonar::owamp::install'] -> Class['perfsonar::owamp::service']
}
2 changes: 1 addition & 1 deletion manifests/owamp/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$ensure = $::perfsonar::params::owamp_ensure,
$enable = $::perfsonar::params::owamp_enable,
) inherits perfsonar::params {
service { 'owampd':
service { 'owamp-server':
ensure => $ensure,
enable => $enable,
hasstatus => false,
Expand Down
29 changes: 17 additions & 12 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
$regular_testing_install_ensure = 'present',
$regular_testing_ensure = 'stopped',
$regular_testing_enable = false,
$regular_testing_config = '/etc/perfsonar/regulartesting.conf',
$regular_testing_libpath = '/var/lib/perfsonar/regulartesting',
$regular_testing_loglvl = 'INFO',
$regular_testing_logger = 'Log::Dispatch::FileRotate',
$regular_testing_logfile = '/var/log/perfsonar/regular_testing.log',
Expand All @@ -21,6 +23,8 @@
$esmond_dbuser = 'esmond',
$esmond_dbpass = 'jqIqSIiuzwI0FMUu',
$esmond_use_db_module = true,
$esmond_root = '/usr/lib/esmond',
$esmond_conf_path = '/etc/esmond',
$ls_registration_daemon_install_ensure = 'present',
$ls_registration_daemon_ensure = 'running',
$ls_registration_daemon_enable = true,
Expand All @@ -44,6 +48,8 @@
$patchdir = '/usr/local/share/perfsonar_patches',
$patchpackage = 'patch',
$patchpackage_ensure = 'present',
$psadmin_group = 'wheel',
$psadmin_user = ''
) {
# os specifics
case $::osfamily {
Expand All @@ -66,27 +72,26 @@
# packages that are dependencies of packages in this list have been removed from the original list
# general perfsonar packages
$install_packages = [
'perl-perfSONAR_PS-Toolkit',
'perfsonar-toolkit',
# installed as dependencies, but need them here to get the dependencies in puppet right
$httpd_package,
'esmond',
'perl-perfSONAR_PS-SimpleLS-BootStrap-client',
'ndt-server',
'npad',
'nscd',
'cassandra20',
$modssl_package,
# don't want to install SystemEnvironment because it keeps overwriting my configurations during updates
# 'perl-perfSONAR_PS-Toolkit-SystemEnvironment',
# packages that are installed by perl-perfSONAR_PS-Toolkit-SystemEnvironment:
# perl-perfSONAR_PS-Toolkit-ntp
# 'perfsonar-toolkit-systemenv',
# packages that are installed by perfsonar-toolkit-systemenv:
# perfsonar-toolkit-ntp
# configures ntp server (replaces existing config)
# perl-perfSONAR_PS-Toolkit-security
# perfsonar-toolkit-security
# configures iptables
# perl-perfSONAR_PS-Toolkit-service-watcher
# perfsonar-toolkit-service-watcher
# monitors status of services: mysql, httpd, cassandra, owamp, bwctl, npad, ndt, regular_testing, ls_registration_daemon, ls_cache_daemon, config_daemon
# according to /opt/perfsonar_ps/toolkit/lib/perfSONAR_PS/NPToolkit/Services/*.pm, the following services need regular restarts: OWAMP, RegularTesting
# perl-perfSONAR_PS-Toolkit-sysctl
# perfsonar-toolkit-sysctl
# configures /etc/sysctl.conf (appends values)
# don't want to install gcc and mysql, it's not required
# 'gcc',
Expand All @@ -106,11 +111,11 @@
# 'comps-extras' contains images only, do we need it ??

$regular_testing_packages = [
'perl-perfSONAR_PS-RegularTesting',
'perfsonar-regulartesting',
#'perl-DBD-MySQL', # required by regular testing ? I've seen related error message in the logs when it's not installed
]
$mesh_config_packages = [
'perl-perfSONAR_PS-MeshConfig-Agent',
'perfsonar-meshconfig-agent',
]
# we should split client and server at some point
$owamp_packages = [
Expand All @@ -126,10 +131,10 @@
'iperf3', # bwctl packages install iperf and iperf3-devel as dependencies, but not iperf3 ???
]
$ls_registration_daemon_packages = [
'perl-perfSONAR_PS-LSRegistrationDaemon',
'perfsonar-lsregistrationdaemon',
]
$ls_cache_daemon_packages = [
'perl-perfSONAR_PS-LSCacheDaemon',
'perfsonar-lscachedaemon',
]
# logrotate
$logrotate_cf = '/etc/logrotate.d/perfsonar'
Expand Down
8 changes: 4 additions & 4 deletions manifests/patches.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
'01_perfsonar_webservice_auth.patch.3.5.0' => {
path => '/opt/perfsonar_ps/toolkit/lib/perfSONAR_PS/NPToolkit/WebService',
strip => 1,
# file itself is part of perl-perfSONAR_PS-Toolkit-Library
# which is installed as a dependency of perl-perfSONAR_PS-Toolkit
# file itself is part of perfsonar-toolkit-library
# which is installed as a dependency of perfsonar-toolkit
# therefore we use the latter as a dependency for the patch
deps => Package['perl-perfSONAR_PS-Toolkit'],
deps => Package['perfsonar-toolkit'],
checkfile => 'Auth.pm', # relative to path
},
'02_perfsonar_webservice_pageauth.patch.3.5.0' => {
path => '/opt/perfsonar_ps/toolkit/web-ng/root',
strip => 1,
deps => Package['perl-perfSONAR_PS-Toolkit'],
deps => Package['perfsonar-toolkit'],
checkfile => 'index.cgi', # relative to path
}
}
Expand Down
2 changes: 2 additions & 0 deletions manifests/regular_testing.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
include 'perfsonar::regular_testing::install'
include 'perfsonar::regular_testing::config'
include 'perfsonar::regular_testing::service'
Class['perfsonar::regular_testing::install'] -> Class['perfsonar::regular_testing::config'] ->
Class['perfsonar::regular_testing::service']
}
Loading

0 comments on commit d088f61

Please sign in to comment.