From b410039df8251727ff2929d78ac1af63d479adef Mon Sep 17 00:00:00 2001 From: Joris29 Date: Tue, 28 Nov 2023 07:27:07 +0100 Subject: [PATCH] Update framework config --- REFERENCE.md | 19 ++----------------- manifests/config.pp | 16 +++++++++++++++- manifests/config/framework.pp | 2 +- manifests/init.pp | 15 ++------------- 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 9bc2835c9..a7e228fda 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -352,24 +352,9 @@ 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 -Default value: - -```puppet -{ - 'rdeck.base' => '/var/lib/rundeck', - 'framework.server.hostname' => $facts['networking']['hostname'], - 'framework.server.name' => $facts['networking']['fqdn'], - 'framework.server.port' => '4440', - 'framework.server.url' => "http://${facts['networking']['fqdn']}:4440", - 'framework.etc.dir' => '/etc/rundeck', - 'framework.libext.dir' => '/var/lib/rundeck/libext', - 'framework.ssh.keypath' => '/var/lib/rundeck/.ssh/id_rsa', - 'framework.ssh.user' => 'rundeck', - 'framework.ssh.timeout' => '0', - 'rundeck.server.uuid' => fqdn_uuid($facts['networking']['fqdn']), - } -``` +Default value: `{}` ##### `gui_config` diff --git a/manifests/config.pp b/manifests/config.pp index 5b14fac8e..c7dc44906 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -5,7 +5,21 @@ class rundeck::config { assert_private() - $framework_config = $rundeck::framework_config + $_framework_defaults = { + 'rdeck.base' => '/var/lib/rundeck', + 'framework.server.hostname' => $facts['networking']['hostname'], + 'framework.server.name' => $facts['networking']['fqdn'], + 'framework.server.port' => '4440', + 'framework.server.url' => "http://${facts['networking']['fqdn']}:4440", + 'framework.etc.dir' => '/etc/rundeck', + 'framework.libext.dir' => '/var/lib/rundeck/libext', + 'framework.ssh.keypath' => '/var/lib/rundeck/.ssh/id_rsa', + 'framework.ssh.user' => 'rundeck', + 'framework.ssh.timeout' => '0', + 'rundeck.server.uuid' => fqdn_uuid($facts['networking']['fqdn']), + } + + $framework_config = $_framework_defaults + $rundeck::framework_config $base_dir = $framework_config['rdeck.base'] $properties_dir = $framework_config['framework.etc.dir'] diff --git a/manifests/config/framework.pp b/manifests/config/framework.pp index b3820f800..87c2b6f4d 100644 --- a/manifests/config/framework.pp +++ b/manifests/config/framework.pp @@ -14,7 +14,7 @@ $_framework_ssl_config = {} } - $_framework_config = deep_merge($rundeck::config::framework_config, $_framework_ssl_config) + $_framework_config = $rundeck::config::framework_config + $_framework_ssl_config file { "${rundeck::config::properties_dir}/framework.properties": ensure => file, diff --git a/manifests/init.pp b/manifests/init.pp index 823e86bf8..0be53d1ed 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -47,6 +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 # @param gui_config # Hash of properties for customizing the [Rundeck GUI](https://docs.rundeck.com/docs/administration/configuration/gui-customization.html) # @param mail_config @@ -190,19 +191,7 @@ }, }, Rundeck::Db_config $database_config = { 'url' => 'jdbc:h2:file:/var/lib/rundeck/data/rundeckdb' }, - Hash $framework_config = { - 'rdeck.base' => '/var/lib/rundeck', - 'framework.server.hostname' => $facts['networking']['hostname'], - 'framework.server.name' => $facts['networking']['fqdn'], - 'framework.server.port' => '4440', - 'framework.server.url' => "http://${facts['networking']['fqdn']}:4440", - 'framework.etc.dir' => '/etc/rundeck', - 'framework.libext.dir' => '/var/lib/rundeck/libext', - 'framework.ssh.keypath' => '/var/lib/rundeck/.ssh/id_rsa', - 'framework.ssh.user' => 'rundeck', - 'framework.ssh.timeout' => '0', - 'rundeck.server.uuid' => fqdn_uuid($facts['networking']['fqdn']), - }, + Hash $framework_config = {}, Hash $gui_config = {}, Rundeck::Mail_config $mail_config = {}, Hash $security_config = {},