Skip to content

Commit

Permalink
Update specs reference and config templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris29 committed Nov 28, 2023
1 parent b410039 commit 0ab1c4c
Show file tree
Hide file tree
Showing 18 changed files with 369 additions and 372 deletions.
2 changes: 0 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
inifile: "https://github.com/puppetlabs/puppetlabs-inifile.git"
archive: "https://github.com/puppet-community/puppet-archive.git"
dirtree: "https://github.com/puppetlabs/pltraining-dirtree.git"
java_ks: "https://github.com/puppetlabs/puppetlabs-java_ks.git"
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
yumrepo_core:
Expand Down
8 changes: 4 additions & 4 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,14 @@ Default value:
```puppet
{
'file' => {
'auth_flag' => 'required',
'jaas_config' => {
'auth_flag' => 'required',
'jaas_config' => {
'file' => '/etc/rundeck/realm.properties',
},
'realm_config' => {
'admin_user' => 'admin',
'admin_password' => 'admin',
'auth_users' => {},
'auth_users' => [],
},
},
}
Expand All @@ -352,7 +352,7 @@ Default value: `{ 'url' => 'jdbc:h2:file:/var/lib/rundeck/data/rundeckdb' }`
Data type: `Hash`

Hash of properties for configuring the [Rundeck Framework](https://docs.rundeck.com/docs/administration/configuration/config-file-reference.html#framework-properties)
This hash will be merged some [defaults](https://github.com/voxpupuli/puppet-rundeck/blob/ffcc77ea943f2ee52257004ec6385ab3a3aa6f91/manifests/config.pp#L8C12-L8C12) # TODO: Update ref
This hash will be merged with the [Rundeck defaults](https://github.com/voxpupuli/puppet-rundeck/blob/4eb3f4158f49cd1176090897aa88098f1e4507ab/manifests/config.pp#L8-L20) # TODO: Update ref

Default value: `{}`

Expand Down
5 changes: 4 additions & 1 deletion manifests/config/jaas_auth.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@

file { "${rundeck::config::properties_dir}/jaas-loginmodule.conf":
ensure => file,
content => Sensitive(epp('rundeck/jaas-auth.conf.epp', { _auth_config => $_auth_config, _ldap_login_module => $_ldap_login_module })),
content => Sensitive(epp('rundeck/jaas-loginmodule.conf.epp', {
'_auth_config' => $_auth_config,
'_ldap_login_module' => $_ldap_login_module
})),
mode => '0400',
}
}
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# Hash of properties for configuring the [Rundeck Database](https://docs.rundeck.com/docs/administration/configuration/database)
# @param framework_config
# Hash of properties for configuring the [Rundeck Framework](https://docs.rundeck.com/docs/administration/configuration/config-file-reference.html#framework-properties)
# This hash will be merged some [defaults](https://github.com/voxpupuli/puppet-rundeck/blob/ffcc77ea943f2ee52257004ec6385ab3a3aa6f91/manifests/config.pp#L8C12-L8C12) # TODO: Update ref
# This hash will be merged with the [Rundeck defaults](https://github.com/voxpupuli/puppet-rundeck/blob/4eb3f4158f49cd1176090897aa88098f1e4507ab/manifests/config.pp#L8-L20) # TODO: Update ref
# @param gui_config
# Hash of properties for customizing the [Rundeck GUI](https://docs.rundeck.com/docs/administration/configuration/gui-customization.html)
# @param mail_config
Expand Down Expand Up @@ -179,14 +179,14 @@
Integer $quartz_job_threadcount = 10,
Rundeck::Auth_config $auth_config = {
'file' => {
'auth_flag' => 'required',
'jaas_config' => {
'auth_flag' => 'required',
'jaas_config' => {
'file' => '/etc/rundeck/realm.properties',
},
'realm_config' => {
'admin_user' => 'admin',
'admin_password' => 'admin',
'auth_users' => {},
'auth_users' => [],
},
},
},
Expand Down
1 change: 0 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
uid => $rundeck::user_id,
gid => $rundeck::group_id,
system => true,
before => File['/var/rundeck'],
}

if $rundeck::user != 'rundeck' {
Expand Down
55 changes: 0 additions & 55 deletions spec/classes/config/aclpolicyfile_spec.rb

This file was deleted.

48 changes: 21 additions & 27 deletions spec/classes/config/framework_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@
require 'spec_helper'

describe 'rundeck' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
facts
end
let(:facts) { os_facts }

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

framework_details = {
'framework.server.name' => 'foo.example.com',
'framework.server.hostname' => 'foo.example.com',
'framework.server.hostname' => 'foo',
'framework.server.port' => '4440',
'framework.server.url' => 'http://foo.example.com:4440',
'framework.server.username' => 'admin',
'framework.server.password' => 'admin',
'framework.etc.dir' => '/etc/rundeck',
'framework.libext.dir' => '/var/lib/rundeck/libext',
'framework.ssh.keypath' => '/var/lib/rundeck/.ssh/id_rsa',
Expand All @@ -36,30 +32,28 @@
end
end

context 'add plugin configuration' do
describe 'add plugin configuration for the logstash plugin' do
let(:params) do
{
framework_config: {
'framework.plugin.StreamingLogWriter.LogstashPlugin.port' => '9700'
}
context 'add plugin configuration for the logstash plugin' do
let(:params) do
{
framework_config: {
'framework.plugin.StreamingLogWriter.LogstashPlugin.port' => '9700'
}
end
}
end

it 'generates valid content for framework.properties' do
content = catalogue.resource('file', '/etc/rundeck/framework.properties')[:content]
expect(content).to include('framework.server.name = foo.example.com')
expect(content).to include('framework.plugin.StreamingLogWriter.LogstashPlugin.port = 9700')
end
it 'generates valid content for framework.properties' do
content = catalogue.resource('file', '/etc/rundeck/framework.properties')[:content]
expect(content).to include('framework.server.name = foo.example.com')
expect(content).to include('framework.plugin.StreamingLogWriter.LogstashPlugin.port = 9700')
end
end

context 'setting framework.server.{port,url}' do
describe 'with non-default framework.server.hostname' do
context 'setting framework.server.{name,url}' do
context 'with non-default framework.server.hostname' do
let(:params) do
{
framework_config: {
'framework.server.hostname' => 'rundeck.example.com'
'framework.server.url' => 'rundeck.example.com'
}
}
end
Expand All @@ -71,7 +65,7 @@
end
end

describe 'ssl_enabled with non-default SSL port' do
context 'ssl_enabled with non-default SSL port' do
let(:params) do
{
ssl_enabled: true,
Expand All @@ -86,13 +80,13 @@
end
end

describe 'ssl_enabled with non-default framework.server.hostname' do
context 'ssl_enabled with non-default framework.server.hostname' do
let(:params) do
{
ssl_enabled: true,
ssl_port: 443,
framework_config: {
'framework.server.hostname' => 'rundeck.example.com'
'framework.server.name' => 'rundeck.example.com'
}
}
end
Expand Down
Loading

0 comments on commit 0ab1c4c

Please sign in to comment.