Commit c9af2708 authored by Jonathan's avatar Jonathan Committed by GitHub
Browse files

Merge pull request #84 from paulseward/83_sites_enabled

Deploy modules and sites to their respective *-available directory
parents 39f15ec9 80f3ab1b
......@@ -25,7 +25,7 @@ define freeradius::attr (
# Reference all attribute snippets in one file
concat::fragment { "attr-${name}":
target => "${fr_modulepath}/attr_filter",
target => "${fr_basepath}/mods-available/attr_filter",
content => template('freeradius/attr.erb'),
order => 20,
}
......
......@@ -172,17 +172,21 @@ class freeradius (
}
# Set up attribute filter file
concat { "${freeradius::fr_modulepath}/attr_filter":
concat { "${freeradius::fr_basepath}/mods-available/attr_filter":
owner => 'root',
group => $freeradius::fr_group,
mode => '0640',
require => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
notify => Service[$freeradius::fr_service],
}
file { "${fr_modulepath}/attr_filter":
ensure => link,
target => "../mods-available/attr_filter",
}
# Install default attribute filters
concat::fragment { 'attr-default':
target => "${freeradius::fr_modulepath}/attr_filter",
target => "${freeradius::fr_basepath}/mods-available/attr_filter",
content => template('freeradius/attr_default.erb'),
order => 10,
}
......
......@@ -11,10 +11,11 @@ define freeradius::krb5 (
$fr_package = $::freeradius::params::fr_package
$fr_service = $::freeradius::params::fr_service
$fr_modulepath = $::freeradius::params::fr_modulepath
$fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group
# Generate a module config
file { "${fr_modulepath}/${name}":
file { "${fr_basepath}/mods-availabe/${name}":
ensure => $ensure,
mode => '0640',
owner => 'root',
......@@ -23,4 +24,8 @@ define freeradius::krb5 (
require => [Package[$fr_package], Group[$fr_group]],
notify => Service[$fr_service],
}
file { "${fr_modulepath}/${name}":
ensure => link,
target => "../mods-available/${name}",
}
}
......@@ -18,8 +18,8 @@ define freeradius::module (
target => "../mods-available/${name}",
}
} else {
# Deploy actual module to sites-enabled
file { "${fr_modulepath}/${name}":
# Deploy actual module to mods-available, and link it to mods-enabled
file { "${fr_basepath}/mods-available/${name}":
ensure => $ensure,
mode => '0640',
owner => 'root',
......@@ -29,5 +29,9 @@ define freeradius::module (
require => [Package[$fr_package], Group[$fr_group]],
notify => Service[$fr_service],
}
file { "${fr_modulepath}/${name}":
ensure => link,
target => "../mods-available/${name}",
}
}
}
......@@ -65,6 +65,7 @@ define freeradius::module::ldap (
$fr_package = $::freeradius::params::fr_package
$fr_service = $::freeradius::params::fr_service
$fr_modulepath = $::freeradius::params::fr_modulepath
$fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group
# Validate our inputs
......@@ -84,7 +85,7 @@ define freeradius::module::ldap (
}
# Generate a module config, based on ldap.conf
file { "${fr_modulepath}/${name}":
file { "${fr_basepath}/mods-available/${name}":
ensure => $ensure,
mode => '0640',
owner => 'root',
......@@ -93,4 +94,8 @@ define freeradius::module::ldap (
require => [Package[$fr_package], Group[$fr_group]],
notify => Service[$fr_service],
}
file { "${fr_modulepath}/${name}":
ensure => link,
target => "../mods-available/${name}",
}
}
......@@ -26,7 +26,7 @@ define freeradius::site (
default => undef,
}
file { "${fr_basepath}/sites-enabled/${name}":
file { "${fr_basepath}/sites-available/${name}":
ensure => $ensure,
mode => '0640',
owner => 'root',
......@@ -36,4 +36,8 @@ define freeradius::site (
require => [Package[$fr_package], Group[$fr_group]],
notify => Service[$fr_service],
}
file { "${fr_basepath}/sites-enabled/${name}":
ensure => link,
target => "${fr_basepath}/sites-available/${name}",
}
}
......@@ -108,7 +108,7 @@ define freeradius::sql (
}
# Generate a module config, based on sql.conf
file { "${fr_modulepath}/${name}":
file { "${fr_basepath}/mods-available/${name}":
ensure => $ensure,
mode => '0640',
owner => 'root',
......@@ -117,6 +117,10 @@ define freeradius::sql (
require => [Package[$fr_package], Group[$fr_group]],
notify => Service[$fr_service],
}
file { "${fr_modulepath}/${name}":
ensure => link,
target => "../mods-available/${name}",
}
# Install rotation for sqltrace if we are using it
if ($sqltrace == 'yes') {
......
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