Skip to content

Commit

Permalink
Updates to support Globus Connect Server 5.4.61+ (treydock#41)
Browse files Browse the repository at this point in the history
* Remove client_id and client_secret parameters
* Add project_id and project_admin parameters

Fixes treydock#37
  • Loading branch information
treydock authored Nov 29, 2023
1 parent d5096b2 commit 4e15969
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 44 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This module manages Globus Connect Server.

### Supported Versions of Globus

Currently this module supports Globus 5.4.
Currently this module supports Globus 5.4, at least 5.4.61

| Globus Version | Globus Puppet module versions |
| -------------- | ----------------------------- |
Expand All @@ -29,8 +29,6 @@ The following is the minimum parameters that must be passed to setup Globus v5.4
```puppet
class { 'globus':
display_name => 'REPLACE My Site Globus',
client_id => 'REPLACE-client-id-from-globus',
client_secret => 'REPLACE-client-id-from-globus',
owner => '[email protected]',
organization => 'REPLACE-My Site',
}
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/functions/globus/endpoint_setup_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
def args(values)
flags = []
flags << "'#{values['display_name']}'"
flags << "--client-id #{values['client_id']}"
flags << "--secret '#{values['client_secret']}'"
flags << "--owner '#{values['owner']}'"
flags << "--project-id '#{values['project_id']}" unless values['project_id'].nil?
flags << "--project-admin '#{values['project_admin']}" unless values['project_admin'].nil?
flags << "--organization '#{values['organization']}'"
flags << "--deployment-key #{values['deployment_key']}"
flags << '--agree-to-letsencrypt-tos'
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/functions/globus/node_setup_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
end
def args(values)
flags = []
flags << "--client-id #{values['client_id']}"
flags << "--deployment-key #{values['deployment_key']}"
flags << "--incoming-port-range #{values['incoming_port_range'].join(' ')}" unless values['incoming_port_range'].nil?
flags << "--outgoing-port-range #{values['outgoing_port_range'].join(' ')}" unless values['outgoing_port_range'].nil?
Expand Down
29 changes: 13 additions & 16 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
class globus::config {
$endpoint_setup_args = globus::endpoint_setup_args({
display_name => $globus::display_name,
client_id => $globus::client_id,
client_secret => $globus::client_secret,
owner => $globus::owner,
project_id => $globus::project_id,
project_admin => $globus::project_admin,
deployment_key => $globus::deployment_key,
organization => $globus::organization,
keywords => $globus::keywords,
Expand All @@ -23,10 +23,9 @@
group => 'root',
mode => '0700',
show_diff => false,
content => "export GLOBUS_CLIENT_SECRET=${globus::client_secret}\n${endpoint_setup}\n",
content => "${endpoint_setup}\n",
}
$node_setup_args = globus::node_setup_args({
client_id => $globus::client_id,
deployment_key => $globus::deployment_key,
incoming_port_range => $globus::incoming_port_range,
outgoing_port_range => $globus::outgoing_port_range,
Expand All @@ -41,23 +40,21 @@
group => 'root',
mode => '0700',
show_diff => false,
content => "export GLOBUS_CLIENT_SECRET=${globus::client_secret}\n${node_setup}\n",
content => "${node_setup}\n",
}
if $globus::run_setup_commands {
exec { 'globus-endpoint-setup':
path => '/usr/bin:/bin:/usr/sbin:/sbin',
command => $endpoint_setup,
environment => ["GLOBUS_CLIENT_SECRET=${globus::client_secret}"],
creates => $globus::deployment_key,
logoutput => true,
path => '/usr/bin:/bin:/usr/sbin:/sbin',
command => $endpoint_setup,
creates => $globus::deployment_key,
logoutput => true,
}
exec { 'globus-node-setup':
path => '/usr/bin:/bin:/usr/sbin:/sbin',
command => $node_setup,
environment => ["GLOBUS_CLIENT_SECRET=${globus::client_secret}"],
unless => 'test -s /var/lib/globus-connect-server/info.json',
logoutput => true,
require => Exec['globus-endpoint-setup'],
path => '/usr/bin:/bin:/usr/sbin:/sbin',
command => $node_setup,
unless => 'test -s /var/lib/globus-connect-server/info.json',
logoutput => true,
require => Exec['globus-endpoint-setup'],
}
}

Expand Down
14 changes: 6 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# @example Install and setup a Globus v5.4 endpoint
# class { 'globus':
# display_name => 'REPLACE My Site Globus',
# client_id => 'REPLACE-client-id-from-globus',
# client_secret => 'REPLACE-client-id-from-globus',
# owner => '[email protected]',
# }
#
Expand Down Expand Up @@ -36,10 +34,10 @@
# Globus package name
# @param display_name
# Display name to use when running 'globus-connect-server endpoint setup'
# @param client_id
# --client-id use when running 'globus-connect-server endpoint setup'
# @param client_secret
# --client-secret use when running 'globus-connect-server endpoint setup'
# @param project_id
# --project-id use when running 'globus-connect-server endpoint setup'
# @param project_admin
# --project-admin use when running 'globus-connect-server endpoint setup'
# @param owner
# --owner use when running 'globus-connect-server endpoint setup'
# @param organization
Expand Down Expand Up @@ -75,8 +73,6 @@
class globus (
# Required
String[1] $display_name,
String[1] $client_id,
String[1] $client_secret,
String[1] $owner,
String[1] $organization,

Expand All @@ -97,6 +93,8 @@
Stdlib::Absolutepath $deployment_key = '/var/lib/globus-connect-server/gcs-manager/deployment-key.json',

# endpoint setup
Optional[String[1]] $project_id = undef,
Optional[String[1]] $project_admin = undef,
Optional[Array] $keywords = undef,
Optional[String] $department = undef,
Optional[String] $contact_email = undef,
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/globus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
pp = "
class { 'globus':
display_name => 'REPLACE My Site Globus',
client_id => 'REPLACE-client-id-from-globus',
client_secret => 'REPLACE-client-id-from-globus',
owner => '[email protected]',
organization => 'REPLACE-My Site',
run_setup_commands => false,
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/globus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

let(:default_params) do
{
client_id: 'foo',
client_secret: 'bar',
owner: '[email protected]',
display_name: 'Example',
organization: 'Example'
Expand Down
13 changes: 3 additions & 10 deletions spec/shared_examples/globus_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
let(:endpoint_setup) do
[
'globus-connect-server endpoint setup',
"'Example' --client-id foo --secret 'bar'",
"'Example'",
"--owner '[email protected]'",
"--organization 'Example'",
'--deployment-key /var/lib/globus-connect-server/gcs-manager/deployment-key.json',
Expand All @@ -14,7 +14,6 @@
let(:node_setup) do
[
'globus-connect-server node setup',
'--client-id foo',
'--deployment-key /var/lib/globus-connect-server/gcs-manager/deployment-key.json',
'--incoming-port-range 50000 51000',
'--ip-address 172.16.254.254'
Expand All @@ -28,9 +27,7 @@
group: 'root',
mode: '0700',
show_diff: 'false',
content: "export GLOBUS_CLIENT_SECRET=bar
#{endpoint_setup.join(' ')}
",
content: "#{endpoint_setup.join(' ')}\n",
)
end

Expand All @@ -41,17 +38,14 @@
group: 'root',
mode: '0700',
show_diff: 'false',
content: "export GLOBUS_CLIENT_SECRET=bar
#{node_setup.join(' ')}
",
content: "#{node_setup.join(' ')}\n",
)
end

it 'has endpoint setup command' do
is_expected.to contain_exec('globus-endpoint-setup').with(
path: '/usr/bin:/bin:/usr/sbin:/sbin',
command: endpoint_setup.join(' '),
environment: ['GLOBUS_CLIENT_SECRET=bar'],
creates: '/var/lib/globus-connect-server/gcs-manager/deployment-key.json',
logoutput: 'true',
)
Expand All @@ -61,7 +55,6 @@
is_expected.to contain_exec('globus-node-setup').with(
path: '/usr/bin:/bin:/usr/sbin:/sbin',
command: node_setup.join(' '),
environment: ['GLOBUS_CLIENT_SECRET=bar'],
unless: 'test -s /var/lib/globus-connect-server/info.json',
logoutput: 'true',
require: 'Exec[globus-endpoint-setup]',
Expand Down

0 comments on commit 4e15969

Please sign in to comment.