Skip to content

Commit

Permalink
Update specs and add todo's
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris29 committed Nov 27, 2023
1 parent 7bfc6a2 commit 956ded4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 127 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

## Overview

# TODO: Update readme

The rundeck puppet module for installing and managing [Rundeck](http://rundeck.org/)

### Supported Versions of Rundeck
Expand Down
8 changes: 0 additions & 8 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.25.0 < 10.0.0"
},
{
"name": "pltraining/dirtree",
"version_requirement": ">= 0.3.0 < 2.0.0"
},
{
"name": "puppetlabs/inifile",
"version_requirement": ">= 4.1.0 < 7.0.0"
},
{
"name": "puppetlabs/java_ks",
"version_requirement": ">= 1.3.1 < 6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/config/aclpolicyfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
facts
end

describe "rundeck::config::global::aclpolicyfile class without any parameters on #{os}" do
describe "rundeck::config::aclpolicyfile class without any parameters on #{os}" do
let(:params) { {} }

default_acl = <<~CONFIG.gsub(%r{[^\S\n]{10}}, '')
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/config/framework_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
facts
end

describe "rundeck::config::global::framework class without any parameters on #{os}" do
describe "rundeck::config::framework class without any parameters on #{os}" do
let(:params) { {} }

framework_details = {
Expand Down
123 changes: 7 additions & 116 deletions spec/classes/config/jaas_auth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
end

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include(login_module)
end
end
Expand All @@ -44,7 +44,7 @@
end

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include(login_module)
end
end
Expand Down Expand Up @@ -79,7 +79,7 @@
end

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include(login_module)
end
end
Expand Down Expand Up @@ -168,98 +168,7 @@
end

it 'generates valid content for jaas-auth.conf' do
content = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
expect(content).to include('userFirstNameAttribute="givenName"')
expect(content).to include('userLastNameAttribute="sn"')
expect(content).to include('userEmailAttribute="mail"')
end
end

describe 'with multiauth active_directory and file auth users array' do
let(:params) do
{
auth_config: {
'file' => {
'auth_users' => [
{
'username' => 'testuser',
'password' => 'password',
'roles' => %w[user deploy]
},
{
'username' => 'anotheruser',
'password' => 'anotherpassword',
'roles' => ['user']
}
]
},

'active_directory' => {
'debug' => 'true',
'url' => 'localhost:389',
'force_binding' => 'true',
'force_binding_use_root' => 'true',
'bind_dn' => 'test_rundeck',
'bind_password' => 'abc123',
'user_base_dn' => 'ou=users,ou=accounts,ou=corp,dc=xyz,dc=com',
'user_rdn_attribute' => 'sAMAccountName',
'user_id_attribute' => 'sAMAccountName',
'user_password_attribute' => 'unicodePwd',
'user_object_class' => 'user',
'role_base_dn' => 'ou=role based,ou=security,ou=groups,ou=test,dc=xyz,dc=com',
'role_name_attribute' => 'cn',
'role_member_attribute' => 'member',
'role_object_class' => 'group',
'supplemental_roles' => 'user',
'nested_groups' => 'true'
}
}
}
end

it 'generates valid content for realm.properties' do
content = catalogue.resource('file', '/etc/rundeck/realm.properties')[:content]
expect(content).to include('admin:admin,user,admin,architect,deploy,build')
expect(content).to include('testuser:password,user,deploy')
expect(content).to include('anotheruser:anotherpassword,user')
end
end

describe 'with active_directory using ldap_sync' do
let(:params) do
{
auth_config: {
'active_directory' => {
'debug' => 'true',
'url' => 'localhost:389',
'force_binding' => 'true',
'force_binding_use_root' => 'true',
'bind_dn' => 'test_rundeck',
'bind_password' => 'abc123',
'user_base_dn' => 'ou=users,ou=accounts,ou=corp,dc=xyz,dc=com',
'user_rdn_attribute' => 'sAMAccountName',
'user_id_attribute' => 'sAMAccountName',
'user_password_attribute' => 'unicodePwd',
'user_object_class' => 'user',
'role_base_dn' => 'ou=role based,ou=security,ou=groups,ou=test,dc=xyz,dc=com',
'role_name_attribute' => 'cn',
'role_member_attribute' => 'member',
'role_object_class' => 'group',
'supplemental_roles' => 'user',
'nested_groups' => 'true',
'sync_first_name_attribute' => 'givenName',
'sync_last_name_attribute' => 'sn',
'sync_email_attribute' => 'mail'
}
},
security_config: {
'syncLdapUser' => true
}
}
end

it 'generates valid content for jaas-auth.conf' do
content = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
content = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(content).to include('userFirstNameAttribute="givenName"')
expect(content).to include('userLastNameAttribute="sn"')
expect(content).to include('userEmailAttribute="mail"')
Expand Down Expand Up @@ -289,7 +198,7 @@
end

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include(login_module)
end
end
Expand All @@ -316,7 +225,7 @@
end

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include(login_module)
end
end
Expand All @@ -334,25 +243,7 @@
end

it 'generates valid content for jaas-auth.conf' do
content = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
expect(content).to include('rolePrefix="rundeck_"')
end
end

describe 'active_directory with rolePrefix' do
let(:params) do
{
auth_config: {
'active_directory' => {
'url' => 'localhost:389',
'role_prefix' => 'rundeck_'
}
}
}
end

it 'generates valid content for jaas-auth.conf' do
content = catalogue.resource('file', '/etc/rundeck/jaas-auth.conf')[:content]
content = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(content).to include('rolePrefix="rundeck_"')
end
end
Expand Down
2 changes: 1 addition & 1 deletion templates/realm.properties.epp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#
<%= $_auth_config['file']['realm_config']['admin_user'] %>:<%= $_auth_config['file']['realm_config']['admin_password'] %>,user,admin,architect,deploy,build
<%- if $_auth_config['file']['realm_config']['auth_users'] { -%>
<%- if is_array($_auth_config['file']['realm_config']['auth_users']) { -%>
<%- if $_auth_config['file']['realm_config']['auth_users'] =~ Array { -%>
<%- $_auth_config['file']['realm_config']['auth_users'].each |$x| { -%>
<%- if $x['username'] { -%>
<%= $x['username'] -%>:<%= $x['password'] -%>
Expand Down

0 comments on commit 956ded4

Please sign in to comment.