params.pp 4.33 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
      }
    }
  }

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

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

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

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

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

79
80
81
  # Default pid file location
  $fr_pidfile = "/var/run/${fr_service}/${fr_service}.pid"

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

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

119
120
121
  # Default module path
  $fr_modulepath = "${fr_basepath}/${fr_moduledir}"

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

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

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

139
140
141
  # FreeRADIUS user
  $fr_user = $::osfamily ? {
    'RedHat' => 'radiusd',
142
143
    'Debian' => 'freerad',
    default  => 'radiusd',
144
145
  }

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

  # Privileged winbind user
  $fr_wbpriv_user = $::osfamily ? {
    'RedHat' => 'wbpriv',
    'Debian' => 'winbindd_priv',
    default  => 'wbpriv',
  }
159
160
161
162
163
164

  $fr_libdir = $::osfamily ? {
    'RedHat' => '/usr/lib64/freeradius',
    'Debian' => '/usr/lib/freeradius',
    default  => '/usr/lib64/freeradius',
  }
165
166
167
168
169

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

  $radacctdir = "\${logdir}/radacct"
172
}