uniak/puppet-networkdevice

View on GitHub
lib/puppet/type/cisco_aaa_group.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'puppet/util/monkey_patches_ios'
require 'puppet/util/host_prop'

Puppet::Type.newtype(:cisco_aaa_group) do
  @doc = "This represents an Authentication, Authorization and Accounting group."

  extend Puppet::Util::HostProp

  apply_to_device

  ensurable

  newparam(:name) do
    desc "The configuration's name. Must always be 'running'."
    isnamevar
    newvalues(/^\w+$/)
  end

  newproperty(:protocol) do
    desc "The URL at which the router or switch can be reached."
    isrequired
    newvalues(:radius, :tacacs)
  end

  newproperty(:hostname) do
    desc "The hostname of the switch."
    newvalues(/^\S+$/)
  end

  newhostprop(:server) do
    desc "The hostname or ip address of this server."
    defaultto :absent
  end

  newproperty(:acct_port) do
    desc "UDP port for RADIUS accounting server."
    newvalues(:absent, /^\d+$/)
    defaultto :absent
  end

  newproperty(:auth_port) do
    desc "UDP port for RADIUS authentication server."
    newvalues(:absent, /^\d+$/)
    defaultto :absent
  end

  newproperty(:local_authentication) do
    desc "Whether to use this server group for local login authentication"
    newvalues(:true, :false)
    defaultto :false
  end

  newproperty(:local_authorization) do
    desc "Whether to use this server group for local login authorization"
    newvalues(:true, :false)
    defaultto :false
  end
end