Commit 1e635882 authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

Add a defined type which can be used to blank out unneeded config files

parent c4d7f9de
......@@ -10,6 +10,7 @@
* [`freeradius::status_server`](#freeradiusstatus_server)
* [Resources](#resources)
* [`freeradius::attr`](#freeradiusattr)
* [`freeradius::blank`](#freeradiusblank)
* [`freeradius::cert`](#freeradiuscert)
* [`freeradius::client`](#freeradiusclient)
* [`freeradius::config`](#freeradiusconfig)
......@@ -137,6 +138,24 @@ freeradius::attr { 'eduroamlocal':
}
```
#### `freeradius::blank`
Selectively blank certain stock config files that aren't required. This is preferable to deleting them
because the package manager will replace certain files next time the package is upgraded, potentially
causing unexpected behaviour.
The resource title should be the relative path from the FreeRADIUS config directory to the file(s) you
want to blank. You can pass multiple files in an array.
```puppet
freeradius::blank { 'sites-enabled/default': }
freeradius::blank { [
'sites-enabled/default',
'eap.conf',
]: }
```
#### `freeradius::cert`
Install certificates as provided. These are installed in `/etc/raddb/certs`. Beware that any certificates *not* deployed by Puppet will be purged from this directory.
......
# Blank unneeded config files to reduce complexity
define freeradius::blank {
$fr_package = $::freeradius::params::fr_package
$fr_service = $::freeradius::params::fr_service
$fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group
file { "${fr_basepath}/${name}":
mode => '0644',
owner => 'root',
group => $fr_group,
require => [File[${fr_basepath}], Package[$fr_package], Group[$fr_group]],
notify => Service[$fr_service],
content => "# This file is intentionally left blank to reduce complexity. Blanking it but leaving it present is safer than deleting it, since the package manager will replace some files if they are deleted, leading to unexpected behaviour!",
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment