params.pp 3.96 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
19
        6       => '2',
        7       => '2',
        8       => '2',
        default => '2',
20
21
22
23
      }
    }
    'Fedora': {
      $fr_guessversion = $::operatingsystemmajrelease ? {
24
25
26
27
        21      => '3',
        22      => '3',
        23      => '3',
        default => '3',
28
29
30
31
      }
    }
    'Ubuntu': {
      $fr_guessversion = $::operatingsystemmajrelease ? {
32
33
34
35
        '14.04' => '2',
        '14.10' => '2',
        '15.04' => '2',
        '15.10' => '2',
36
        '18.04' => '3',
37
        default => '2',
38
39
40
41
42
      }
    }
  }

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

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

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

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

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

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

80
  # Default base path for FreeRADIUS configs
81
82
83
84
85
86
87
88
  case $::osfamily {
    'RedHat': {
      $fr_basepath = '/etc/raddb'
      $fr_raddbdir = "\${sysconfdir}/raddb"
    }
    'Debian': {
      $fr_basepath = $::operatingsystemmajrelease ? {
        '9'     => '/etc/freeradius/3.0',
89
90
91
92
        '18.04'     => '/etc/freeradius/3.0',
        default => '/etc/freeradius',
      }
      $fr_raddbdir = $::operatingsystemmajrelease ? {
Mårtensson Roger's avatar
Mårtensson Roger committed
93
        '9'     => "\${sysconfdir}/freeradius/3.0",
94
95
96
97
        '18.04'     => "\${sysconfdir}/freeradius/3.0",
        default => "\${sysconfdir}/freeradius",
      }
    }
98
99
100
101
    default: {
      $fr_basepath = '/etc/raddb'
      $fr_raddbdir = "\${sysconfdir}/raddb"
    }
102
103
  }

104
  # Default module dir
105
106
107
  $fr_moduledir = $fr_version ? {
    '2'       => 'modules',
    '3'       => 'mods-enabled',
108
    default   => 'modules',
109
110
  }

111
112
113
  # Default module path
  $fr_modulepath = "${fr_basepath}/${fr_moduledir}"

114
  # Default module config dir
115
116
117
  $fr_modconfigdir = $fr_version ? {
    '2'       => 'conf.d',
    '3'       => 'mods-config',
118
119
120
121
122
123
    default   => 'conf.d',
  }

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

124
125
126
127
128
129
130
  # Path for FreeRADIUS logs
  $fr_logpath = $::osfamily ? {
    'RedHat' => '/var/log/radius',
    'Debian' => '/var/log/freeradius',
    default  => '/var/log/radius',
  }

131
132
133
  # FreeRADIUS user
  $fr_user = $::osfamily ? {
    'RedHat' => 'radiusd',
134
135
    'Debian' => 'freerad',
    default  => 'radiusd',
136
137
  }

138
139
140
141
142
143
  # FreeRADIUS group
  $fr_group = $::osfamily ? {
    'RedHat' => 'radiusd',
    'Debian' => 'freerad',
    default  => 'radiusd',
  }
144
145
146
147
148
149
150

  # Privileged winbind user
  $fr_wbpriv_user = $::osfamily ? {
    'RedHat' => 'wbpriv',
    'Debian' => 'winbindd_priv',
    default  => 'wbpriv',
  }
151
152
153
154
155
156

  $fr_libdir = $::osfamily ? {
    'RedHat' => '/usr/lib64/freeradius',
    'Debian' => '/usr/lib/freeradius',
    default  => '/usr/lib64/freeradius',
  }
157
158
159
160
161

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

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