-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from lsst-it/IT-1827/pscheduler-agent
add pscheduler-agent management
- Loading branch information
Showing
8 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# @summary Manage pschedular-agent service | ||
# @api private | ||
class perfsonar::pscheduler::agent { | ||
assert_private() | ||
|
||
$config_path = '/etc/perfsonar/psconfig/pscheduler-agent.json' | ||
|
||
service { 'psconfig-pscheduler-agent': | ||
ensure => running, | ||
enable => true, | ||
} | ||
|
||
if $::perfsonar::pscheduler_agent_config { | ||
file { $config_path: | ||
ensure => file, | ||
owner => 'perfsonar', | ||
group => 'perfsonar', | ||
mode => '0644', | ||
content => to_json_pretty($::perfsonar::pscheduler_agent_config), | ||
} ~> Service['psconfig-pscheduler-agent'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'perfsonar::pscheduler::agent' do | ||
context 'with pscheduler_agent_config' do | ||
let(:pp) do | ||
<<-EOS | ||
class { 'perfsonar': | ||
manage_firewall => false, | ||
manage_pscheduler_agent => true, | ||
pscheduler_agent_config => { | ||
remotes => [{ | ||
url => 'https://foo.example.org', | ||
configure-archives => true, | ||
}], | ||
} | ||
} | ||
EOS | ||
end | ||
|
||
it_behaves_like 'an idempotent resource' | ||
|
||
describe service('psconfig-pscheduler-agent') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe file('/etc/perfsonar/psconfig/pscheduler-agent.json') do | ||
it { is_expected.to be_file } | ||
it { is_expected.to be_owned_by 'perfsonar' } | ||
it { is_expected.to be_grouped_into 'perfsonar' } | ||
it { is_expected.to be_mode '644' } # serverspec does not like a leading 0 | ||
its(:content) { is_expected.to match %r{https://foo.example.org} } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters