Skip to content
Snippets Groups Projects
Select Git revision
  • ll-php8-bs5
  • master default protected
  • 5.x
  • release_5_bs5
  • ll-php8
  • 4.x
  • laminas_migration
  • release_1.0.0.2
  • release_4.0.0
  • release_3.2.8
  • bootstrap4_migration
  • 1.0.0.3
  • 6.0.7
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 5.1.1
  • 6.0.0
  • 5.1.0
  • 5.0.0
  • 4.0.2
  • 3.2.11
  • 4.0.1
  • 3.2.10
  • 4.0.0
  • 1.0.0.2
  • 3.2.9
  • 3.2.8
31 results

unicaen-auth.local.php.dist

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    client.pp 1.41 KiB
    # Install FreeRADIUS clients (WISMs or testing servers)
    define freeradius::client (
      $shortname,
      $secret,
      $ip             = undef,
      $ip6            = undef,
      $virtual_server = undef,
      $nastype        = undef,
      $redirect       = undef,
      $port           = undef,
      $srcip          = undef,
      $firewall       = false,
      $ensure         = present,
    ) {
      $fr_package  = $::freeradius::params::fr_package
      $fr_service  = $::freeradius::params::fr_service
      $fr_basepath = $::freeradius::params::fr_basepath
      $fr_group    = $::freeradius::params::fr_group
    
      file { "${fr_basepath}/clients.d/${shortname}.conf":
        ensure  => $ensure,
        mode    => '0640',
        owner   => 'root',
        group   => $fr_group,
        content => template('freeradius/client.conf.erb'),
        require => [File["${fr_basepath}/clients.d"], Group[$fr_group]],
        notify  => Service[$fr_service],
      }
    
      if ($firewall and $ensure == 'present') {
        if $port {
          if $ip {
            firewall { "100-${shortname}-${port}-v4":
              proto  => 'udp',
              dport  => $port,
              action => 'accept',
              source => $ip,
            }
          } elsif $ip6 {
            firewall { "100-${shortname}-${port}-v6":
              proto    => 'udp',
              dport    => $port,
              action   => 'accept',
              provider => 'ip6tables',
              source   => $ip6,
            }
          }
        } else {
          fail('Must specify $port if you specify $firewall')
        }
      }
    }