Commit 4165bf2a authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

Add new option custom_query_file to allow custom dialup.conf

parent cdaa5e28
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -371,6 +371,8 @@ limit the number of queries performed over one socket. After `$max_qeuries`, the

##### `query_file`

**`query_file` has been deprecated - use `custom_query_file` instead**

Default: `sql/${database}/dialup.conf`. Relative path to the file which contains your SQL queries. By
default, points to the `dialup.conf` specific to your database engine, so leave this blank if you are
using stock queries.
@@ -379,6 +381,13 @@ If you need to use custom queries, it is recommended that you deploy your query
`freeradius::script` to install the file into `/etc/raddb/scripts/custom_dialup.conf` and then
set `query_file` to `scripts/custom_dialup.conf`.

##### `custom_query_file`

Default: `null`. Puppet fileserver path to a file which contains your SQL queries, i.e. `dialup.conf`. This
option is intended to be a replacment for `query_file`, which requires separate deployment of the file. This
option allows you to specify a Puppet-managed custom `dialup.conf` which is installed and loaded automatically.
`query_file` must be left blank if you use `custom_query_file`.

##### `acct_table1`

If you want both stop and start records logged to the same SQL table, leave this as is.  If you want them in
+13 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ define freeradius::sql (
  $radius_db = 'radius',
  $num_sql_socks = '${thread[pool].max_servers}',
  $query_file = 'sql/${database}/dialup.conf',
  $custom_query_file = '',
  $lifetime = '0',
  $max_queries = '0',
  $ensure = present,
@@ -85,4 +86,16 @@ define freeradius::sql (
    notify  => Service[$fr_service],
  }

  # Install custom query file
  if ($custom_query_file) {
    file { "${fr_basepath}/sql/${database}/dialup.conf":
      ensure  => $ensure,
      mode    => '0640',
      owner   => 'root',
      group   => $fr_group,
      source  => $custom_query_file,
      require => [Package[$fr_package], Group[$fr_group]],
      notify  => Service[$fr_service],
    }
  }
}