Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more log levels and fix job loop #535

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ The following parameters are available in the `rundeck` class:
* [`preauthenticated_config`](#-rundeck--preauthenticated_config)
* [`key_storage_config`](#-rundeck--key_storage_config)
* [`key_storage_encrypt_config`](#-rundeck--key_storage_encrypt_config)
* [`root_log_level`](#-rundeck--root_log_level)
* [`app_log_level`](#-rundeck--app_log_level)
* [`audit_log_level`](#-rundeck--audit_log_level)
* [`webhook_plugins_log_level`](#-rundeck--webhook_plugins_log_level)
* [`execution_cleanup_log_level`](#-rundeck--execution_cleanup_log_level)
* [`jaas_log_level`](#-rundeck--jaas_log_level)
* [`config_template`](#-rundeck--config_template)
* [`override_template`](#-rundeck--override_template)
* [`realm_template`](#-rundeck--realm_template)
Expand Down Expand Up @@ -430,6 +434,14 @@ An array with hashes of properties for customizing the [Rundeck Key Storage conv

Default value: `[]`

##### <a name="-rundeck--root_log_level"></a>`root_log_level`

Data type: `Rundeck::Loglevel`

The log4j root logging level to be set for Rundeck.

Default value: `'info'`

##### <a name="-rundeck--app_log_level"></a>`app_log_level`

Data type: `Rundeck::Loglevel`
Expand All @@ -446,6 +458,30 @@ The log4j logging level to be set for the Rundeck autorization.

Default value: `'info'`

##### <a name="-rundeck--webhook_plugins_log_level"></a>`webhook_plugins_log_level`

Data type: `Rundeck::Loglevel`

The log4j logging level to be set for the Rundeck plugin webhooks.

Default value: `'info'`

##### <a name="-rundeck--execution_cleanup_log_level"></a>`execution_cleanup_log_level`

Data type: `Rundeck::Loglevel`

The log4j logging level to be set for the Rundeck execution cleanup.

Default value: `'info'`

##### <a name="-rundeck--jaas_log_level"></a>`jaas_log_level`

Data type: `Rundeck::Loglevel`

The log4j logging level to be set for the Rundeck jaas security.

Default value: `'info'`

##### <a name="-rundeck--config_template"></a>`config_template`

Data type: `String[1]`
Expand Down Expand Up @@ -1065,8 +1101,9 @@ Alias of

```puppet
Struct[{
'path' => Stdlib::Absolutepath,
'format' => Enum['yaml', 'xml', 'json'],
'path' => Stdlib::Absolutepath,
'format' => Enum['yaml', 'xml', 'json'],
Optional['ensure'] => Enum['absent', 'present'],
}]
```

Expand Down
14 changes: 7 additions & 7 deletions manifests/config/project.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
environment => $rundeck::cli::environment,
onlyif => "rd jobs list -p '${name}' -J '${_name}' | grep -q '${_name}'",
}
}

exec { "Create/update rundeck job: ${_name}":
command => "rd jobs load -d update -p '${name}' -f '${_attr['path']}' -F ${_attr['format']}",
path => ['/bin', '/usr/bin', '/usr/local/bin'],
environment => $rundeck::cli::environment,
unless => "rd_job_diff.sh '${name}' '${_name}' '${_attr['path']}' ${_attr['format']}",
} else {
exec { "Create/update rundeck job: ${_name}":
command => "rd jobs load -d update -p '${name}' -f '${_attr['path']}' -F ${_attr['format']}",
path => ['/bin', '/usr/bin', '/usr/local/bin'],
environment => $rundeck::cli::environment,
unless => "rd_job_diff.sh '${name}' '${_name}' '${_attr['path']}' ${_attr['format']}",
}
}
}
}
12 changes: 12 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,18 @@
# An array with hashes of properties for customizing the [Rundeck Key Storage](https://docs.rundeck.com/docs/manual/key-storage/key-storage.html)
# @param key_storage_encrypt_config
# An array with hashes of properties for customizing the [Rundeck Key Storage converter](https://docs.rundeck.com/docs/administration/configuration/plugins/configuring.html#storage-converter-plugins)
# @param root_log_level
# The log4j root logging level to be set for Rundeck.
# @param app_log_level
# The log4j logging level to be set for the Rundeck application.
# @param audit_log_level
# The log4j logging level to be set for the Rundeck autorization.
# @param webhook_plugins_log_level
# The log4j logging level to be set for the Rundeck plugin webhooks.
# @param execution_cleanup_log_level
# The log4j logging level to be set for the Rundeck execution cleanup.
# @param jaas_log_level
# The log4j logging level to be set for the Rundeck jaas security.
# @param config_template
# The template used for rundeck-config properties. Needs to be in epp format.
# @param override_template
Expand Down Expand Up @@ -216,8 +224,12 @@
Hash $preauthenticated_config = {},
Rundeck::Key_storage_config $key_storage_config = [{ 'type' => 'db', 'path' => 'keys' }],
Array[Hash] $key_storage_encrypt_config = [],
Rundeck::Loglevel $root_log_level = 'info',
Rundeck::Loglevel $app_log_level = 'info',
Rundeck::Loglevel $audit_log_level = 'info',
Rundeck::Loglevel $webhook_plugins_log_level = 'info',
Rundeck::Loglevel $execution_cleanup_log_level = 'info',
Rundeck::Loglevel $jaas_log_level = 'info',
String[1] $config_template = 'rundeck/rundeck-config.properties.epp',
String[1] $override_template = 'rundeck/profile_overrides.epp',
String[1] $realm_template = 'rundeck/realm.properties.epp',
Expand Down
11 changes: 11 additions & 0 deletions spec/defines/config/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@
'path' => '/etc/testjob1',
'format' => 'yaml',
},
'DeleteJob1' => {
'ensure' => 'absent',
'path' => '/etc/testjob1',
'format' => 'yaml',
},
},
}
end
Expand All @@ -110,6 +115,11 @@
'TestJob1' => {
'path' => '/etc/testjob1',
'format' => 'yaml',
},
'DeleteJob1' => {
'ensure' => 'absent',
'path' => '/etc/testjob1',
'format' => 'yaml',
}
}
)
Expand All @@ -120,6 +130,7 @@
it { is_expected.to contain_exec('Create/update rundeck job: MyJob1') }
it { is_expected.to contain_exec('Create/update rundeck job: MyJob2') }
it { is_expected.to contain_exec('Create/update rundeck job: TestJob1') }
it { is_expected.to contain_exec('Remove rundeck job: DeleteJob1') }
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions templates/log4j2.properties.epp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ appender.webhooks.policies.type = Policies
appender.webhooks.policies.time.type = TimeBasedTriggeringPolicy
appender.webhooks.policies.time.interval = 1

rootLogger.level = warn
rootLogger.level = <%= $rundeck::root_log_level %>
rootLogger.appenderRef.stdout.ref = STDOUT
rootLogger.appenderRef.rundeck.ref = rundeck

Expand Down Expand Up @@ -223,12 +223,12 @@ logger.webhook_events.additivity = false
logger.webhook_events.appenderRef.webhooks.ref = webhooks

logger.webhook_plugins.name = org.rundeck.plugin.webhook
logger.webhook_plugins.level = debug
logger.webhook_plugins.level = <%= $rundeck::webhook_plugins_log_level %>
logger.webhook_plugins.additivity = false
logger.webhook_plugins.appenderRef.webhooks.ref = webhooks

logger.cleanup.name = rundeck.quartzjobs.ExecutionsCleanUp
logger.cleanup.level = debug
logger.cleanup.level = <%= $rundeck::execution_cleanup_log_level %>
logger.cleanup.additivity = false
logger.cleanup.appenderRef.cleanup.ref = cleanup

Expand All @@ -243,17 +243,17 @@ logger.hibernate.additivity = false
logger.hibernate.appenderRef.stdout.ref = STDOUT

logger.rundeck_jaas.name = com.dtolabs.rundeck.jetty.jaas
logger.rundeck_jaas.level = debug
logger.rundeck_jaas.level = <%= $rundeck::jaas_log_level %>
logger.rundeck_jaas.additivity = false
logger.rundeck_jaas.appenderRef.stdout.ref = STDOUT

logger.spring_security.name = grails.plugin.springsecurity.web.authentication.GrailsUsernamePasswordAuthenticationFilter
logger.spring_security.level = debug
logger.spring_security.level = <%= $rundeck::jaas_log_level %>
logger.spring_security.additivity = false
logger.spring_security.appenderRef.stdout.ref = STDOUT

logger.jaas.name = org.rundeck.jaas
logger.jaas.level = debug
logger.jaas.level = <%= $rundeck::jaas_log_level %>
logger.jaas.additivity = false
logger.jaas.appenderRef.stdout.ref = STDOUT

Expand Down
2 changes: 1 addition & 1 deletion templates/rundeck-config.properties.epp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
loglevel.default = <%= $rundeck::app_log_level %>
loglevel.default = <%= $rundeck::root_log_level %>
rdeck.base = <%= $rundeck::config::base_dir %>

rss.enabled = <%= $rundeck::rss_enabled %>
Expand Down
5 changes: 3 additions & 2 deletions types/job.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# @summary Rundeck job type.
type Rundeck::Job = Struct[{
'path' => Stdlib::Absolutepath,
'format' => Enum['yaml', 'xml', 'json'],
'path' => Stdlib::Absolutepath,
'format' => Enum['yaml', 'xml', 'json'],
Optional['ensure'] => Enum['absent', 'present'],
}]