Skip to content
Snippets Groups Projects
Select Git revision
  • 9e6ad293a29b30fe9ae96a24476af1eeebd4a95c
  • master default protected
  • main
  • update_github_actions
  • 144_rocky8_support
  • 195-update-pdk-to-300
  • 144-rocky8
  • add_test_github_test_workflow
  • pdk_2.4.0
  • fix_unclosed_let_block_in_defines_client_spec
  • validation_fixes
  • freeradius_3_0_21_config_updates
  • data_types
  • PrepareBuster
  • travis
  • 4.0.1
  • 4.0.0
  • 3.9.2
  • 3.9.1
  • 3.9.0
  • 3.8.2
  • 3.8.1
  • 3.8.0
  • 3.7.0
  • 3.6.0
  • 3.5.0
  • 3.4.3
  • 3.4.2
  • 3.4.1
  • 3.4.0
  • 3.3.0
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.3.1
35 results

init.pp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    init.pp 8.75 KiB
    # Base class to install FreeRADIUS
    class freeradius (
      $control_socket  = false,
      $max_servers     = '4096',
      $max_requests    = '4096',
      $mysql_support   = false,
      $perl_support    = false,
      $utils_support   = false,
      $ldap_support    = false,
      $wpa_supplicant  = false,
      $winbind_support = false,
      $syslog          = false,
    ) inherits freeradius::params {
    
      file { 'radiusd.conf':
        name    => "${freeradius::fr_basepath}/radiusd.conf",
        mode    => '0640',
        owner   => 'root',
        group   => $freeradius::fr_group,
        content => template('freeradius/radiusd.conf.erb'),
        require => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
        notify  => Service[$freeradius::fr_service],
      }
    
      # Create various directories
      file { [
        "${freeradius::fr_basepath}/clients.d",
        "${freeradius::fr_basepath}/statusclients.d",
        $freeradius::fr_basepath,
        "${freeradius::fr_basepath}/instantiate",
        "${freeradius::fr_basepath}/conf.d",
        "${freeradius::fr_basepath}/attr.d",
        "${freeradius::fr_basepath}/users.d",
        "${freeradius::fr_basepath}/policy.d",
        "${freeradius::fr_basepath}/dictionary.d",
        "${freeradius::fr_basepath}/scripts",
        "${freeradius::fr_basepath}/certs",
      ]:
        ensure  => directory,
        mode    => '0750',
        owner   => 'root',
        group   => $freeradius::fr_group,
        require => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
        notify  => Service[$freeradius::fr_service],
      }
    
      # Set up concat policy file, as there is only one global policy
      # We also add standard header and footer
      concat { "${freeradius::fr_basepath}/policy.conf":
        owner   => 'root',
        group   => $freeradius::fr_group,
        mode    => '0640',
        require => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
      }
      concat::fragment { 'policy_header':
        target  => "${freeradius::fr_basepath}/policy.conf",
        content => "policy {\n",
        order   => 10,
      }
      concat::fragment { 'policy_footer':
        target  => "${freeradius::fr_basepath}/policy.conf",
        content => "}\n",
        order   => '99',
      }
    
      # Install a slightly tweaked stock dictionary that includes
      # our custom dictionaries
      concat { "${freeradius::fr_basepath}/dictionary":
        owner   => 'root',
        group   => $freeradius::fr_group,