EARLY FIELD TRIAL: This is a Puppet agent EFT for use with Cisco NX-OS release 7.0(3)I2(1). Please see the Limitations section for more information.
- Overview
- Module Description
- Setup
- Usage
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This ciscopuppet module enables Puppet to config Cisco Nexus Switches that support NXAPI through types and NXAPI based providers.
This module enables users to manage Cisco Nexus switches using Puppet.
This module uses Cisco NXAPI to manage various Cisco NX-OS functions on certain Cisco Nexus Switches models such as N9k series and N31xx series. These functions include, but are not limited to, tacacs server and host, snmp server and users, and OSPF.
Before the module can be run properly on the agent, enable pluginsync in the puppet.conf file on the agent.
You must also install the following gems on the agent: net_http_unix, cisco_nxapi, and cisco_node_utils. Since these have dependencies on each other, when you install cisco_node_utils, the other two gems will be automatically installed. Gems installed under Puppet are not persistent across system reload on Nexus switches. To avoid issues after reload, you should include the package provider in the manifest to automate installing these gems, as shown in the following example.
package { 'cisco_node_utils' :
provider => 'gem',
ensure => present,
}
The following example shows how to use ciscopuppet to configure ospf on a Cisco Nexus switch.
Three types are needed to add OSPF support on an interface: cisco_ospf, cisco_ospf_vrf, and cisco_interface_ospf.
First, to configure cisco_ospf to enable ospf on the device, add the following type in the manifest:
cisco_ospf {"Sample":
ensure => present,
}
Then put the ospf router under a VRF, and add the corresponding OSPF configuration. If the configuration is global, use 'default' as the VRF name.
cisco_ospf_vrf {"Sample default":
ensure => 'present',
default_metric => '5',
auto_cost => '46000',
}
Finally apply the ospf into an interface:
cisco_interface_ospf {"Ethernet1/2 Sample":
ensure => present,
area => 200,
cost => "200",
}
cisco_command_config
cisco_interface
cisco_interface_ospf
cisco_ospf
cisco_ospf_vrf
cisco_snmp_community
cisco_snmp_group
cisco_snmp_server
cisco_snmp_user
cisco_tacacs_server
cisco_tacacs_server_host
cisco_vlan
cisco_vtp
Allows execution of configuration commands.
Configuration command(s) to be applied to the network element. Valid values are string.
This provider allows raw configurations to be managed by Puppet. It serves as a stopgap until specialized types are created. It has the following limitations:
- The input message buffer is limited to 500KB. Large configurations are often easier to debug if broken up into multiple smaller resource blocks.
- The cisco_command_config configuration block must use the same syntax as displayed by the
show running-config
command on the switch. In some cases, configuration commands that omit optional keywords when entered may actually appear with a different syntax when displayed byshow running-config
; for example, some access-list entries may be configured without a sequence number but yet an implicit sequence number is created regardless. This then creates an idempotency problem because there is a mismatch betweenshow running-config
and the manifest. The solution in this case is for the manifest to include explicit sequence numbers for the affected access-list entries. - Order is important. Some dependent commands may fail if their associated
feature
configuration is not enabled first. Use Puppet'sbefore
,after
, orrequire
keywords to establish dependencies between blocks. - Indentation counts! It implies sub-mode configuration. Use the switch's running-config as a guide and do not indent configurations that are not normally indented. Do not use tabs to indent.
- Inline comments must be prefixed by '!' or '#'.
- Negating a submode will also remove configuratons under that submode, without having to specify every submode config statement:
no router ospf RED
removes all configuration under router ospf RED. - Syntax does not auto-complete: use
Ethernet1/1
, notEth1/1
. - If a CLI command is rejected during configuration, the resource will abort at that point and will not issue any remaining CLI. For this reason, we recommend limiting the scope of each instance of this resource.
Manages a Cisco Network Interface. Any resource dependency should be run before the interface resource.
Determine whether the interface config should be present or not. Valid values are 'present' and 'absent'.
Name of the interface on the network element. Valid value is a string.
Description of the interface. Valid values are a string or the keyword 'default'.
Shutdown state of the interface. Valid values are 'true', 'false', and 'default'.
Switchport mode of the interface. To make an interface Layer 3, set
switchport_mode
to 'disabled'. Valid values are 'disabled', 'access', 'tunnel', 'fex_fabric', 'trunk', and 'default'.
The VLAN ID assigned to the interface. Valid values are an integer or the keyword 'default'.
Exclude this port for the SVI link calculation. Valid values are 'true', 'false', and 'default'.
Enable or disable VTP on the interface. Valid values are 'true', 'false', and 'default'.
Enable/Disable negotiate auto on the interface. Valid values are 'true', 'false', and 'default'.
Enables or disables proxy arp on the interface. Valid values are 'true', 'false', and 'default'.
Enables or disables sending of IP redirect messages. Valid values are 'true', 'false', and 'default'.
IP address of the interface. Valid values are a string of ipv4 address or the keyword 'default'.
Network mask length of the IP address on the interface. Valid values are integer and keyword 'default'.
Enable/Disable autostate on the SVI interface. Valid values are 'true', 'false', and 'default'.
Enable/Disable management on the SVI interface. Valid values are 'true', 'false', and 'default'.
Manages configuration of an OSPF interface instance.
Determine whether the config should be present or not. Valid values are 'present' and 'absent'.
Name of this cisco_interface resource. Valid value is a string.
Name of the cisco_ospf resource. Valid value is a string.
The cost associated with this cisco_interface_ospf instance. Valid value is an integer.
The hello_interval associated with this cisco_interface_ospf instance. Time between sending successive hello packets. Valid values are an integer or the keyword 'default'.
The dead_interval associated with the cisco_interface_ospf instance. Time interval an ospf neighbor waits for a hello packet before tearing down adjacencies. Valid values are an integer or the keyword 'default'.
Passive interface associated with the cisco_interface_ospf instance. Setting to true will prevent this interface from receiving HELLO packets. Valid values are 'true' and 'false'.
Enables or disables the usage of message digest authentication. Valid values are 'true' and 'false'.
md5 authentication key-id associated with thecisco_interface_ospf instance. If this is present in the manifest, message_digest_encryption_type, message_digest_algorithm_type and message_digest_password are mandatory. Valid value is an integer.
Algorithm used for authentication among neighboring routers within an area. Valid values are 'md5' and keyword 'default'.
Specifies the scheme used for encrypting message_digest_password. Valid values are 'cleartext', '3des' or 'cisco_type_7' encryption, and 'default', which defaults to 'cleartext'.
Specifies the message_digest password. Valid value is a string.
Required. Ospf area associated with this cisco_interface_ospf instance. Valid values are a string, formatted as an IP address (i.e. "0.0.0.0") or as an integer.
Manages configuration of an ospf instance.
Determine if the config should be present or not. Valid values are 'present', and 'absent'.
Name of the ospf router. Valid value is a string.
Manages a VRF for an OSPF router.
Determines whether the config should be present or not on the device. Valid values are 'present' and 'absent'.
Name of the resource instance. Valid value is a string. The name 'default' is a valid VRF representing the global ospf.
Name of the ospf instance. Valid value is a string.
Router Identifier (ID) of the OSPF router VRF instance. Valid values are a string or the keyword 'default'.
Specify the default Metric value. Valid values are an integer or the keyword 'default'.
Controls the level of log messages generated whenever a neighbor changes state. Valid values are 'log', 'detail', 'none', and 'default'.
Specify the start interval for rate-limiting Link-State Advertisement (LSA) generation. Valid values are an integer, in milliseconds, or the keyword 'default'.
Specifies the hold interval for rate-limiting Link-State Advertisement (LSA) generation. Valid values are an integer, in milliseconds, or the keyword 'default'.
Specifies the max interval for rate-limiting Link-State Advertisement (LSA) generation. Valid values are an integer, in milliseconds, or the keyword 'default'.
Specify initial Shortest Path First (SPF) schedule delay. Valid values are an integer, in milliseconds, or the keyword 'default'.
Specify minimum hold time between Shortest Path First (SPF) calculations. Valid values are an integer, in milliseconds, or the keyword 'default'.
Specify the maximum wait time between Shortest Path First (SPF) calculations. Valid values are an integer, in milliseconds, or the keyword 'default'.
Specifies the reference bandwidth used to assign OSPF cost. Valid values are an integer, in Mbps, or the keyword 'default'.
Manages an SNMP community on a Cisco SNMP server.
Determine whether the config should be present or not on the device. Valid values are 'present' and 'absent'.
Name of the SNMP community. Valid value is a string.
Group that the SNMP community belongs to. Valid values are a string or the keyword 'default'.
Assigns an Access Control List (ACL) to an SNMP community to filter SNMP requests. Valid values are a string or the keyword 'default'.
Manages a Cisco SNMP Group on a Cisco SNMP Server.
The term 'group' is a standard SNMP term, but in NXOS role it serves the purpose of group; thus this provider utility does not create snmp groups and only reports group (role) existence.
Determines whether the config should be present on the device or not. Valid values are 'present', and 'absent'.
Name of the snmp group. Valid value is a string.
Manages a Cisco SNMP Server. There can only be one instance of the cisco_snmp_server.
The name of the SNMP Server instance. Only 'default' is accepted as a valid name.
SNMP location (sysLocation). Valid values are a string or the keyword 'default'.
SNMP system contact (sysContact). Valid values are a string or the keyword 'default'.
Configures how long the AAA synchronized user configuration stays in the local cache. Valid values are an integer or the keyword 'default'.
Size of SNMP packet. Valid values are an integer, in bytes, or the keyword 'default'.
Enable/disable SNMP message encryption for all users. Valid values are 'true', 'false', and 'default'.
Enable/disable SNMP protocol. Valid values are 'true', 'false', and 'default'.
Enable/disable a one time authentication for SNMP over TCP session. Valid values are 'true', 'false', and 'default'.
Manages an SNMP user on an cisco SNMP server.
Determines whether the config should be present or not on the device. Valid values are 'present', and 'absent'.
Name of the SNMP user. Valid value is a string.
Engine ID of the SNMP user. Valid values are empty string or 5 to 32 octets seprated by colon.
Groups that the SNMP user belongs to. Valid value is a string.
Authentication protocol for the SNMP user. Valid values are 'md5', 'sha', and 'none'.
Authentication password for the SNMP user. Valid value is string.
Privacy protocol for the SNMP user. Valid values are 'aes128', 'des', and 'none'.
Privacy password for SNMP user. Valid value is a string.
Specifies whether the passwords specified in manifest are in localized key format (in case of true) or cleartext (in case of false). Valid values are 'true', and 'false'.
Manages a Cisco TACACS+ Server global configuration. There can only be one instance of the cisco_tacacs_server.
Instance of the tacacs_server, only allows the value 'default'.
Global timeout interval for TACACS+ servers. Valid value is an integer, in seconds, or the keyword 'default'.
Allows users to specify a TACACS+ server to send the authentication request when logging in. Valid values are 'true', and 'false'.
Specifies the global deadtime interval for TACACS+ servers. Valid values are Integer, in minutes, and keyword 'default'.
Specifies the global preshared key type for TACACS+ servers. Valid values are 'clear', 'encrypted', 'none', and 'default'.
Specifies the global TACACS+ servers preshared key password. Valid values are string, and keyword 'default'.
Global source interface for all TACACS+ server groups configured on the device. Valid values are string, and keyword 'default'.
Configures Cisco TACACS+ server hosts.
Determines whether or not the config should be present on the device. Valid values are 'present' and 'absent'.
Name of the tacacs_server_host instance. Valid value is a string.
Server port for the host. Valid values are an integer or the keyword 'default'.
Timeout interval for the host. Valid values are an integer, in seconds, or the keyword 'default'.
Specifies a preshared key for the host. Valid values are 'clear', 'encrypted', 'none', and keyword 'default'.
"Specifies the preshared key password for the host. Valid value is a string.
Manages a Cisco VLAN.
ID of the Virtual LAN. Valid value is an integer.
Determined wether the config should be present or not. Valid values are 'present' and 'absent'.
The name of the VLAN. Valid values are a string or the keyword 'default'.
State of the VLAN. Valid values are 'active', 'suspend', and keyword 'default'.
Whether or not the vlan is shutdown. Valid values are 'true', 'false' and keyword 'default'.
Manages the VTP (VLAN Trunking Protocol) configuration of a Cisco device. There can only be one instance of the cisco_vtp.
Determines whether or not the config should be present on the device. Valid values are 'present' and 'absent'.
Instance of vtp, only allow the value 'default'
Required. VTP administrative domain. Valid value is a string.
Version for the VTP domain. Valid values are an integer or the keyword 'default'.
VTP file name. Valid values are a string or the keyword 'default'.
Password for the VTP domain. Valid values are a string or the keyword 'default'.
This module can only be supported from NX-OS software release 7.0(3)I2(1) on Cisco Nexus switch N95xx, N93xx, N30xx and N31xx platforms. Please ensure that the switch is running a supported version of NX-OS software.
On the supported platforms, it can work with both the native NX-OS Puppet agent or with the CentOS Puppet agent installed into the Guestshell. It does not (yet) address other Cisco operating systems such as IOS, IOS-XE, or IOS XR.
- Fork the repository on Github.
- Create a named feature branch (like add_component_x).
- Write your change.
- Write tests for your change (if applicable).
- Run the tests, ensuring they all pass.
- Submit a Pull Request using Github.
Copyright (c) 2014-2015 Cisco and/or its affiliates.
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.