Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/webdav-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ storm::webdav::voms_trust_store_refresh_interval_sec: 43200
storm::webdav::voms_cache_enabled: true
storm::webdav::voms_cache_entry_lifetime_sec: 300
storm::webdav::scitags_enabled: false
storm::webdav::scitags_daemon: 'flowd'
storm::webdav::scitags_collector:
storm::webdav::nginx_enabled: false
1 change: 1 addition & 0 deletions manifests/webdav.pp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
String $tape_wellknown_source,

Boolean $scitags_enabled,
String $scitags_daemon,
Optional[String] $scitags_collector,

Boolean $nginx_enabled,
Expand Down
25 changes: 19 additions & 6 deletions manifests/webdav/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,25 @@
}

if $storm::webdav::scitags_enabled {
file { '/etc/flowd/flowd.cfg' :
ensure => file,
content => template('storm/etc/flowd/flowd.cfg.erb'),
owner => 'root',
group => 'root',
mode => '0644',
case $storm::webdav::scitags_daemon {
'flowd': {
file { '/etc/flowd/flowd.cfg' :
ensure => file,
content => template('storm/etc/flowd/flowd.cfg.erb'),
owner => 'root',
group => 'root',
mode => '0644',
}
}
'flowd-go': {
file { '/etc/flowd-go/conf.json' :
ensure => file,
content => template('storm/etc/flowd-go/conf.json.erb'),
owner => 'root',
group => 'root',
mode => '0644',
}
}
}
}

Expand Down
16 changes: 13 additions & 3 deletions manifests/webdav/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@
gpgcheck => 0,
baseurl => "https://linuxsoft.cern.ch/repos/scitags${el}al-stable/x86_64/os/",
}
package { 'python3-scitags':
ensure => 'installed',
require => Yumrepo['scitags-repo'],
case $storm::webdav::scitags_daemon {
'flowd': {
package { 'python3-scitags':
ensure => 'installed',
require => Yumrepo['scitags-repo'],
}
}
'flowd-go': {
package { 'flowd-go':
ensure => 'installed',
require => Yumrepo['scitags-repo'],
}
}
}
}
}
16 changes: 13 additions & 3 deletions manifests/webdav/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@
enable => true,
}
if $storm::webdav::scitags_enabled {
service { 'flowd':
ensure => running,
enable => true,
case $storm::webdav::scitags_daemon {
'flowd': {
service { 'flowd':
ensure => running,
enable => true,
}
}
'flowd-go': {
service { 'flowd-go':
ensure => running,
enable => true,
}
}
}
}
}
58 changes: 58 additions & 0 deletions spec/classes/storm/storm_webdav_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,64 @@
)
end
end

context 'Check deployment with SciTag support using flowd-go' do
let(:params) do
{
'scitags_enabled' => true,
'scitags_daemon' => 'flowd-go',
}
end

case facts[:operatingsystemmajrelease]
when '9'
it 'scitags-repo is installed and enabled' do
is_expected.to contain_yumrepo('scitags-repo').with(
ensure: 'present',
baseurl: 'https://linuxsoft.cern.ch/repos/scitags9al-stable/x86_64/os/',
enabled: 1,
gpgcheck: 0,
)
end
end
it 'check sysconfig file' do
service_file = '/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf'
is_expected.to contain_file(service_file).with(
ensure: 'file',
)
is_expected.to contain_file(service_file).with(content: %r{Environment="STORM_WEBDAV_SCITAGS_ENABLED=true"})
end
it 'check flowd-go configuration files' do
flowd_cfg_file = '/etc/flowd-go/conf.json'
is_expected.to contain_file(flowd_cfg_file).with(
ensure: 'file',
)
end
it 'check flowd-go rpm is installed' do
is_expected.to contain_package('flowd-go')
end
it { is_expected.to contain_service('flowd-go').with(ensure: 'running') }
end

context 'Test flowd-go configuration with a SciTag collector' do
let(:params) do
{
'scitags_enabled' => true,
'scitags_daemon' => 'flowd-go',
'scitags_collector' => 'eu.scitags.org',
}
end

it 'check flowd configuration contains the collector' do
flowd_cfg_file = '/etc/flowd-go/conf.json'
is_expected.to contain_file(flowd_cfg_file).with(
ensure: 'file',
)
is_expected.to contain_file(flowd_cfg_file).with(
content: %r{"collectorAddress": "eu.scitags.org"},
)
end
end
end
end
end
24 changes: 24 additions & 0 deletions templates/etc/flowd-go/conf.json.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"pidPath": "/var/run/flowd-go/pid",
"workDir": ".",
"stunServers": [
"stun:stun.l.google.com:19305",
"stun:stun.services.mozilla.org:3478"
],
"plugins": {
"namedPipe": {
"maxReaders": 5,
"buffSize": 1000,
"pipePath": "/var/run/flowd"
}
},
"backends": {
"firefly": {
<% if scope.lookupvar('storm::webdav::scitags_collector') -%>
"sendToCollector": true,
"collectorAddress": "<%=scope.lookupvar('storm::webdav::scitags_collector')%>",
"collectorPort": 10514
<% end -%>
}
}
}