Skip to content

Commit

Permalink
Add package_ensure option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Gazeley committed Oct 18, 2017
1 parent a99d3d3 commit 9c55aad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ Add a syslog rule (using the `saz/rsyslog` module). Default: `false`.
##### `log_auth`
Log authentication requests (yes/no). Default: `no`.

##### `package_ensure`
Choose whether the package is just installed and left (`installed`), or updated every Puppet run (`latest`). Default: `installed`

```puppet
class { 'freeradius':
max_requests => 4096,
Expand Down
19 changes: 11 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$preserve_mods = true,
$correct_escapes = true,
$manage_logpath = true,
$package_ensure = 'installed',
$radacctdir = $freeradius::params::radacctdir,
) inherits freeradius::params {

Expand All @@ -27,6 +28,8 @@
validate_re($log_destination, '^(files|syslog|stdout|stderr)$',
"log_destination value (${log_destination}) is not a valid value")

validate_re($package_ensure, '^(installed|latest)$', 'package_ensure must be one of installed, latest')

if $control_socket == true {
warning('Use of the control_socket parameter in the freeradius class is deprecated. Please use the freeradius::control_socket class instead.')
}
Expand Down Expand Up @@ -212,42 +215,42 @@

# Install FreeRADIUS packages
package { 'freeradius':
ensure => installed,
ensure => $package_ensure,
name => $freeradius::fr_package,
}
if $mysql_support {
package { 'freeradius-mysql':
ensure => installed,
ensure => $package_ensure,
}
}
if $pgsql_support {
package { 'freeradius-postgresql':
ensure => installed,
ensure => $package_ensure,
}
}
if $perl_support {
package { 'freeradius-perl':
ensure => installed,
ensure => $package_ensure,
}
}
if $utils_support {
package { 'freeradius-utils':
ensure => installed,
ensure => $package_ensure,
}
}
if $ldap_support {
package { 'freeradius-ldap':
ensure => installed,
ensure => $package_ensure,
}
}
if $krb5_support {
package { 'freeradius-krb5':
ensure => installed,
ensure => $package_ensure,
}
}
if $wpa_supplicant {
package { 'wpa_supplicant':
ensure => installed,
ensure => $package_ensure,
name => $freeradius::fr_wpa_supplicant,
}
}
Expand Down

0 comments on commit 9c55aad

Please sign in to comment.