Skip to content

Commit

Permalink
Added option to delete the cron.deny file when $manage_users_deny is …
Browse files Browse the repository at this point in the history
…true.
  • Loading branch information
bschonec committed Aug 26, 2024
1 parent a9a0d41 commit 08da145
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ The following parameters are available in the `cron` class:
* [`crontab_run_parts`](#-cron--crontab_run_parts)
* [`file_mode`](#-cron--file_mode)
* [`dir_mode`](#-cron--dir_mode)
* [`cron_users_deny_ensure`](#-cron--cron_users_deny_ensure)
* [`package_ensure`](#-cron--package_ensure)

##### <a name="-cron--service_name"></a>`service_name`
Expand Down Expand Up @@ -246,6 +247,14 @@ The file mode for the cron directories

Default value: `'0755'`

##### <a name="-cron--cron_users_deny_ensure"></a>`cron_users_deny_ensure`

Data type: `Enum['file', 'absent']`

The state of the cron.deny file when $manage_users_deny is true.

Default value: `'file'`

##### <a name="-cron--package_ensure"></a>`package_ensure`

Data type: `Cron::Package_ensure`
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# @param crontab_run_parts Define sadditional cron::run_parts resources
# @param file_mode The file mode for the system crontab file
# @param dir_mode The file mode for the cron directories
# @param cron_users_deny_ensure The state of the cron.deny file when $manage_users_deny is true.
#
# @example simply include the module
# include cron
Expand Down Expand Up @@ -49,6 +50,7 @@
Cron::Run_parts $crontab_run_parts = {},
Stdlib::Filemode $file_mode = '0644',
Stdlib::Filemode $dir_mode = '0755',
Enum['file', 'absent'] $cron_users_deny_ensure = 'file',
) {
contain 'cron::install'
contain 'cron::service'
Expand All @@ -58,7 +60,7 @@
# Manage cron.allow and cron.deny
if $manage_users_allow {
file { '/etc/cron.allow':
ensure => file,
ensure => $cron_users_deny_ensure,
mode => $allow_deny_mode,
owner => 'root',
group => 0,
Expand Down

0 comments on commit 08da145

Please sign in to comment.