netdev_stdlib
Version information
This version is compatible with:
- , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppetlabs-netdev_stdlib', '0.23.0'
Learn more about managing modules with a PuppetfileDocumentation
Network Device Standard Library
Overview
This module implements the type specification for the network device support program. The goal of this module is to provide the Puppet types for writing provider implementations of these types for a specific network device model.
The modules supports legacy Puppet and Resource API versions of the types.
Both versions of the types perform the same in the catalog, but stricter type checking is enabled with RSAPI versions.
Only one version can be loaded into an environment at a time. On the master, RSAPI version of the types will always be loaded when Resource API gem is present. This will be the default behavior in future versions of Puppet.
On the agent, legacy types will be loaded if the operatingsystem is aristaeos or ios_xr
, otherwise RSAPI version is loaded.
Reference Information
The following reference material is useful when developing providers for the types implemented in this module.
- Resource API
- Puppet Types and Providers by Dan Bode & Nan Liu
- Custom Types Documentation
- Seriously, What is this Provider Doing? Useful for an in-depth explanation of the instances class method for each provider.
Reference
Resource types
banner
: Configure banners for network devicesnetwork_dns
: Configure DNS settings for network devicesnetwork_interface
: Manage physical network interfaces, e.g. Ethernet1network_snmp
: Manage snmp location, contact and enable SNMP on the devicenetwork_trunk
: Ethernet logical (switch-port) interface. Configures VLAN trunking.network_vlan
: Manage VLAN's. Layer-2 VLAN's are managed by this resource type.ntp_auth_key
: NTP Authentication keysntp_config
: Global configuration for the NTP systemntp_server
: Specify an NTP serverport_channel
: Network Device Link Aggregation Groupradius
: Enable or disable radius functionalityradius_global
: Configure global radius settingsradius_server
: Configure a radius serverradius_server_group
: Configure a radius server groupsnmp_community
: Manage the SNMP communitysnmp_notification
: Enable or disable notification groups and eventssnmp_notification_receiver
: Manage an SNMP notification receiversnmp_user
: Set the SNMP contact namesyslog_facility
: Configure severity levels for global syslog facilitiessyslog_server
: Configure a remote syslog server for loggingsyslog_settings
: Configure global syslog settingstacacs
: Enable or disable tacacs functionalitytacacs_global
: Configure global tacacs settingstacacs_server
: Configure a tacacs servertacacs_server_group
: Configure a tacacs server groupvrf
: Configure a VRF
Deprecated resource types
The following types have been replaced by network_dns
domain_name
: Default domain name to append to the device hostnamename_server
: Configure the resolver to use the specified DNS serversearch_domain
: DNS suffix to search for FQDN entries
banner
Set various banners on the device, for example motd.
attributes
The following attributes are available in the banner
type.
name
namevar
The friendly name for banner settings, it is set to default.
Default value: default.
motd
The MOTD banner.
login
The Login banner.
exec
The EXEC banner.
domain_name
Deprecated - Default domain name to append to the device hostname.
Properties
The following properties are available in the domain_name
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
Parameters
The following parameters are available in the domain_name
type.
name
namevar
The domain name of the device.
name_server
Deprecated - Configure the resolver to use the specified DNS server.
Properties
The following properties are available in the name_server
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
Parameters
The following parameters are available in the name_server
type.
name
namevar
The hostname or address of the DNS server.
network_dns
Configure DNS settings for network devices.
Properties
The following properties are available in the network_dns
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
domain
The default domain name to add to the device hostname.
hostname
The hostname of the device
search
Array of DNS suffixes to search for FQDN entries.
servers
Array of DNS servers to use for name resolution.
Parameters
The following parameters are available in the network_dns
type.
name
namevar
Name, generally "settings". Not used to manage the resource.
network_interface
Manage physical network interfaces, for example, Ethernet1.
Properties
The following properties are available in the network_interface
type.
enable
Valid values: true
, false
Enable the interface, true or false.
description
Interface physical port description.
mtu
Interface Maximum Transmission Unit in bytes.
speed
Valid values: auto, 1g, 10g, 40g, 56g, 100g, 100m, 10m.
Link speed [auto*|10m|100m|1g|10g|40g|56g|100g].
duplex
Valid values: auto, full, half.
Duplex mode [auto*|full|half].
Parameters
The following parameters are available in the network_interface
type.
name
namevar
Interface Name, for example, Ethernet1.
network_snmp
Manage snmp location. Contact and enable SNMP on the device.
Properties
The following properties are available in the network_snmp
type.
enable
Valid values: true
, false
Enable or disable SNMP functionality [true|false].
contact
The contact name for this device.
location
The location of this device.
Parameters
The following parameters are available in the network_snmp
type.
name
namevar
The name of the Puppet resource — not used to manage the device.
network_trunk
Ethernet logical (switch-port) interface. Configures VLAN trunking.
Properties
The following properties are available in the network_trunk
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
encapsulation
Valid values: dot1q, isl, negotiate, none.
The vlan-tagging encapsulation protocol, usually dot1q.
mode
Valid values: access, trunk, dynamic_auto, dynamic_desirable.
The L2 interface mode, enables or disables trunking.
untagged_vlan
VLAN used for untagged VLAN traffic. a.k.a Native VLAN.
tagged_vlans
Array of VLAN names used for tagged packets.
pruned_vlans
Array of VLAN ID numbers used for VLAN pruning.
Parameters
The following parameters are available in the network_trunk
type.
name
namevar
The switch interface name, for example, Ethernet1.
network_vlan
Manage VLAN's. Layer-2 VLAN's are managed by this resource type.
Properties
The following properties are available in the network_vlan
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
vlan_name
The VLAN name, for example, VLAN100.
shutdown
Valid values: true
, false
VLAN shutdown if true, not shutdown if false.
description
The VLAN Description, for example, 'Engineering'.
Parameters
The following parameters are available in the network_vlan
type.
id
The VLAN ID, for example, 100.
ntp_auth_key
NTP Authentication keys.
Properties
The following properties are available in the ntp_auth_key
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
algorithm
Valid values: md5, sha1, sha256.
Hash algorithm [md5|sha1|sha256].
mode
Password mode [0 (plain) | 7 (encrypted)].
password
Password text
Parameters
The following parameters are available in the ntp_auth_key
type.
name
namevar
Authentication key ID.
ntp_config
Global configuration for the NTP system.
Properties
The following properties are available in the ntp_config
type.
authenticate
Valid values: true
, false
.
NTP authentication enabled [true|false].
source_interface
The source interface for the NTP system.
trusted_key
Array of global trusted-keys. Contents can be a String or Integers.
Parameters
The following parameters are available in the ntp_config
type.
name
namevar
Resource name — not used to configure the device.
ntp_server
Specify an NTP server.
Properties
The following properties are available in the ntp_server
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
key
Authentication key ID.
maxpoll
The maximul poll interval.
minpoll
The minimum poll interval.
prefer
Valid values: true
, false
.
Prefer this NTP server [true|false].
source_interface
The source interface used to reach the NTP server.
vrf
The VRF instance this server is bound to.
Parameters
The following parameters are available in the ntp_server
type.
name
namevar
The hostname or address of the NTP server.
port_channel
Network Device Link Aggregation Group.
Properties
The following properties are available in the port_channel
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
id
Channel Group ID, for example, 10.
description
Port Channel description.
mode
Valid values: active, passive, disabled.
LACP mode [ passive | active | disabled* ]
interfaces
Array of Physical Interfaces.
minimum_links
Number of active links required for LAG to be up.
speed
Valid values: auto, 1g, 10g, 40g, 56g, 100g, 100m, 10m.
Link speed [auto*|10m|100m|1g|10g|40g|56g|100g].
duplex
Valid values: auto, full, half.
Duplex mode [auto*|full|half].
flowcontrol_send
Valid values: desired, on, off.
Flow control (send) [desired|on|off].
flowcontrol_receive
Valid values: desired, on, off.
Flow control (receive) [desired|on|off].
Parameters
The following parameters are available in the port_channel
type.
name
namevar
LAG Name.
force
Valid values: true
, false
Force configuration (true / false).
radius
Enable or disable radius functionality.
Properties
The following properties are available in the radius
type.
enable
Valid values: true
, false
Enable or disable radius functionality [true|false].
Parameters
The following parameters are available in the radius
type.
name
namevar
Resource name — not used to manage the device.
radius_global
Configure global radius settings.
Properties
The following properties are available in the radius_global
type.
enable
Valid values: true
, false
.
Enable or disable radius functionality [true|false].
key
Encryption key (plaintext or in hash form depending on key_format).
key_format
Encryption key format [0-7].
retransmit_count
How many times to retransmit or 'unset' (Cisco Nexus only)
source_interface
The source interface used for RADIUS packets (array of strings for multiple).
timeout
Number of seconds before the timeout period ends or 'unset' (Cisco Nexus only)f
vrf
The VRF associated with source_interface (array of strings for multiple).
Parameters
The following parameters are available in the radius_global
type.
name
namevar
Resource identifier — not used to manage the device.
radius_server
Configure a radius server.
Properties
The following properties are available in the radius_server
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
hostname
The hostname or address of the radius server.
auth_port
Port number to use for authentication.
acct_port
Port number to use for accounting.
key
Encryption key (plaintext or in hash form depending on key_format).
key_format
Encryption key format [0-7].
group
Server group associated with this server.
deadtime
Number of minutes to ignore an unresponsive server.
timeout
Number of seconds before the timeout period ends.
vrf
Interface to send syslog data from, for example, "management".
source_interface
Source interface to send syslog data from, for example, "ethernet 2/1".
retransmit_count
How many times to retransmit.
accounting_only
Valid values: true
, false
.
Enable this server for accounting only.
authentication_only
Valid values: true
, false
.
Enable this server for authentication only.
Parameters
The following parameters are available in the radius_server
type.
name
namevar
The name of the radius server.
radius_server_group
Configure a radius server group.
Properties
The following properties are available in the radius_server_group
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
servers
Array of servers associated with this group.
Parameters
The following parameters are available in the radius_server_group
type.
name
namevar
The name of the radius server group.
search_domain
Deprecated - DNS suffix to search for FQDN entries.
Properties
The following properties are available in the search_domain
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
Parameters
The following parameters are available in the search_domain
type.
name
namevar
The search domain to configure in the resolver.
snmp_community
Manage the SNMP community.
Properties
The following properties are available in the snmp_community
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
group
The SNMP group for this community.
acl
The ACL name to associate with this community string.
Parameters
The following parameters are available in the snmp_community
type.
name
namevar
The name of the community, for example, "public" or "private".
snmp_notification
Enable or disable notification groups and events.
Properties
The following properties are available in the snmp_notification
type.
enable
Valid values: true
, false
.
Enable or disable the notification [true|false].
Parameters
The following parameters are available in the snmp_notification
type.
name
namevar
The notification name or "all" for all notifications.
snmp_notification_receiver
Manage an SNMP notification receiver.
Properties
The following properties are available in the snmp_notification_receiver
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
port
SNMP UDP port number.
username
version
Valid values: v1, v2, v3.
SNMP version [v1|v2|v3].
type
Valid values: traps, informs.
The type of receiver [traps|informs].
security
Valid values: auth, noauth, priv.
SNMPv3 security mode.
vrf
Interface to send SNMP data from, for example, "management".
source_interface
Source interface to send SNMP data from, for example, "ethernet 2/1".
Parameters
The following parameters are available in the snmp_notification_receiver
type.
name
namevar
Hostname or IP address of the receiver.
snmp_user
Set the SNMP contact name.
Properties
The following properties are available in the snmp_user
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
version
Valid values: v1, v2, v2c, v3.
SNMP version [v1|v2|v2c|v3].
roles
A list of roles associated with this SNMP user.
auth
Valid values: md5, sha.
Authentication mode [md5|sha].
password
Cleartext password for the user.
privacy
Valid values: aes128, des
Privacy encryption method [aes128|des].
private_key
Private key in hexadecimal string.
engine_id
Necessary if the SNMP engine is encrypting data.
Parameters
The following parameters are available in the snmp_user
type.
name
namevar
The name of the SNMP user.
localized_key
Valid values: true
, false
If true, password needs to be a hexadecimal value.
enforce_privacy
Valid values: true
, false
If true, message encryption is enforced.
syslog_facility
Configure severity levels for global syslog facilities.
Properties
The following properties are available in the syslog_facility
type.
level
Syslog severity level to log.
Parameters
The following parameters are available in the syslog_facility
type.
name
namevar
Global facility to manage
syslog_server
Configure a remote syslog server for logging.
Properties
The following properties are available in the syslog_server
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
port
Port number of remote syslog server.
severity_level
Syslog severity level to log.
vrf
Interface to send syslog data from, for example, "management".
source_interface
Source interface to send syslog data from, for example, "ethernet 2/1".
Parameters
The following parameters are available in the syslog_server
type.
name
namevar
The hostname or address of the remote syslog server.
syslog_settings
Configure global syslog settings.
Properties
The following properties are available in the syslog_settings
type.
enable
Valid values: true
, false
.
Enable or disable syslog logging [true|false].
console
Console logging severity level [0-7] or 'unset'.
monitor
Monitor (terminal) logging severity level [0-7] or 'unset'.
source_interface
Source interface to send syslog data from, for example, "ethernet 2/1" (array of strings for multiple).
time_stamp_units
Valid values: seconds, milliseconds.
The unit to log time values in.
vrf
The VRF associated with source_interface (array of strings for multiple).
logfile_severity_level
Logfile severity level [0-7] or 'unset'
logfile_name
Logfile file name to use or 'unset'
logfile_size
Logging file maximum size or 'unset'
buffered_severity_level
Buffered log severity level [0-7] or 'unset'
buffered_size
Logging buffer size or 'unset'
Parameters
The following parameters are available in the syslog_settings
type.
name
namevar
Resource name — not used to configure the device.
tacacs
Enable or disable tacacs functionality.
Properties
The following properties are available in the tacacs
type.
enable
Valid values: true
, false
.
Enable or disable tacacs functionality [true|false].
Parameters
The following parameters are available in the tacacs
type.
name
namevar
Resource name — not used to manage the device.
tacacs_global
Configure global tacacs settings.
Properties
The following properties are available in the tacacs_global
type.
enable
Valid values: true
, false
.
Enable or disable radius functionality [true|false].
key
Encryption key (plaintext or in hash form depending on key_format).
key_format
Encryption key format [0-7].
retransmit_count
How many times to retransmit or 'unset' (Cisco Nexus only)
source_interface
The source interface used for TACACS packets (array of strings for multiple).
timeout
Number of seconds before the timeout period ends or 'unset' (Cisco Nexus only)
vrf
The VRF associated with source_interface (array of strings for multiple).
directed_request
Valid values: true
, false
.
Whether to allow users to specify tacacs server to use with `@server'.
Parameters
The following parameters are available in the tacacs_global
type.
name
namevar
Resource identifier — not used to manage the device.
tacacs_server
Configure a tacacs server.
Properties
The following properties are available in the tacacs_server
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present.
hostname
The hostname or address of the tacacs server.
single_connection
Valid values: true
, false
Enable or disable session multiplexing [true|false].
vrf
Specifies the VRF instance used to communicate with the server.
port
The port of the tacacs server.
key
Encryption key (plaintext or in hash form depending on key_format).
key_format
Encryption key format [0-7].
timeout
Number of seconds before the timeout period ends.
group
Server group associated with this server.
Parameters
The following parameters are available in the tacacs_server
type.
name
namevar
The name of the tacacs server group.
tacacs_server_group
Configure a tacacs server group.
Properties
The following properties are available in the tacacs_server_group
type.
ensure
Valid values: present, absent.
The basic property that the resource should be in.
Default value: present
servers
Array of servers associated with this group.
source_interface
The source interface used for TACACS packets.
vrf
The VRF associated with source_interface.
Parameters
The following parameters are available in the tacacs_server_group
type.
name
namevar
The name of the tacacs server group.
vrf
Configure a VRF.
Parameters
The following parameters are available in the vrf
type.
name
namevar
The name of the VRF.
route_distinguisher
Optional[String]
Address qualifier for the VRF, used to amintain uniqueness among identical routes.
route_target
Optional[Array[Tuple[Enum["export", "import", "both"], String]]]
Address qualifier for the VRF, used to share routes between multiple VRFs.
import_map
Optional[String]
Associates a route map with the VRF.
Getting Started for Development
This section describes how to get started developing providers for the types implemented in this module.
First, configure a Ruby development environment. There are multiple ways to accomplish this task including rvm, rbenv, and crossfader. This module has been developed using crossfader, a pre-packaged build of multiple Ruby versions specifically designed for developing and extending Puppet.
Install Crossfader
Please follow the Crossfader Quick Start instructions to get started with crossfader on Mac OS X.
Set the ruby environment
Once crossfader is installed, select the version of Ruby currently shipping with Puppet Enterprise. At the time of writing this is currently Ruby 1.9.3-p484. Information on the current version of Ruby shipping with Puppet Enterprise is available at Puppet Enterprise Software Components.
$ eval "$(crossfader --ruby 1.9.3-p484 --gemset netdev shellinit)"
Once initialized, verify the environment is using the specified version of ruby
with the gem env
command.
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-darwin13.0.0]
- INSTALLATION DIRECTORY: /opt/crossfader/versions/ruby/1.9.3-p484/gemsets/netdev/ruby/1.9.1
- RUBY EXECUTABLE: /opt/crossfader/versions/ruby/1.9.3-p484/bin/ruby
- EXECUTABLE DIRECTORY: /opt/crossfader/versions/ruby/1.9.3-p484/gemsets/netdev/ruby/1.9.1/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-13
- GEM PATHS:
- /opt/crossfader/versions/ruby/1.9.3-p484/gemsets/netdev/ruby/1.9.1
- /opt/crossfader/versions/ruby/1.9.3-p484/gemsets/global/ruby/1.9.1
- /opt/crossfader/versions/ruby/1.9.3-p484/lib/ruby/gems/1.9.1
- /Users/jeff/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Clone the Repository
Clone this repository into your local development workspace.
$ git clone https://github.com/puppetlabs/netdev_stdlib
Cloning into 'netdev_stdlib'...
remote: Counting objects: 595, done.
remote: Compressing objects: 100% (172/172), done.
remote: Total 595 (delta 264), reused 587 (delta 261)
Receiving objects: 100% (595/595), 76.83 KiB | 0 bytes/s, done.
Resolving deltas: 100% (264/264), done.
Checking connectivity... done.
Install dependencies
The types depend primarily on Puppet which itself has a set of dependencies. All of these additional software components should be installed using bundler when developing the types and providers.
$ cd netdev_stdlib/
$ bundle install --path .bundle/gems/
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Installing rake (10.1.1)
Installing CFPropertyList (2.2.8)
Installing ast (2.0.0)
Installing slop (3.6.0)
Installing parser (2.2.0.pre.4)
Installing astrolabe (1.3.0)
Installing timers (1.1.0)
Installing celluloid (0.15.2)
Installing coderay (1.1.0)
Installing diff-lcs (1.2.5)
Installing docile (1.1.5)
Installing facter (2.2.0)
Installing ffi (1.9.3)
Installing formatador (0.2.5)
Installing rb-fsevent (0.9.4)
Installing rb-inotify (0.9.5)
Installing listen (2.7.9)
Installing lumberjack (1.0.9)
Installing method_source (0.8.2)
Installing pry (0.10.1)
Installing thor (0.19.1)
Installing guard (2.6.1)
Installing rspec-core (2.13.1)
Installing rspec-expectations (2.13.0)
Installing rspec-mocks (2.13.1)
Installing rspec (2.13.0)
Installing guard-rspec (3.1.0)
Installing powerpack (0.0.9)
Installing rainbow (2.0.0)
Installing ruby-progressbar (1.5.1)
Installing rubocop (0.26.0)
Installing guard-rubocop (1.1.0)
Installing json_pure (1.8.1)
Installing hiera (1.3.4)
Installing metaclass (0.0.4)
Installing mocha (1.1.0)
Installing multi_json (1.10.1)
Installing yard (0.8.7.4)
Installing pry-doc (0.6.0)
Installing rgen (0.6.6)
Installing puppet (3.6.2)
Installing puppet-lint (1.0.1)
Installing puppet-syntax (1.3.0)
Installing rspec-puppet (1.0.1)
Installing puppetlabs_spec_helper (0.8.1)
Installing simplecov-html (0.8.0)
Installing simplecov (0.9.0)
Using bundler (1.3.6)
Your bundle is complete!
It was installed into ./.bundle/gems
bundle install --path .bundle/gems/ 7.74s user 1.99s system 45% cpu 21.569 total
Run the spec tests
Before starting development of the types or providers, make sure the current branch is known-good by automatically validating expected behavior against actual behavior.
$ bundle exec rspec spec/
.........................................
Finished in 2.43 seconds
1213 examples, 0 failures
Coverage report generated for Unit Tests to /netdev_stdlib/coverage/. 512 / 519 LOC (98.65%) covered.
bundle exec rspec spec 3.59s user 0.27s system 99% cpu 3.896 total
Test Driven Development
If the types are being changed, the spec tests may be automatically run in response to file system change events using guard.
$ bundle exec guard
16:52:13 - INFO - Guard is using Tmux to send notifications.
16:52:13 - INFO - Guard is using TerminalTitle to send notifications.
16:52:13 - INFO - Guard::RSpec is running
16:52:13 - INFO - Inspecting Ruby code style of all files
16:52:16 - INFO - Guard is now watching at '/netdev_stdlib'
[1] guard(main)>
Implementing a provider
For a platform named foo
, the following section describes how to implement a
module containing providers for the netdev_stdlib
types.
The basic process for implementing providers for these types are as follows.
First, create a parent directory for use as the module directory. This parent
directory will contain the netdev_stdlib
module and the netdev_stdlib_foo
module. For example, /workspace/netdev/
.
Clone the netdev_stdlib
into the module directory, for example
/workspace/netdev/netdev_stdlib
and install dependencies using bundler as
described in Getting Started for Development.
Generate the Provider Module
With a current working directory of the type module, generate the provider
module using puppet module generate
:
$ cd /workspace/netdev/netdev_stdlib/
$ bundle exec puppet module generate acme-netdev_stdlib_foo
We need to create a metadata.json file for this module. Please answer the
following questions; if the question is not applicable to this module, feel free
to leave it blank.
Puppet uses Semantic Versioning (semver.org) to version modules.
What version is this module? [0.1.0]
--> 0.1.0
Who wrote this module? [acme]
--> acme
What license does this module code fall under? [Apache 2.0]
-->
How would you describe this module in a single sentence?
--> Acme Foo platform providers for the Network Device Standard Library types
Where is this module's source code repository?
--> https://github.com/acme/netdev_stdlib_foo
Where can others go to learn more about this module? [https://github.com/acme/netdev_stdlib_foo]
-->
Where can others go to file issues about this module? [https://github.com/acme/netdev_stdlib_foo/issues]
-->
----------------------------------------
{
"name": "acme-netdev_stdlib_foo",
"version": "0.1.0",
"author": "acme",
"summary": "Acme Foo platform providers for the Network Device Standard Library types",
"license": "Apache 2.0",
"source": "https://github.com/acme/netdev_stdlib_foo",
"project_page": "https://github.com/acme/netdev_stdlib_foo",
"issues_url": "https://github.com/acme/netdev_stdlib_foo/issues",
"dependencies": [
{
"name": "puppetlabs-stdlib",
"version_range": ">= 1.0.0"
}
]
}
----------------------------------------
About to generate this metadata; continue? [n/Y]
Notice: Generating module at /workspace/serious/src/modules/netdev/test/netdev_stdlib/acme-netdev_stdlib_foo...
Notice: Populating ERB templates...
Finished; module generated in acme-netdev_stdlib_foo.
acme-netdev_stdlib_foo/manifests
acme-netdev_stdlib_foo/manifests/init.pp
acme-netdev_stdlib_foo/metadata.json
acme-netdev_stdlib_foo/Rakefile
acme-netdev_stdlib_foo/README.md
acme-netdev_stdlib_foo/spec
acme-netdev_stdlib_foo/spec/classes
acme-netdev_stdlib_foo/spec/classes/init_spec.rb
acme-netdev_stdlib_foo/spec/spec_helper.rb
acme-netdev_stdlib_foo/tests
acme-netdev_stdlib_foo/tests/init.pp
Move the skeleton into the module directory:
$ mv acme-netdev_stdlib_foo ../netdev_stdlib_foo
$ cd ../netdev_stdlib_foo
Express the dependencies
The provider module has the same dependencies as the type module and so it is
easiest to simply copy the dependency information from the netdev_stdlib
type.
$ cp ../netdev_stdlib/{Gem,Guard}file .
Install the dependencies:
$ bundle install --path .bundle/gems/
Configure RSpec
Puppet Providers are generally tested with RSpec. Copy the spec helper, which initializes RSpec for module testing.
$ cp ../netdev_stdlib/spec/spec_helper.rb spec/
Remove the rspec-puppet generated example for a puppet class.
$ rm ./spec/classes/init_spec.rb
Test that rspec runs:
$ bundle exec rspec spec/
No examples found.
Finished in 0.00004 seconds
0 examples, 0 failures
Mocking
The device API used by the provider should be modeled as a utility class in
PuppetX::NetDev::FooApi
class, located at lib/puppet_x/net_dev/foo_api.rb
.
Instance methods of this API class are suitable for mocking network based API
calls in the spec tests. For REST API's the response data from the resource
request should be serialized into a fixtures directory. These fixtures are
therefore able to be updated as API responses are changed or added over time.
For more information on rspec, please see https://github.com/rspec/rspec
License
Copyright 2014-2018 Puppet, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Change log
All notable changes to this project will be documented in this file.
0.23.0 - 2019-10-10
Summary:
This release adds support for an additional attributes to the tacacs_global
type.
Added:
tacacs_global
- directed_request
0.22.0 - 2019-10-07
Summary:
This release adds support for two additional attributes to the tacacs_server_group
type.
Added:
tacacs_server_group
- source_interface
- vrf
0.21.0 - 2019-09-24
Summary:
This release adds support for an additional attribute to the vrf
type.
Added:
vrf
- ensure
0.20.0 - 2019-09-23
Summary:
This release adds support for the vrf
type.
Added:
vrf
- name
- route_distinguisher
- route_targets
- import_map
0.19.0 - 2019-08-19
Summary:
This release adds support for additional attributes to the banner
type, while also updating the existing attribute to explicitly support a value of unset
and adding a tag to aid in forge searches.
Changed:
banner
- motd
Added:
banner
- login
- exec
- Tag added to aid in forge searches
0.18.0 - 2019-01-25
Summary:
This release adds support for unsetting appropriate values on Cisco Nexus devices.
0.17.0 - 2018-11-20
Summary:
This release adds support for dual mode (agentful + agentless) providers.
0.16.0 - 2018-09-13
Summary:
This release adds syslog_facility type, enhances network_dns and syslog_settings
Added:
network_dns
- hostname
syslog_facility
type- level
syslog_settings
- logfile_severity_level
- logfile_name
- logfile_size
- buffered_severity_level
- buffered_size
Fixed:
banner
ensure value is String
0.15.0 - 2018-08-06
Summary:
This release adds banner type, enhances syslog, and deprecates domain_name, name_server, search_domain
Added:
banner
type- motd
syslog_server
- facility
syslog_settings
- facility
Deprecated:
domain_name
replaced bynetwork_dns
name_server
replaced bynetwork_dns
search_domain
replaced bynetwork_dns
0.14.1 - 2018-06-19
Summary:
This is a bugfix release
Fixed:
port_channel
removed invalid default valuesnmp_notification_receiver
addv2c
version
0.14.0 - 2018-06-05
Summary:
This release adds Resource API versions of the types.
Both versions of the types perform the same in the catalog, but stricter type checking is enabled with RSAPI versions.
Only one version can be loaded into an environment at a time. On the master, RSAPI version of the types will always be loaded when Resource API gem is present. This will be the default behavior in future versions of Puppet.
On the agent, legacy types will be loaded if the operatingsystem is aristaeos, ios_xr, or nexus
, otherwise RSAPI version is loaded.
Added:
- Resource API version of all types
Fixed:
network_trunk
range of ofuntagged_vlan
now 0-4095
0.13.0 - 2017-11-13
Summary:
This release enhances syslog, RADIUS, TACACS, and SNMP types
Added:
syslog_server
- port
syslog_settings
- console
- monitor
- source_interface
- vrf
radius_global
- source_interface
- vrf
tacacs_global
- source_interface
- vrf
Fixed:
snmp_user
version parameter changed to property
0.12.0 - 2017-05-03
Summary:
This release enhances NTP types
Added:
ntp_auth_key
type- algorithm
- mode
- password
ntp_config
type- authenticate
- trusted_key
ntp_server
type- key
- maxpoll
- minpoll
- source_interface
- vrf
0.11.1 - 2016-02-11
Summary:
This release changes snmp_notification_receiver
type's port
and username
parameters to properties so they may be managed directly.
Fixed:
snmp_notification_receiver
port parameter changed to propertysnmp_notification_receiver
username parameter changed to propertysnmp_user
version parameter now specified as not a namevar
0.11.0 - 2015-11-05
Summary:
This backwards-incompatible release adds several useful types and type properties, makes several types not have conflicting namevars, removes several unuseful types, and fixes some discrepancies.
Changed:
- Removed
snmp_contact
type - Removed
snmp_location
type - Removed
snmp_protocol
type - (NETDEV-20) Change
snmp_notification_receiver
namevar to host:port:username (see a3aabdd) - (NETDEV-22) Change
snmp_user
namevar to name:version (see 06302ac)
Added:
network_dns
typenetwork_snmp
typeradius_server
hostname propertyradius_global
enable propertytacacs_global
enable propertytacacs_server
hostname, vrf, and port propertiessnmp_user
version property- Ability for types to work either for normal or device resources
Fixed:
ntp_server
is ensurable so that it may be ensure present or absentradius_server
is ensurable so that it may be ensure present or absentsnmp_community
is ensurable so that it may be ensure present or absenttacacs_server
is ensurable so that it may be ensure present or absenttacacs_server_group
is ensurable so that it may be ensure present or absenttacacs_server_group
array value output formattingradius_server_group
array value output formattingsnmp_user
array value output formatting
0.10.0 - 2014-09-09
Summary:
This is the initial release of the netdev_stdlib to the forge.
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.