params.pp 4.7 KB
Newer Older
1
2
3
# Default parameters for freeradius
class freeradius::params {

4
5
6
7
  # Make an educated guess which version of FR we are running, based on the OS
  case $::operatingsystem {
    /RedHat|CentOS/: {
      $fr_guessversion = $::operatingsystemmajrelease ? {
8
9
10
11
        5       => '2',
        6       => '2',
        7       => '3',
        default => '3',
12
13
14
15
      }
    }
    'Debian': {
      $fr_guessversion = $::operatingsystemmajrelease ? {
16
17
18
        6       => '2',
        7       => '2',
        8       => '2',
Carl Garner's avatar
Carl Garner committed
19
        9       => '3',
Carl Garner's avatar
Carl Garner committed
20
        default => '3',
21
22
23
24
      }
    }
    'Fedora': {
      $fr_guessversion = $::operatingsystemmajrelease ? {
25
26
27
28
        21      => '3',
        22      => '3',
        23      => '3',
        default => '3',
29
30
31
32
      }
    }
    'Ubuntu': {
      $fr_guessversion = $::operatingsystemmajrelease ? {
33
34
35
36
        '14.04' => '2',
        '14.10' => '2',
        '15.04' => '2',
        '15.10' => '2',
37
        '18.04' => '3',
Paul's avatar
Paul committed
38
        '20.04' => '3',
39
        default => '2',
40
41
      }
    }
42
43
44
    default: {
      fail("OS ${::operatingsystem} is not supported")
    }
45
46
47
  }

  # Use the FR version fact if defined, otherwise use our best estimate from above
48
  if getvar('::freeradius_maj_version') {
49
50
51
52
53
    $fr_version = $::freeradius_maj_version
  } else {
    $fr_version = $fr_guessversion
  }

54
55
56
57
58
59
60
  # Name of FreeRADIUS package
  $fr_package = $::osfamily ? {
    'RedHat' => 'freeradius',
    'Debian' => 'freeradius',
    default  => 'freeradius',
  }

61
62
63
64
65
66
67
  # Name of wpa_supplicant package
  $fr_wpa_supplicant = $::osfamily ? {
    'RedHat' => 'wpa_supplicant',
    'Debian' => 'wpasupplicant',
    default  => 'wpa_supplicant',
  }

68
69
70
71
72
73
74
  # Name of FreeRADIUS service
  $fr_service = $::osfamily ? {
    'RedHat' => 'radiusd',
    'Debian' => 'freeradius',
    default  => 'radiusd',
  }

75
76
77
  # Whether the FreeRADIUS init.d startup script has a status setting or not
  $fr_service_has_status = $::osfamily ? {
    'RedHat' => true,
78
    'Debian' => true,
79
80
81
    default  => false,
  }

82
83
84
  # Default pid file location
  $fr_pidfile = "/var/run/${fr_service}/${fr_service}.pid"

85
  # Default base path for FreeRADIUS configs
86
87
88
89
90
91
92
  case $::osfamily {
    'RedHat': {
      $fr_basepath = '/etc/raddb'
      $fr_raddbdir = "\${sysconfdir}/raddb"
    }
    'Debian': {
      $fr_basepath = $::operatingsystemmajrelease ? {
Olm's avatar
Olm committed
93
94
95
96
        '9'          => '/etc/freeradius/3.0',
        '10'         => '/etc/freeradius/3.0',
        'buster/sid' => '/etc/freeradius/3.0',
        '18.04'      => '/etc/freeradius/3.0',
Paul's avatar
Paul committed
97
        '20.04'      => '/etc/freeradius/3.0',
Olm's avatar
Olm committed
98
        default      => '/etc/freeradius',
99
100
      }
      $fr_raddbdir = $::operatingsystemmajrelease ? {
Olm's avatar
Olm committed
101
        '9'          => "\${sysconfdir}/freeradius/3.0",
102
103
        '10'         => "\${sysconfdir}/freeradius/3.0",
        'buster/sid' => "\${sysconfdir}/freeradius/3.0",
Olm's avatar
Olm committed
104
        '18.04'      => "\${sysconfdir}/freeradius/3.0",
Paul's avatar
Paul committed
105
        '20.04'      => "\${sysconfdir}/freeradius/3.0",
Olm's avatar
Olm committed
106
        default      => "\${sysconfdir}/freeradius",
107
108
      }
    }
109
110
111
112
    default: {
      $fr_basepath = '/etc/raddb'
      $fr_raddbdir = "\${sysconfdir}/raddb"
    }
113
114
  }

115
  # Default module dir
116
117
118
  $fr_moduledir = $fr_version ? {
    '2'       => 'modules',
    '3'       => 'mods-enabled',
119
    default   => 'modules',
120
121
  }

122
123
124
  # Default module path
  $fr_modulepath = "${fr_basepath}/${fr_moduledir}"

125
  # Default module config dir
126
127
128
  $fr_modconfigdir = $fr_version ? {
    '2'       => 'conf.d',
    '3'       => 'mods-config',
129
130
131
132
133
134
    default   => 'conf.d',
  }

  # Default module config path
  $fr_moduleconfigpath = "${fr_basepath}/${fr_modconfigdir}"

135
136
137
138
139
140
141
  # Path for FreeRADIUS logs
  $fr_logpath = $::osfamily ? {
    'RedHat' => '/var/log/radius',
    'Debian' => '/var/log/freeradius',
    default  => '/var/log/radius',
  }

142
143
144
  # FreeRADIUS user
  $fr_user = $::osfamily ? {
    'RedHat' => 'radiusd',
145
146
    'Debian' => 'freerad',
    default  => 'radiusd',
147
148
  }

149
150
151
152
153
154
  # FreeRADIUS group
  $fr_group = $::osfamily ? {
    'RedHat' => 'radiusd',
    'Debian' => 'freerad',
    default  => 'radiusd',
  }
155
156
157
158
159
160
161

  # Privileged winbind user
  $fr_wbpriv_user = $::osfamily ? {
    'RedHat' => 'wbpriv',
    'Debian' => 'winbindd_priv',
    default  => 'wbpriv',
  }
162
163
164
165
166
167

  $fr_libdir = $::osfamily ? {
    'RedHat' => '/usr/lib64/freeradius',
    'Debian' => '/usr/lib/freeradius',
    default  => '/usr/lib64/freeradius',
  }
168
169
170
171
172

  $fr_db_dir = $::osfamily ? {
    'Debian' => "\${raddbdir}",
    default  => "\${localstatedir}/lib/radiusd",
  }
173
174

  $radacctdir = "\${logdir}/radacct"
175
176
177
178
179
180
181
182
183
184

  # Default radsniff environment file location
  $fr_radsniff_envfile = $::osfamily ? {
    'RedHat' => '/etc/sysconfig/radsniff',
    'Debian' => '/etc/defaults/radsniff',
    default  => undef,
  }

  # Default radsniff pid file location
  $fr_radsniff_pidfile = "/var/run/${fr_service}/radsniff.pid"
185
}