Defined Type: rtadvd::interface

Defined in:
manifests/interface.pp

Overview

Configure advertisements on an interface.

Examples:

Advertise on an interface with the other flag set

include ::rtadvd
::rtadvd::interface { 'em0':
  other_configuration => true,
}

Parameters:

  • dnssl (Optional[Array[Bodgitlib::Domain, 1]]) (defaults to: undef)

    An array of DNS search suffixes.

  • dnssl_lifetime (Optional[Integer[0]]) (defaults to: undef)

    Validity of the DNS search suffixes.

  • interface (String) (defaults to: $title)

    The interface name.

  • managed_configuration (Boolean) (defaults to: false)

    Whether to enable the managed configuration flag in advertisements, (i.e. use DHCPv6 exclusively).

  • max_interval (Optional[Integer[4, 1800]]) (defaults to: undef)

    The maximum time allowed between sending unsolicited advertisements.

  • min_interval (Optional[Integer[3, 1350]]) (defaults to: undef)

    The minimum time allowed between sending unsolicited advertisements.

  • other_configuration (Boolean) (defaults to: false)

    Whether to enable the other configuration flag in advertisements, (i.e. use SLAAC for address configuration and DHCPv6 for things like DNS servers, etc.).

  • rdnss (Optional[Array[IP::Address::V6::NoSubnet, 1]]) (defaults to: undef)

    An array of recursive DNS servers.

  • rdnss_lifetime (Optional[Integer[0]]) (defaults to: undef)

    Validity of the recursive DNS servers.

See Also:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'manifests/interface.pp', line 25

define rtadvd::interface (
  String                                        $interface             = $title,
  Boolean                                       $managed_configuration = false,
  Boolean                                       $other_configuration   = false,
  Optional[Array[Bodgitlib::Domain, 1]]         $dnssl                 = undef,
  Optional[Integer[0]]                          $dnssl_lifetime        = undef,
  Optional[Integer[4, 1800]]                    $max_interval          = undef,
  Optional[Integer[3, 1350]]                    $min_interval          = undef,
  Optional[Array[IP::Address::V6::NoSubnet, 1]] $rdnss                 = undef,
  Optional[Integer[0]]                          $rdnss_lifetime        = undef,
) {

  case $::osfamily {
    'OpenBSD': {

      $managed_raflag = $managed_configuration ? {
        true    => 128,
        default => 0,
      }
      $other_raflag = $other_configuration ? {
        true    => 64,
        default => 0,
      }

      $raflags = $managed_raflag + $other_raflag

      # Turn parameters into an array of termcap-style capabilities
      $capabilities = delete_undef_values([
        $raflags ? {
          0       => undef,
          default => "raflags#${raflags}",
        },
        $max_interval ? {
          undef   => undef,
          default => "maxinterval#${max_interval}",
        },
        $min_interval ? {
          undef   => undef,
          default => "mininterval#${min_interval}",
        },
        $rdnss ? {
          undef   => undef,
          default => "rdnss=\"${join($rdnss, ',')}\"",
        },
        $rdnss_lifetime ? {
          undef   => undef,
          default => "rdnssltime#${rdnss_lifetime}",
        },
        $dnssl ? {
          undef   => undef,
          default => "dnssl=\"${join($dnssl, ',')}\"",
        },
        $dnssl_lifetime ? {
          undef   => undef,
          default => "dnsslltime#${dnssl_lifetime}",
        },
      ])

      ::concat::fragment { "rtadvd interface ${interface}":
        content => template('rtadvd/rtadvd.erb'),
        target  => $::rtadvd::conf_file,
      }

      datacat_fragment { "rtadvd interface ${interface}":
        target => 'rtadvd interfaces',
        data   => {
          'interface' => [$interface],
        },
      }
    }
    'RedHat': {

      ::concat::fragment { "rtadvd interface ${interface}":
        content => template('rtadvd/radvd.erb'),
        target  => $::rtadvd::conf_file,
      }
    }
    default: {
      # noop
    }
  }
}