diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04d8916e4..878f34aa9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
-## [Unreleased]
+## [1.0.0] - 2015-08-28
+### Added
+- New facts `cisco_node_utils` and `cisco_nxapi` report the installed version of these gems.
+- Providers requiring the `cisco_node_utils` feature will generate a warning message if an obsolete gem version is installed.
+- Added README-maintainers.md
+
+### Fixed
+- Metadata URLs now point to new public GitHub repository.
+- Moved misc READMEs into /docs
+- NXAPI providers are marked as defaultfor 'nexus' operating system.
+- Fixed beaker test for package and interface ospf
+- Fixed sample install.pp
## [0.9.1] - 2015-08-13
### Added
@@ -10,6 +21,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added README-creating-types-providers.md and associated templates.
- Added SUPPORT.md
- Added Beaker test cases for cisco_command_config, file, package, and service providers.
+- Added VRF attribute to cisco_interface provider.
### Fixed
- 'puppet resource cisco_vtp' now works properly.
@@ -26,5 +38,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Initial release of puppetlabs-ciscopuppet module, supporting Cisco NX-OS software release 7.0(3)I2(1) on Cisco Nexus switch platforms: N95xx, N93xx, N30xx and N31xx.
- Please note: 0.9.0 is an EFT pre-release for a limited audience with access to NX-OS 7.0(3)I2(1). Additional code changes may occur in 0.9.x prior to the final 1.0.0 release.
-[unreleased]: https://github.com/cisco/cisco-network-puppet-module/compare/v0.9.1...develop
+[unreleased]: https://github.com/cisco/cisco-network-puppet-module/compare/master...develop
+[1.0.0]: https://github.com/cisco/cisco-network-puppet-module/compare/v0.9.1...v1.0.0
[0.9.1]: https://github.com/cisco/cisco-network-puppet-module/compare/v0.9.0...v0.9.1
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 39dd794d7..5a158a117 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -10,7 +10,7 @@ Cisco Network Elements support a rich set of features to make networks robust, e
* Fork the repository
* Pull a branch under the "develop" branch for your changes.
-* Follow all guidelines documented in [README-creating-types-providers](#README-creating-types-providers.md)
+* Follow all guidelines documented in [README-creating-types-providers](README-creating-types-providers.md)
* Make changes in your branch.
* Testing
* Add beaker test cases to validate your changes.
diff --git a/README.md b/README.md
index e0c83adfc..de7c3e957 100644
--- a/README.md
+++ b/README.md
@@ -1,52 +1,98 @@
# ciscopuppet
-----
-### _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](#limitations) section for more information.
-----
#### Table of Contents
1. [Overview](#overview)
2. [Module Description](#module-description)
3. [Setup](#setup)
- * [Setup requirements](#setup-requirements)
- * [Beginning with ciscopuppet](#beginning-with-ciscopuppet)
4. [Usage](#usage)
-5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
-5. [Limitations - OS compatibility, etc.](#limitations)
-6. [Development - Guide for contributing to the module](#development)
+5. [Resource Reference](#resource-reference)
+ * [Resource Type Catalog (by Technology)](#resource-by-tech)
+ * [Resource Type Catalog (by Name)](#resource-by-name)
+6. [Limitations - OS compatibility, etc.](#limitations)
+7. [Development - Guide for contributing to the module](#development)
+
+--
+##### Additional References
+
+* Agent Installation
+ * [README-agent-install.md](docs/README-agent-install.md) : Agent Installation and Configuration Guide
+ * [README-beaker-agent-install.md](docs/README-beaker-agent-install.md) : Automated Agent Installation and Configuration via the Beaker Tool
+* User Guides
+ * [README-package-provider.md](docs/README-package-provider.md) : Cisco Nexus Package Management using the Package Provider
+* Developer Guides
+ * [README-develop-types-providers.md](docs/README-develop-types-providers.md) : Developing new ciscopuppet Types and Providers
+ * [README-beaker-testcase-execution.md](docs/README-beaker-testcase-execution.md) : Executing Beaker Tests for ciscopuppet
+ * [README-beaker-testcase-writing.md](docs/README-beaker-testcase-writing.md) : Writing Beaker Tests for ciscopuppet
+
+--
## Overview
-This ciscopuppet module enables Puppet to config Cisco Nexus Switches that
-support NXAPI through types and NXAPI based providers.
+The ciscopuppet module allows a network administrator to manage Cisco Network Elements using Puppet. This module bundles a set of Puppet Types, providers, Beaker Tests, Sample Manifests and Installation Tools for effective network management. The resources and capabilities provided by this Puppet Module will grow with contributions from Cisco, Puppet Labs and the open source community.
+
+The Cisco Network Elements and Operating Systems managed by this Puppet Module are continuously expanding. Please refer to the [Limitations](#limitations) section for details on currently supported hardware and software.
+The Limitations section also provides details on compatible Puppet Agent and Puppet Master versions.
+
+This GitHub repository contains the latest version of the ciscopuppet module source code. Supported versions of the ciscopuppet module are available at Puppet Forge. Please refer to [SUPPORT.md](SUPPORT.md) for additional details.
+
+Contributions to this Puppet Module are welcome. Guidelines on contributions to the module are captured in [CONTRIBUTING.md](CONTRIBUTING.md)
## Module Description
-This module enables users to manage Cisco Nexus switches using Puppet.
+This module enables management of supported Cisco Network Elements using Puppet. This module enhances the Puppet DSL by introducing new Puppet Types and Providers capable of managing network elements.
-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.
+The set of supported network element platforms is continuously expanding. Please refer to the [Limitations](#limitations) section for a list of currently supported platforms.
## Setup
-### Beginning with ciscopuppet
+#### Puppet Master
+
+The `ciscopuppet` module is installed on the Puppet Master server. Please see [Puppet Labs: Installing Modules](https://docs.puppetlabs.com/puppet/latest/reference/modules_installing.html) for general information on Puppet module installation.
+
+#### Puppet Agent
+The Puppet Agent requires installation and setup on each device. Agent setup can be performed as a manual process or it may be automated. For more information please see the [README-agent-install.md](docs/README-agent-install.md) document for detailed instructions on agent installation and configuration on Cisco Nexus devices.
+
+##### Artifacts
+
+As noted in the agent installation guide, these are the current RPM versions for use with ciscopuppet:
+* `bash-shell`: Use [http://yum.puppetlabs.com/puppetlabs-release-pc1-nxos-5.noarch.rpm](http://yum.puppetlabs.com/puppetlabs-release-pc1-nxos-5.noarch.rpm)
+* `guestshell`: Use [http://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm](http://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm)
+
+##### Gems
+
+The ciscopuppet module has dependencies on a few ruby gems. After installing the Puppet Agent software you will then need to install the following gems on the agent device:
+
+* [`net_http_unix`](https://rubygems.org/gems/net_http_unix)
+* [`cisco_nxapi`](https://rubygems.org/gems/cisco_nxapi)
+* [`cisco_node_utils`](https://rubygems.org/gems/cisco_node_utils)
+
+These gems have dependencies on each other so installing `cisco_node_utils` by itself will automatically install `net_http_unix` and `cisco_nxapi`.
+
+Example:
+
+~~~bash
+[root@guestshell]# gem install cisco_node_utils
+
+[root@guestshell]# gem list | egrep 'cisco|net_http'
+cisco_node_utils (1.0.0)
+cisco_nxapi (1.0.0)
+net_http_unix (0.2.1)
+~~~
+
+##### Gem Persistence (bash-shell only)
-Before the module can be run properly on the agent, enable pluginsync in the puppet.conf file on the agent.
+Please note that in the Nexus `bash-shell` environment these gems are currently not persistent across system reload. This persistence issue can be mitigated by simply defining a manifest entry for installing the `cisco_node_utils` gem via the package provider.
-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.
+Example:
~~~Puppet
package { 'cisco_node_utils' :
provider => 'gem',
ensure => present,
}
-~~~~
+~~~
+*This persistence issue does not affect the `guestshell` environment. Gems are persistent across reload in the `guestshell`.*
## Usage
@@ -86,9 +132,38 @@ cisco_interface_ospf {"Ethernet1/2 Sample":
}
~~~
-## Reference
+## Resource Reference
+
+### Resource Type Catalog (by Technology)
+
+1. Miscellaneous Types
+ * [`cisco_command_config`](#type-cisco_command_config)
+
+2. Interface Types
+ * [`cisco_interface`](#type-cisco_interface)
+ * [`cisco_interface_ospf`](#type-cisco_interface_ospf)
+
+3. OSPF Types
+ * [`cisco_ospf`](#type-cisco_ospf)
+ * [`cisco_ospf_vrf`](#type-cisco_ospf_vrf)
+ * [`cisco_interface_ospf`](#type-cisco_interface_ospf)
-### Public Types
+4. SNMP Types
+ * [`cisco_snmp_community`](#type-cisco_snmp_community)
+ * [`cisco_snmp_group`](#type-cisco_snmp_group)
+ * [`cisco_snmp_server`](#type-cisco_snmp_server)
+ * [`cisco_snmp_user`](#type-cisco_snmp_user)
+
+5. TACACS Types
+ * [`cisco_tacacs_server`](#type-cisco_tacacs_server)
+ * [`cisco_tacacs_server_host`](#type-cisco_tacacs_server_host)
+
+6. VLAN Types
+ * [`cisco_vlan`](#type-cisco_vlan)
+ * [`cisco_vtp`](#type-cisco_vtp)
+
+--
+### Resource Type Catalog (by Name)
* [`cisco_command_config`](#type-cisco_command_config)
* [`cisco_interface`](#type-cisco_interface)
@@ -104,6 +179,11 @@ cisco_interface_ospf {"Ethernet1/2 Sample":
* [`cisco_vlan`](#type-cisco_vlan)
* [`cisco_vtp`](#type-cisco_vtp)
+--
+### Resource Type Details
+
+The following resources are listed alphabetically.
+
### Type: cisco_command_config
Allows execution of configuration commands.
@@ -185,6 +265,9 @@ keyword 'default'.
Network mask length of the IP address on the interface. Valid values are
integer and keyword 'default'.
+###### `vrf`
+VRF member of the interface. Valid values are a string or the keyword 'default'.
+
##### SVI interface config attributes
###### `svi_autostate`
@@ -542,14 +625,13 @@ Password for the VTP domain. Valid values are a string or the keyword 'default'.
## Limitations
-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.
+Minimum Requirements:
+* Cisco NX-OS Puppet implementation requires open source Puppet version 4.0 or Puppet Enterprise 2015.2
+* Supported Platforms:
+ * Cisco Nexus 95xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
+ * Cisco Nexus 93xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
+ * Cisco Nexus 31xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
+ * Cisco Nexus 30xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
## Development
diff --git a/REVIEW_NOTES b/REVIEW_NOTES
deleted file mode 100644
index d2c9de52b..000000000
--- a/REVIEW_NOTES
+++ /dev/null
@@ -1,28 +0,0 @@
-Cisco NXOS Module Review
-
-* excellent use of autorequire
- * can lose resource existence check
-* excellent use of title_patterns
- * single var patterns can be elided
-* many props could use a default
- * e.g. cisco_interface#svi_autostate?
-* many munge functions do validation
-* missing onep_lib to run tests
- * relative inclusion of onep_lib from outside
-* specs do not match code
- * e.g. cisco_interface#state, #switchport, #element are tested, but do not exist
-* providers and types do not match up
- * type cisco_interface_clan has no provider
- * provider cisco_interface_ospf has not type
-* Recommend to setup Gemfile
-* use rspec-puppet/puppetlabs_spec_helper for test support
- * Rakefile could use better test task, without needing to hardcode spec path
-* different styles of providers
- * onep
- * much custom code
- * nxapi from template
- * looks like good solution for types with many properties
- * might profit from even more meta programming to reduce duplicate code
- * nxapi custom
- * e.g. cisco_ospf: very simple provider, would not profit from meta programming complexity
-
diff --git a/REVIEW_NOTES2 b/REVIEW_NOTES2
deleted file mode 100644
index 367cf7a75..000000000
--- a/REVIEW_NOTES2
+++ /dev/null
@@ -1,54 +0,0 @@
-General Notes:
-* Don't check in the GEMFILE.lock
-* The Netscaler module is a good example of type / provider module for a network device. https://github.com/puppetlabs/puppetlabs-netscaler
-* Add a Changefile, is really helpful for users to see what is going on in each release.
-* README should follow standards laid out here https://docs.puppetlabs.com/puppet/latest/reference/modules_documentation.html#readme-template
-* metadata.json needs updated, dependencies outlined, links to tickets and project page.
-* Double check that apache2 is the license you want.
-* clean out .swp .bak files
-* Code cleanup and basic fixes. Use rubocop (similar to lint or use lint), example config file in netscaler module (.rubocop.yml). It fixes things like:
- * Align the operands of an expression in an assignment spanning multiple lines.
- * Extra empty line detected at block body end.
- * Assignment Branch Condition size for tacacs_server_encryption_key_set is too high.
-* Testing
- * should follow the standard split of unit tests and/or acceptance tests
- * tests should be in the spec folder. following other puppet modules
- * use beaker-rspec instead of beaker for acceptance tests. https://github.com/puppetlabs/beaker/wiki/How-to-Write-a-Beaker-Test-for-a-Module
- * spec_acceptance.rb and spec_acceptance_helper.rb, set up the unit tests and the acceptance tests.
- * leverage travis ci, free unit tests for each pull request. (config files in other puppet modules https://travis-ci.org/puppetlabs/puppetlabs-mysql/)
- * generally there test per provider / function / fact
- * acceptance tests normally follow a CRUD pattern, enable a feature / disable a feature / edit a feature. eg (configure an interface, edit it, disable it) examples in netscaler
-* normally there is an install.rb and an init.pp in the lib folder, ala netscaler / f5_rest module.
-
-* types & providers
- * there is a lot of boiler plate code
- * initialize
- * prefetch
- * create
- * destroy
- * flush
- * exists
- for netscaler look at lib/puppet/provider/netscaler.rb and lib/puppet/provider/netscaler_*/rest.rb
- They are implemented once and can be overridden if needs be in the specific provider. Each provider starts with:
- require 'puppet/provider/netscaler'
- Puppet::Type.type(:netscaler_route).provide(:rest, parent: Puppet::Provider::Netscaler) do
- * validation is normally done on a per attribute basis in the type, rather than a munge
- eg in a validate do block. ie lib/type/netscaler/server.rb
- * use of a truthy class, would remove alot of code around true/false or on/off enabled/disabled.
- eg lib/puppet/property/netscaler_truthy.rb used in lib/puppet/type/netscaler_server.rb
- * There do not seem to be any attributes that are set on creation, but are unable
-
-Individual type/provider analysis (all the following have the issues described above)
-* cisco_command_config: type is fine, provider is fine (logic looks sensible, barring the suggestions outlined above)
-* cisco_interface: type docs are great, provider is fine
-* cisco_interface_ospf: type docs are great, provider maybe use ternary operators in set_properties. condition ? if_true : if_false
-* cisco_ospf: type docs are great, provider is fine
-* cisco_ospf_vrf: type docs are great, provider is fine
-* cisco_snmp_community: type fine, provider fine (closer to what is implemented in the netscaler module)
-* cisco_snmp_group: type fine, provider fine
-* cisco_snmp_server: type fine, provider fine
-* cisco_snmp_user: type fine. provider needs the debug removed
-* cisco_tacacs_server: type has validate which is great, provider looks closer to what is implemented in the netscaler module (follows some of the suggestions above).
-* cisco_tacacs_server_host: type has validate which is great, provider looks closer to what is implemented in the netscaler module (follows some of the suggestions above).
-* cisco_vlan: type is state or shutdown the same as ensure ??, provider shutdown is not mentioned
-* cisco_vtp: type password in plain text will be seen when changes are made to the resource, provider is fine
diff --git a/README-AGENT-INSTALL.md b/docs/README-agent-install.md
similarity index 71%
rename from README-AGENT-INSTALL.md
rename to docs/README-agent-install.md
index 0d85c2ba2..cf607b255 100644
--- a/README-AGENT-INSTALL.md
+++ b/docs/README-agent-install.md
@@ -1,9 +1,5 @@
# Puppet Agent Installation & Setup: Cisco Nexus
-----
-### _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](#limitations) section for more information.
-----
-
#### Table of Contents
1. [Overview](#overview)
@@ -20,16 +16,14 @@
This document describes Puppet agent installation and setup on Cisco Nexus switches. These instructions focus on manual setup. See the [Automated Installation](#auto-install) section for documentation regarding alternative installation methods.
-The Cisco NX-OS Puppet implementation requires open source Puppet version 4.0 or newer, or Puppet Enterprise 2015.2 or greater.
-
![1](puppet_outline.png)
## Pre-Install Tasks
-#### Platform and Software Requirements
+#### Platform and Software Minimum Requirements
-* Puppet 4.0 or higher
-* Cisco NX-OS release 7.0(3)I2(1) or later
+* The Cisco NX-OS Puppet implementation requires open source Puppet version 4.0 or Puppet Enterprise 2015.2
+* Cisco NX-OS release 7.0(3)I2(1)
* Supported Platforms: Cisco Nexus 95xx, Nexus 93xx, Nexus 30xx, Nexus 31xx
#### Disk space
@@ -72,16 +66,6 @@ config term
end
~~~
-#### Enable NXAPI (EFT-only)
-
-NXAPI is a NX-OS feature that is required for ciscopuppet. NX-OS EFT images might have this feature disabled, while release images have this feature enabled by default. Manually enable NXAPI with this syntax:
-
-~~~
-config term
- feature nxapi
-end
-~~~
-
## Puppet Agent Environment: bash-shell
This section is only necessary if Puppet will run from the `bash-shell`.
@@ -220,23 +204,21 @@ This section is common to both `bash-shell` and `guestshell`.
#### Install Puppet Agent
-##### Special instructions for EFT customers
-
-EFT images may not have the updated platform family definitions needed for yum to differentiate between `bash-shell` and `guestshell` environments. Therefore, the puppet-agent RPM needs to be specified explicitly during the installation:
+The `bash-shell` and `guestshell` environments use different puppet RPMs.
* For `bash-shell` use:
- ~~~bash
- yum install http://yum.puppetlabs.com/nxos/5/PC1/x86_64/puppetlabs-release-pc1-.nxos5.noarch.rpm
- yum install puppet
- ~~~
+~~~bash
+yum install http://yum.puppetlabs.com/puppetlabs-release-pc1-nxos-5.noarch.rpm
+yum install puppet
+~~~
* For `guestshell` use:
-
- ~~~bash
- yum install http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
- yum install puppet
- ~~~
+
+~~~bash
+yum install http://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
+yum install puppet
+~~~
Update PATH var:
@@ -296,102 +278,24 @@ It may be desirable to set up automatic restart of the Puppet agent in the event
#### Optional: bash-shell / init.d
The `bash-shell` environment uses **init.d** for service management.
-
-**Example:** Create an initd script file as `/etc/init.d/puppet`
-
-~~~bash
-#!/bin/bash
-#
-# puppet Startup script
-#
-### BEGIN INIT INFO
-# Provides: puppet
-# Required-Start: $local_fs $network $remote_fs
-# Required-Stop: $local_fs $network $remote_fs
-# Should-Start: $named $time
-# Should-Stop: $named $time
-# Short-Description: Startup script for puppet
-# Description: puppet
-### END INIT INFO
-# Source function library
-. /etc/init.d/functions
-exec="/opt/puppetlabs/puppet/bin/puppet"
-prog="puppet"
-[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-pidfile=${PIDFILE-/var/run/puppetlabs/agent.pid}
-start() {
- [ -x $exec ] || exit 5
- [ -f $config ] || exit 6
- echo -n $"Starting $prog: "
- daemon sudo ip netns exec management $exec agent --daemonize
- retval=$?
-echo
- [ $retval -eq 0 ]
-return $retval
-}
-stop() {
-echo -n $"Stopping $prog: "
- killproc -p $pidfile $exec
- retval=$?
-echo
- [ $retval -eq 0 ]
-return $retval
-}
-restart () {
- stop
- start
-}
-reload() {
-echo -n $"Reloading $prog: "
- killproc -p $pidfile $exec -HUP
- retval=$?
-echo
-return $retval
-}
-force_reload() {
- restart
-}
-rh_status() {
-# run checks to determine if the service is running or use generic status
- status -p $pidfile $prog
-}
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
-case "$1" in
- start)
- rh_status_q && exit 0
-$1
- ;;
- stop)
- rh_status_q || exit 0
-$1
- ;;
- restart)
-$1
- ;;
- reload)
- rh_status_q || exit 7
-$1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
- ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
- ;;
-*)
-echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
-exit 2
-esac
-exit $?
+The Puppet agent provides a generic init.d script when installed, but a slight
+modification is needed to ensure that Puppet runs in the management namespace:
+
+~~~diff
+--- /etc/init.d/puppet.old
++++ /etc/init.d/puppet
+@@ -38,7 +38,7 @@
+
+ start() {
+ echo -n $"Starting puppet agent: "
+- daemon $daemonopts $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
++ daemon $daemonopts ip netns exec management $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch ${lockfile}
~~~
-Next, add your service to initd management and optionally start it:
+Next, enable the puppet service to be automatically started at boot time, and optionally start it now:
~~~bash
chkconfig --add puppet
@@ -403,33 +307,21 @@ service puppet start
#### Optional: guestshell / systemd
The `guestshell` environment uses **systemd** for service management.
-
-**Example:** Cut and paste the following to create a service file in `/usr/lib/systemd/system/`:
-
-~~~bash
-
-cat >> /usr/lib/systemd/system/my_puppet.service << EOF
-
-[Unit]
-Description=my puppet agent daemon
-After=syslog.target network.target auditd.service
-
-[Service]
-Environment=
-ExecStartPre=
-# Note for below:
-# The command prefix '/bin/nsenter --net=/netns/management --' is only
-# needed if using the management interface for puppet connectivity.
-ExecStart=/bin/nsenter --net=/netns/management -- /opt/puppetlabs/puppet/bin/puppet agent -d
-
-ExecReload=/bin/kill -HUP
-KillMode=process
-Restart=on-failure
-RestartSec=42s
-
-[Install]
-WantedBy=multi-user.target
-EOF
+The Puppet agent provides a generic systemd script when installed, but a slight modification
+is needed to ensure that Puppet runs in the management namespace:
+
+~~~diff
+--- /usr/lib/systemd/system/puppet.service.old
++++ /usr/lib/systemd/system/puppet.service
+@@ -7,7 +7,7 @@
+ EnvironmentFile=-/etc/sysconfig/puppetagent
+ EnvironmentFile=-/etc/sysconfig/puppet
+ EnvironmentFile=-/etc/default/puppet
+-ExecStart=/opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
++ExecStart=/bin/nsenter --net=/var/run/netns/management /opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
+ KillMode=process
+
+ [Install]
~~~
Now enable your Puppet systemd service (the `enable` command adds it to systemd for autostarting the next time you boot) and optionally start it.
@@ -443,11 +335,11 @@ systemctl start my_puppet
## Automated Installation Options
-[Beaker](README-BEAKER.md) - Installing and Configuring Puppet Agent Using the Beaker Tool
+[Beaker](README-beaker-agent-install.md) - Installing and Configuring Puppet Agent Using the Beaker Tool
## References
-[Cisco Nexus Puppet Modules](README.md) - Types, Providers, Utilities
+[Cisco Nexus Puppet Modules](../README.md) - Types, Providers, Utilities
[Cisco Nexus Programmability Guide](http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/programmability/guide/b_Cisco_Nexus_9000_Series_NX-OS_Programmability_Guide/b_Cisco_Nexus_9000_Series_NX-OS_Programmability_Guide_chapter_01010.html) - Guestshell Documentation
diff --git a/README-BEAKER.md b/docs/README-beaker-agent-install.md
similarity index 90%
rename from README-BEAKER.md
rename to docs/README-beaker-agent-install.md
index 2bc56c05a..70dfdf496 100644
--- a/README-BEAKER.md
+++ b/docs/README-beaker-agent-install.md
@@ -37,7 +37,7 @@ at the same time.
* `guestshell`
* This is a secure linux container environment running CentOS. It is enabled by default.
-Access the following [link](README-AGENT-INSTALL.md) for more information on enabling these environments.
+Access the following [link](README-agent-install.md) for more information on enabling these environments.
### Install Beaker
@@ -142,15 +142,13 @@ For installs into the `guestshell`, uncomment the `target: guestshell` field in
## Limitations
-Puppet agent is currently supported on:
-
- * Cisco NX-OS software release 7.0(3)I2(1) and later.
- * Cisco Nexus switch platform models: N95xx, N93xx, N30xx, N31xx.
- * Open source Puppet version 4.0 or greater, or Puppet Enterprise 2015.2 or greater.
-
-Please ensure that the platform is running a supported version of NX-OS software.
-
-Puppet agent runs in either the native NX-OS `bash-shell` environment or in the NX-OS `guestshell` environment.
+Minimum Requirements:
+* Cisco NX-OS Puppet implementation requires open source Puppet version 4.0 or Puppet Enterprise 2015.2
+* Supported Platforms:
+ * Cisco Nexus 95xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
+ * Cisco Nexus 93xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
+ * Cisco Nexus 31xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
+ * Cisco Nexus 30xx, OS Version 7.0(3)I2(1), Environments: Bash-shell, Guestshell
## License Information
diff --git a/README-BEAKER-TESTCASE-EXECUTION.md b/docs/README-beaker-testcase-execution.md
similarity index 58%
rename from README-BEAKER-TESTCASE-EXECUTION.md
rename to docs/README-beaker-testcase-execution.md
index 8d07162c9..71d9fd729 100644
--- a/README-BEAKER-TESTCASE-EXECUTION.md
+++ b/docs/README-beaker-testcase-execution.md
@@ -1,50 +1,56 @@
-# Beaker Test Case Execution For Cisco Systems' Puppet providers #
-
-## Beaker Test Environment ##
-
-The Beaker execution test environment for Cisco Systems' Puppet provider test cases on Nexus devices assumes that the following prerequisites are satisfied before start of execution:
-
-A. Install Beaker and Bundle software on a test server or VM that can ping both the Puppet master and agent successfully. The test server or VM used to execute Beaker test cases is distinct from the Puppet master and agent. Create the Beaker test environment on the test server or VM using this HTTPs wiki link as a reference: https://github.com/puppetlabs/beaker/wiki/Creating-A-Test-Environment.
-
-B. Populate the Beaker host configuration file on the test server or VM that is used to execute Beaker test cases.
-
-C. Enable SSH on the Nexus switch. No other Nexus switch specific configuration steps should be required for executing Beaker tests.
-
-D. Start the Puppet master.
-
-E. Configure SSL certificate exchange between Puppet master and agent.
-
-## Beaker Test Cases ##
-
-Each Puppet provider test case is implemented in a single Beaker test script. A test directory will consist of a suite of test scripts that test a single Puppet provider.
-
-The test case names follow the convention of testdirname-provider-defaults.rb or testdirname-provider-nondefaults.rb or testdirname-provider-negatives.rb. As the naming convention shows, the defaults testcase tests for default attribute values of a Puppet provider resource instance while the non-defaults testcase tests for non-default attribute values of a Puppet provider resource instance. The negative testcase tests for negative attribute values of a Puppet provider resource instance.
-
-## Beaker Test Case Execution ##
-
-A Beaker test case can be executed with these instructions:
-
-(1) cd to the directory that is the top-level for Beaker test directories. This is the repository based path: @cisco-ciscopuppet/tests/beaker_tests.
-
-(2) Execute the 'bundle exec beaker' command string from below with the mentioned options to do a testrun for all test cases under the @cisco-ciscopuppet/tests/beaker_tests directory. This will aggregate all test case results after a single test run.
-
-~~~
-beaker --hosts hosts.cfg \
---pre-suite tests/beaker_tests/presuite/presuite-certcheck.rb \
---no-validate --no-configure \
---test tests/beaker_tests/*/*-provider-*.rb
-~~~
-
-The --debug option may be added if detailed Beaker testcode debug logs are desired.
-
-The --no-validate option disables validation of the host switch that is performed by default by the Beaker tool. This host validation will currently fail for Nexus platform.
-
-The --no-configure option prevents any host or VM images from being configured on the host switch that is performed by default by the Beaker tool. No such host configuration is necessary for executing Beaker tests.
-
-
-
-
-
-
-
-
+# Beaker Test Case Execution For Cisco Systems' Puppet providers #
+
+## Beaker Test Environment ##
+
+The Beaker execution test environment for Cisco Systems' Puppet provider test cases on Nexus devices assumes that the following prerequisites are satisfied before start of execution:
+
+A. Install Beaker and Bundle software on a test server or VM that can ping both the Puppet master and agent successfully. The test server or VM used to execute Beaker test cases is distinct from the Puppet master and agent. Create the Beaker test environment on the test server or VM using this HTTPs wiki link as a reference: https://github.com/puppetlabs/beaker/wiki/Creating-A-Test-Environment.
+
+B. Populate the Beaker host configuration file on the test server or VM that is used to execute Beaker test cases.
+
+C. Enable SSH on the Nexus switch.
+
+D. Create a devops user with sudo access on the Nexus switch for the Beaker workstation to access the `bash-shell` environment. No other Nexus switch specific configuration steps should be required for executing Beaker tests.
+
+**Example:**
+
+```bash
+configure terminal
+ feature ssh
+ username devops password devopspassword role network-admin
+ username devops shelltype bash
+end
+```
+
+E. Start the Puppet master.
+
+F. Configure SSL certificate exchange between Puppet master and agent.
+
+## Beaker Test Case Execution ##
+
+A Beaker test case can be executed with these instructions:
+
+(1) cd to the directory that is the top-level for Beaker test directories. This is the repository based path: @cisco-ciscopuppet/tests/beaker_tests.
+
+(2) Execute the 'beaker' command string shown below with the mentioned options to do a testrun for all test cases under the @cisco-ciscopuppet/ directory. This will aggregate all test case results after a single test run.
+
+~~~
+beaker --hosts hosts.cfg \
+--pre-suite tests/beaker_tests/presuite/presuite-certcheck.rb \
+--no-validate --no-configure \
+--test tests/beaker_tests/
+~~~
+
+The --debug option may be added if detailed Beaker testcode debug logs are desired.
+
+The --no-validate option disables validation of the host switch that is performed by default by the Beaker tool. This host validation will currently fail for Nexus platform.
+
+The --no-configure option prevents any host or VM images from being configured on the host switch that is performed by default by the Beaker tool. No such host configuration is necessary for executing Beaker tests.
+
+
+
+
+
+
+
+
diff --git a/README-BEAKER-TESTCASE-WRITING.md b/docs/README-beaker-testcase-writing.md
similarity index 90%
rename from README-BEAKER-TESTCASE-WRITING.md
rename to docs/README-beaker-testcase-writing.md
index 0f0f28dca..04b5d5643 100644
--- a/README-BEAKER-TESTCASE-WRITING.md
+++ b/docs/README-beaker-testcase-writing.md
@@ -1,40 +1,40 @@
-# Beaker Test Case Writing For Cisco Systems' Puppet providers #
-
-
-## Beaker Test Cases ##
-
-Each Puppet provider test case is implemented in a single Beaker test script. A test directory will consist of a suite of test scripts that test a single Puppet provider.
-
-The test case names follow the convention of testdirname-provider-defaults.rb or testdirname-provider-nondefaults.rb or testdirname-provider-negatives.rb. As the naming convention shows, the defaults testcase tests for default attribute values of a Puppet provider resource instance while the non-defaults testcase tests for non-default attribute values of a Puppet provider resource instance. The negative testcase tests for negative attribute values of a Puppet provider resource instance.
-
-## Beaker Test Case Sections ##
-
-Every Beaker test case is expected to have:
-
-- a test case setup section,
-- a resource creation section and
-- a resource deletion section.
-
-The setup section sets the switch up for test case execution.
-
-The creation section creates the Puppet resource instance and performs attribute verification using resource command on switch agent. It also verifies the switch state using NXOS running-config show CLI commands.
-
-The deletion section deletes the Puppet resource instance and performs attribute verification using resource command on switch agent. It also verifies the lack of switch state using NXOS running-config show CLI commands.
-
-The library file in the test directory is expected to contain the manifest generation methods defined in a module for usage in the test cases.
-
-## Beaker Test Case Writing ##
-
-A new Beaker test case may be added using these instructions:
-
-(1) Add a Setup test step to the test script. This step will consist of setting the Puppet Master's manifest filename as well as cleaning up the switch test state before start of further test steps using a call to `on()` method with the command string set to the vshell command for the feature cleanup for the particular Puppet provider in test.
-
-(2) Add a set of test steps after (1) for the creation of the Puppet provider resource. This section will consist of a `puppet agent` command transaction executed using `on()` method invocation with host set to agent, command set to the `puppet agent` command string to get the creation manifest with `ensure` set to `present` from the master server and the expected exit code for a successful transaction. It will be followed by verification of resource attributes using an `on()` method invocation with command string set to the `puppet resource` command for the resource instance of the Puppet provider. Further verification will involve a call to `on()` method using a command string set to the `vshell` command for the NXOS running-config show CLI. The matching in these test steps will occur for presence of RegExp patterns.
-
-(3) Add another set of test steps after (2) for the deletion of the Puppet provider resource. The list of test steps will be similar to (2) except that the manifest will typically have the `ensure` attribute set to `absent` to delete the resource. The resource attribute verification and show running-config CLI command verification steps will be similar to (2) except that the matching will occur for absence of RegExp patterns.
-
-## Beaker Test Case Template ##
-
-There is a sample Beaker test template located at @cisco-ciscopuppet/docs/ called template-provider-ensurabilitytest.rb that can be used to write test cases for Puppet providers. The test template is written for a sample Cisco Systems' Nexus Puppet provider called cisco_provider. It is a single test case that is implemented in a Beaker test script.
-
+# Beaker Test Case Writing For Cisco Systems' Puppet providers #
+
+
+## Beaker Test Cases ##
+
+Each Puppet provider test case is implemented in a single Beaker test script. A test directory will consist of a suite of test scripts that test a single Puppet provider.
+
+The test case names follow the convention of testdirname-provider-defaults.rb or testdirname-provider-nondefaults.rb or testdirname-provider-negatives.rb. As the naming convention shows, the defaults testcase tests for default attribute values of a Puppet provider resource instance while the non-defaults testcase tests for non-default attribute values of a Puppet provider resource instance. The negative testcase tests for negative attribute values of a Puppet provider resource instance.
+
+## Beaker Test Case Sections ##
+
+Every Beaker test case is expected to have:
+
+- a test case setup section,
+- a resource creation section and
+- a resource deletion section.
+
+The setup section sets the switch up for test case execution.
+
+The creation section creates the Puppet resource instance and performs attribute verification using the 'puppet resource' command on the switch. It also verifies the switch state using NXOS running-config show CLI commands.
+
+The deletion section deletes the Puppet resource instance and performs attribute verification using the 'puppet resource' command on the switch. It also verifies the lack of switch state using NXOS running-config show CLI commands.
+
+The library file in the test directory is expected to contain the manifest generation methods defined in a module for usage in the test cases.
+
+## Beaker Test Case Writing ##
+
+A new Beaker test case may be added using these instructions:
+
+(1) Add a Setup test step to the test script. This step will consist of setting the Puppet Master's manifest filename as well as cleaning up the switch test state before start of further test steps using a call to `on()` method with the command string set to the vshell command for the feature cleanup for the particular Puppet provider in test.
+
+(2) Add a set of test steps after (1) for the creation of the Puppet provider resource. This section will consist of a `puppet agent` command transaction executed using `on()` method invocation with host set to agent, command set to the `puppet agent` command string to get the creation manifest with `ensure` set to `present` from the master server and the expected exit code for a successful transaction. It will be followed by verification of resource attributes using an `on()` method invocation with command string set to the `puppet resource` command for the resource instance of the Puppet provider. Further verification will involve a call to `on()` method using a command string set to the `vshell` command for the NXOS running-config show CLI. The matching in these test steps will occur for presence of RegExp patterns.
+
+(3) Add another set of test steps after (2) for the deletion of the Puppet provider resource. The list of test steps will be similar to (2) except that the manifest will typically have the `ensure` attribute set to `absent` to delete the resource. The resource attribute verification and show running-config CLI command verification steps will be similar to (2) except that the matching will occur for absence of RegExp patterns.
+
+## Beaker Test Case Template ##
+
+There is a sample Beaker test template located at @cisco-ciscopuppet/docs/ called template-provider-ensurabilitytest.rb that can be used to write test cases for Puppet providers. The test template is written for a sample Cisco Systems' Nexus Puppet provider called cisco_provider. It is a single test case that is implemented in a Beaker test script.
+
\ No newline at end of file
diff --git a/README-creating-types-providers.md b/docs/README-develop-types-providers.md
similarity index 92%
rename from README-creating-types-providers.md
rename to docs/README-develop-types-providers.md
index 2544625de..9bd0d9a9a 100644
--- a/README-creating-types-providers.md
+++ b/docs/README-develop-types-providers.md
@@ -1,4 +1,4 @@
-# Creating Cisco NX-OS Types and Providers
+# Developing Cisco NX-OS Types and Providers
#### Table of Contents
@@ -28,9 +28,9 @@ There are multiple components involved when creating new resources. This documen
* [Resource providers](https://docs.puppetlabs.com/guides/provider_development.html) are essentially backends that implement support for a specific implementation of a given resource type.
-* The types and providers work in conjunction with a node\_utils API, which is the interface between Puppet agent and the NX-OS CLI. Please see the [README-creating-node_utils-APIs.md](#README-creating-node_utils-APIs.md) guide for more information on writing node_utils APIs.
+* The types and providers work in conjunction with a node\_utils API, which is the interface between Puppet agent and the NX-OS CLI. Please see the [README-develop-node-utils-APIs.md] (https://github.com/cisco/cisco-network-node-utils/blob/master/README-develop-node-utils-APIs.md) guide for more information on writing node_utils APIs.
-This document relies heavily on example code. The examples in this document can be written independently, but they are intended to work in conjuction with the example node_utils APIs created in the [README-creating-node_utils-APIs.md](#README-creating-node_utils-APIs.md) guide. The examples in that guide are based on code templates for the `feature bash-shell` CLI and the `router eigrp` CLI. Note that some people prefer to write the node_utils API before the resource types and providers, while others might prefer the opposite workflow.
+This document relies heavily on example code. The examples in this document can be written independently, but they are intended to work in conjuction with the example node_utils APIs created in the [README-develop-node_utils-APIs.md](https://github.com/cisco/cisco-network-node-utils/blob/master/README-develop-node-utils-APIs.md) guide. The examples in that guide are based on code templates for the `feature bash-shell` CLI and the `router eigrp` CLI. Note that some people prefer to write the node_utils API before the resource types and providers, while others might prefer the opposite workflow.
## Start here: Clone the Repo
@@ -39,7 +39,7 @@ Please see the [CONTRIBUTING](#CONTRIBUTING) document for workflow instructions.
First install the code base. Clone the ciscopuppet repo into a workspace:
~~~bash
-git clone https://github.com/puppetlabs/cisco-ciscopuppet
+git clone https://github.com/cisco/cisco-network-puppet-module.git
~~~
## Basic Example: feature bash-shell
@@ -192,7 +192,7 @@ end
## Step 3. Testing: feature bash-shell
-Test the new resource using the guestshell environment. See [README-AGENT-INSTALL](#README-AGENT-INSTALL.md) for using Puppet agent in guestshell.
+Test the new resource using the guestshell environment. See [README-agent-install.md](README-agent-install.md) for using Puppet agent in guestshell.
* Create a manifest for the new resource:
@@ -284,25 +284,19 @@ puppet resource cisco_bash_shell 'test_off' ensure=absent
## Static Analysis
-* rubocop is a Ruby static analysis tool. Run [rubocop](https://rubygems.org/gems/rubocop) with the --lint option to validate the new code:
+* rubocop is a Ruby static analysis tool. Run [rubocop](https://rubygems.org/gems/rubocop) to validate the new code:
~~~bash
-% rubocop --lint type/cisco_bash_feature.rb provider/cisco_bash_feature/nxapi.rb
-warning: parser/current is loading parser/ruby21, which recognizes
-warning: 2.1.7-compliant syntax, but you are running 2.1.1.
+% rubocop type/cisco_bash_feature.rb provider/cisco_bash_feature/nxapi.rb
Inspecting 2 files
..
2 files inspected, no offenses detected
~~~
-* TBD: Run [puppet-lint](https://rubygems.org/gems/puppet-lint) against changed files.
-
-
## Complex Example: router eigrp
-This resource type and provider exercise will build on the router_eigrp API example shown in the cisco node_utils [README-creating-node_utils-APIs](#README-creating-node_utils-APIs.md) document.
-
+This resource type and provider exercise will build on the router_eigrp API example shown in the cisco node_utils [README-develop-node-utils-APIs](https://github.com/cisco/cisco-network-node-utils/blob/master/README-develop-node-utils-APIs.md) document.
The router_eigrp node_utils example created a new API for the cli below:
~~~
@@ -693,19 +687,16 @@ puppet resource cisco_router_eigrp "xyz" ensure=absent
## Static Analysis
-* Run [rubocop](https://rubygems.org/gems/rubocop) with the --lint option to validate the new code:
+* Run [rubocop](https://rubygems.org/gems/rubocop) to validate the new code:
~~~bash
-% rubocop --lint type/cisco_router_eigrp.rb provider/cisco_router_eigrp/nxapi.rb
+% rubocop type/cisco_router_eigrp.rb provider/cisco_router_eigrp/nxapi.rb
Inspecting 2 files
..
2 files inspected, no offenses detected
~~~
-* TBD: Run [puppet-lint](https://rubygems.org/gems/puppet-lint) against changed files.
-
-
## Next Steps
Please see the [CONTRIBUTING](#CONTRIBUTING) document for workflow instructions.
diff --git a/docs/README-maintainers.md b/docs/README-maintainers.md
new file mode 100644
index 000000000..3d6bd5a61
--- /dev/null
+++ b/docs/README-maintainers.md
@@ -0,0 +1,80 @@
+# Maintainers Guide
+
+Guidelines for the core maintainers of the ciscopuppet project - above and beyond the [general developer guidelines](https://github.com/cisco/cisco-network-puppet-module/blob/develop/CONTRIBUTING.md).
+
+## Accepting Pull Requests
+
+* Is the pull request correctly submitted against the `develop` branch?
+* (TODO - not yet) Does `rubocop` pass? (TODO - this will be part of our CI integration to run automatically)
+* Is `CHANGELOG.md` updated appropriately?
+* Are new Beaker tests added? Do they provide sufficient coverage and consistent results?
+* Are the example manifests updated appropriately? Does puppet-lint pass? (TODO - add to CI)
+* Do tests pass on both N9K and N3K? (In particular, N3048 often has unique behavior.)
+
+## Setting up git-flow
+
+If you don't already have [`git-flow`](https://github.com/petervanderdoes/gitflow/) installed, install it.
+
+Either run `git flow init` from the repository root directory, or manually edit your `.git/config` file. Either way, when done, you should have the following in your config:
+
+```ini
+[gitflow "branch"]
+ master = master
+ develop = develop
+[gitflow "prefix"]
+ feature = feature/
+ release = release/
+ hotfix = hotfix/
+ support = support/
+ versiontag = v
+```
+
+Most of these are default for git-flow except for the `versiontag` setting.
+
+## Release Process
+
+When we agree as a team that a new release should be published, the process is as follows:
+
+1. Ensure that tests have been executed against released Gem versions (release a new version if necessary!) and do not have dependencies on unreleased Gem code.
+
+2. Create a release branch. Follow [semantic versioning](http://semver.org) - a bugfix release is a 0.0.x version bump, a new feature is a 0.x.0 bump, and a backward-incompatible change is a new x.0.0 version.
+
+ ```
+ git flow release start 1.0.1
+ ```
+
+3. In the newly created release branch, update `CHANGELOG.md`:
+
+ ```diff
+ -## [Unreleased]
+ +## [1.0.1] - 2015-08-28
+ ...
+ +[1.0.1]: https://github.com/cisco/cisco-network-puppet-module/compare/v1.0.0...v1.0.1
+ [1.0.0]: https://github.com/cisco/cisco-network-puppet-module/compare/v0.9.0...v1.0.0
+ ```
+
+ and also update `metadata.json`:
+
+ ```diff
+ "name": "puppetlabs-ciscopuppet",
+ - "version": "1.0.0",
+ + "version": "1.0.1",
+ "author": "cisco",
+ ```
+
+4. Commit your changes and push the release branch to GitHub for review by Cisco and PuppetLabs:
+
+ ```
+ git flow release publish 1.0.1
+ ```
+
+5. Once Cisco and PuppetLabs are in agreement that the release branch is sane, finish the release and push the finished release to GitHub:
+
+ ```
+ git flow release finish 1.0.1
+ git push origin master
+ git push origin develop
+ git push --tags
+ ```
+
+6. Add release notes on GitHub, for example `https://github.com/cisco/cisco-network-puppet-module/releases/new?tag=v1.0.1`. Usually this will just be a copy-and-paste of the relevant section of the `CHANGELOG.md`.
\ No newline at end of file
diff --git a/README-Managing_packages.md b/docs/README-package-provider.md
similarity index 97%
rename from README-Managing_packages.md
rename to docs/README-package-provider.md
index aec2c65cb..259524ed7 100644
--- a/README-Managing_packages.md
+++ b/docs/README-package-provider.md
@@ -97,6 +97,6 @@ package { 'package_B':
[Puppet package resource types](https://docs.puppetlabs.com/references/latest/type.html#package) - Generic and specific package management resources.
-[Cisco Nexus Puppet Modules](README.md) - Types, Providers, Utilities
+[Cisco Nexus Puppet Modules](../README.md) - Types, Providers, Utilities
[Cisco Nexus Programmability Guide](http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/programmability/guide/b_Cisco_Nexus_9000_Series_NX-OS_Programmability_Guide/b_Cisco_Nexus_9000_Series_NX-OS_Programmability_Guide_chapter_01010.html) - Guestshell Documentation
diff --git a/puppet_outline.png b/docs/puppet_outline.png
similarity index 100%
rename from puppet_outline.png
rename to docs/puppet_outline.png
diff --git a/docs/template-provider-ensurabilitytest.rb b/docs/template-__PROVIDER__-ensurabilitytest.rb
similarity index 53%
rename from docs/template-provider-ensurabilitytest.rb
rename to docs/template-__PROVIDER__-ensurabilitytest.rb
index cb44d6beb..bffe9947c 100644
--- a/docs/template-provider-ensurabilitytest.rb
+++ b/docs/template-__PROVIDER__-ensurabilitytest.rb
@@ -13,80 +13,86 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
-# TestCase Name:
+#
+# TestCase Name:
# -------------
-# Template-Provider-EnsurabilityTest.rb
+# .rb
#
# TestCase Prerequisites:
# -----------------------
-# This is a Puppet Provider resource testcase for Puppet Agent on Nexus devices.
+# This is a Puppet resource testcase for Puppet Agent on Nexus
+# devices.
+#
# The test case assumes the following prerequisites are already satisfied:
-# A. Populating the HOSTS configuration file with the agent and master
-# information.
-# B. Enabling SSH connection prerequisites on the N9K switch based Agent.
-# C. Starting of Puppet master server on master.
-# D. Sending to and signing of Puppet agent certificate request on master.
+# - Host configuration file contains agent and master information.
+# - SSH is enabled on the NX-OS Agent.
+# - Puppet master/server is started.
+# - Puppet agent certificate has been signed on the Puppet master/server.
#
# TestCase:
# ---------
# This is a PROVIDER resource test that tests for 'ensure' attribute with
# a state transition from 'present' to 'absent'.
#
-# There are 2 sections to the testcase: Setup, group of teststeps.
-# The 1st step is the Setup teststep that cleans up the switch state.
-# Steps 2-4 deal with cisco_provider resource creation and its
-# verification using Puppet Agent and the switch running-config.
-# Steps 5-7 deal with cisco_provider resource deletion and its
-# verification using Puppet Agent and the switch running-config.
+# The following exit_codes are validated for Puppet, Vegas shell and
+# Bash shell commands.
+#
+# Vegas and Bash Shell Commands:
+# 0 - successful command execution
+# > 0 - failed command execution.
#
-# The testcode checks for exit_codes from Puppet Agent, Vegas shell and
-# Bash shell command executions. For Vegas shell and Bash shell command
-# string executions, this is the exit_code convention:
-# 0 - successful command execution, > 0 - failed command execution.
-# For Puppet Agent command string executions, this is the exit_code convention:
-# 0 - no changes have occurred, 1 - errors have occurred,
-# 2 - changes have occurred, 4 - failures have occurred and
+# Puppet Commands:
+# 0 - no changes have occurred
+# 1 - errors have occurred,
+# 2 - changes have occurred
+# 4 - failures have occurred and
# 6 - changes and failures have occurred.
-# 0 is the default exit_code checked in Beaker::DSL::Helpers::on() method.
-# The testcode also uses RegExp pattern matching on stdout or output IO
-# instance attributes of Result object from on() method invocation.
#
+# NOTE: 0 is the default exit_code checked in Beaker::DSL::Helpers::on() method.
+#
+# The test cases use RegExp pattern matching on stdout or output IO
+# instance attributes to verify resource properties.
###############################################################################
-# Require UtilityLib.rb and ProviderLib.rb paths.
+# Require UtilityLib.rb and __PROVIDERLIB__.rb paths.
require File.expand_path("../../lib/utilitylib.rb", __FILE__)
-require File.expand_path("../providerlib.rb", __FILE__)
+require File.expand_path("../__PROVIDERLIB__.rb", __FILE__)
+# -----------------------------
+# Common settings and variables
+# -----------------------------
result = 'PASS'
-testheader = "PROVIDER Resource :: Ensurability"
+testheader = "__PROVIDER__ Resource :: Ensurability"
-# @test_name [TestCase] Executes ensurability testcase for PROVIDER Resource.
+# @test_name [TestCase] Executes ensurability testcase for __PROVIDER__ Resource.
test_name "TestCase :: #{testheader}" do
- # @step [Step] Sets up switch for provider test.
- step "TestStep :: Setup switch for provider test" do
+ # ------------------
+ # List of Test Steps
+ # ------------------
+ step "TestStep :: Setup switch for test" do
# Define PUPPETMASTER_MANIFESTPATH constant using puppet config cmd.
UtilityLib.set_manifest_path(master, self)
- # Expected exit_code is 0 since this is a vegas shell cmd.
- cmd_str = UtilityLib.get_vshell_cmd("conf t ; no feature provider")
+ # Expected exit_code depends on the feature for this vegas shell cmd.
+ # Expected exit_code can be 0 or can be > 0 depending on feature.
+ cmd_str = UtilityLib.get_vshell_cmd("conf t ; no feature ")
on(agent, cmd_str)
# Expected exit_code is 0 since this is a vegas shell cmd.
# Flag is set to true to check for absence of RegExp pattern in stdout.
- cmd_str = UtilityLib.get_vshell_cmd("show running-config section provider")
+ cmd_str = UtilityLib.get_vshell_cmd("show running-config section ")
on(agent, cmd_str) do
- UtilityLib.search_pattern_in_output(stdout, [/feature provider/],
+ UtilityLib.search_pattern_in_output(stdout, [/feature /],
true, self, logger)
end
- logger.info("Setup switch for provider test :: #{result}")
+ logger.info("Setup switch for test :: #{result}")
end
- # @step [Step] Requests manifest from the master server to the agent.
step "TestStep :: Get resource present manifest from master" do
# Expected exit_code is 0 since this is a bash shell cmd.
- on(master, ProviderLib.create_provider_manifest_present())
+ on(master, __PROVIDERLIB__.create__manifest_present())
# Expected exit_code is 2 since this is a puppet agent cmd with change.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
@@ -96,37 +102,34 @@
logger.info("Get resource present manifest from master :: #{result}")
end
- # @step [Step] Checks cisco_provider resource on agent using resource cmd.
- step "TestStep :: Check cisco_provider resource presence on agent" do
+ step "TestStep :: Check resource presence on agent" do
# Expected exit_code is 0 since this is a puppet resource cmd.
# Flag is set to false to check for presence of RegExp pattern in stdout.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
- "resource cisco_provider test", options)
+ "resource test", options)
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout, {'ensure' => 'present'},
false, self, logger)
end
- logger.info("Check cisco_provider resource presence on agent :: #{result}")
+ logger.info("Check resource presence on agent :: #{result}")
end
- # @step [Step] Checks provider instance on agent using switch show cli cmds.
- step "TestStep :: Check provider instance presence on agent" do
+ step "TestStep :: Check instance presence on agent" do
# Expected exit_code is 0 since this is a vegas shell cmd.
# Flag is set to false to check for presence of RegExp pattern in stdout.
- cmd_str = UtilityLib.get_vshell_cmd("show running-config section provider")
+ cmd_str = UtilityLib.get_vshell_cmd("show running-config section ")
on(agent, cmd_str) do
- UtilityLib.search_pattern_in_output(stdout, [/provider test/],
+ UtilityLib.search_pattern_in_output(stdout, [/ test/],
false, self, logger)
end
- logger.info("Check provider instance presence on agent :: #{result}")
+ logger.info("Check instance presence on agent :: #{result}")
end
- # @step [Step] Requests manifest from the master server to the agent.
step "TestStep :: Get resource absent manifest from master" do
# Expected exit_code is 0 since this is a bash shell cmd.
- on(master, ProviderLib.create_provider_manifest_absent())
+ on(master, __PROVIDERLIB__.create__manifest_absent())
# Expected exit_code is 2 since this is a puppet agent cmd with change.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
@@ -136,31 +139,29 @@
logger.info("Get resource absent manifest from master :: #{result}")
end
- # @step [Step] Checks cisco_provider resource on agent using resource cmd.
- step "TestStep :: Check cisco_provider resource absence on agent" do
+ step "TestStep :: Check resource absence on agent" do
# Expected exit_code is 0 since this is a puppet resource cmd.
# Flag is set to true to check for absence of RegExp pattern in stdout.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
- "resource cisco_provider test", options)
+ "resource test", options)
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout, {'ensure' => 'present'},
true, self, logger)
end
- logger.info("Check cisco_provider resource absence on agent :: #{result}")
+ logger.info("Check resource absence on agent :: #{result}")
end
- # @step [Step] Checks provider instance on agent using switch show cli cmds.
- step "TestStep :: Check provider instance absence on agent" do
+ step "TestStep :: Check instance absence on agent" do
# Expected exit_code is 0 since this is a vegas shell cmd.
# Flag is set to true to check for absence of RegExp pattern in stdout.
- cmd_str = UtilityLib.get_vshell_cmd("show running-config section provider")
+ cmd_str = UtilityLib.get_vshell_cmd("show running-config section ")
on(agent, cmd_str) do
- UtilityLib.search_pattern_in_output(stdout, [/provider test/],
+ UtilityLib.search_pattern_in_output(stdout, [/ test/],
true, self, logger)
end
- logger.info("Check provider instance absence on agent :: #{result}")
+ logger.info("Check instance absence on agent :: #{result}")
end
# @raise [PassTest/FailTest] Raises PassTest/FailTest exception using result.
diff --git a/examples/demo_interface.pp b/examples/demo_interface.pp
index 8dd8b9e04..97ad280fb 100644
--- a/examples/demo_interface.pp
+++ b/examples/demo_interface.pp
@@ -21,6 +21,7 @@
description => 'managed by puppet',
ipv4_address => '192.168.55.55',
ipv4_netmask_length => 24,
+ vrf => 'test',
}
cisco_interface { 'Ethernet1/2':
diff --git a/examples/install.pp b/examples/install.pp
index 8ee927a03..41dbffe3e 100644
--- a/examples/install.pp
+++ b/examples/install.pp
@@ -24,26 +24,10 @@
$opts = { '--http-proxy' => $proxy }
}
- package { 'net_http_unix' :
- ensure => present,
- provider => 'gem',
- source => $repo,
- install_options => $opts,
- }
-
- package { 'cisco_nxapi' :
- ensure => present,
- provider => 'gem',
- source => $repo,
- install_options => $opts,
- require => Package['net_http_unix'],
- }
-
package { 'cisco_node_utils' :
ensure => present,
provider => 'gem',
source => $repo,
install_options => $opts,
- require => Package['cisco_nxapi'],
}
}
diff --git a/lib/facter/cisco.rb b/lib/facter/cisco.rb
index b1ae8cce5..b8473da3d 100644
--- a/lib/facter/cisco.rb
+++ b/lib/facter/cisco.rb
@@ -1,16 +1,11 @@
require 'facter'
Facter.add(:cisco) do
- # Facter isn't aware of Puppet features so we have to check for the gem:
- confine do
- begin
- require 'cisco_node_utils'
- true
- rescue LoadError
- false
- end
+ confine :operatingsystem => :nexus
+ confine :cisco_node_utils do
+ # Any version is OK so long as it is installed
+ true
end
- confine :kernel => 'Linux' # TODO be more specific
setcode do
hash = {}
diff --git a/lib/facter/cisco_node_utils.rb b/lib/facter/cisco_node_utils.rb
new file mode 100644
index 000000000..73f25b16b
--- /dev/null
+++ b/lib/facter/cisco_node_utils.rb
@@ -0,0 +1,17 @@
+require 'facter'
+
+Facter.add(:cisco_node_utils) do
+ # Facter isn't aware of Puppet features so we have to check for the gem:
+ confine do
+ begin
+ require 'cisco_node_utils'
+ true
+ rescue LoadError
+ false
+ end
+ end
+
+ setcode do
+ CiscoNodeUtils::VERSION
+ end
+end
diff --git a/lib/facter/cisco_nxapi.rb b/lib/facter/cisco_nxapi.rb
new file mode 100644
index 000000000..2b8f7bcbc
--- /dev/null
+++ b/lib/facter/cisco_nxapi.rb
@@ -0,0 +1,16 @@
+require 'facter'
+
+Facter.add(:cisco_nxapi) do
+ confine do
+ begin
+ require 'cisco_nxapi'
+ true
+ rescue LoadError
+ false
+ end
+ end
+
+ setcode do
+ CiscoNxapi::VERSION
+ end
+end
diff --git a/lib/puppet/feature/cisco_node_utils.rb b/lib/puppet/feature/cisco_node_utils.rb
index bdbc43a50..996c32604 100644
--- a/lib/puppet/feature/cisco_node_utils.rb
+++ b/lib/puppet/feature/cisco_node_utils.rb
@@ -1,4 +1,51 @@
require 'puppet/util/feature'
# We have the cisco_node_utils gem
-Puppet.features.add(:cisco_node_utils, :libs => ['cisco_node_utils'])
+Puppet.features.add(:cisco_node_utils, libs: ['cisco_node_utils'])
+
+# TODO: simplify if https://tickets.puppetlabs.com/browse/PUP-1159 gets fixed.
+# Override the default caching logic created in Puppet.features:
+#
+# meta_def('cisco_node_utils?') do
+# # we return a cached result if:
+# # * if a block is given (and we just evaluated it above)
+# # * if we already have a positive result
+# # * if we've tested this feature before and it failed, but we're
+# # configured to always cache
+# if block_given? ||
+# @results['cisco_node_utils'] ||
+# (@results.has_key?('cisco_node_utils') and
+# Puppet[:always_cache_features])
+# @results['cisco_node_utils']
+# else
+# @results['cisco_node_utils'] = test('cisco_node_utils',
+# libs: ['cisco_node_utils'])
+# @results['cisco_node_utils']
+# end
+# end
+
+class < :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
def initialize(value={})
super(value)
diff --git a/lib/puppet/provider/cisco_interface/nxapi.rb b/lib/puppet/provider/cisco_interface/nxapi.rb
index 889bc682b..89a20ce23 100644
--- a/lib/puppet/provider/cisco_interface/nxapi.rb
+++ b/lib/puppet/provider/cisco_interface/nxapi.rb
@@ -30,14 +30,17 @@
desc "The NXAPI provider for cisco_interface."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
# Property symbol arrays for method auto-generation. There are separate arrays
# because the boolean-based methods are processed slightly different.
# Note: switchport_mode should always process first to evaluate L2 vs L3.
+ # Note: vrf should be the first L3 property to process. The AutoGen vrf
+ # setting is not used.
INTF_NON_BOOL_PROPS = [
- :switchport_mode, :access_vlan, :description,
+ :switchport_mode, :vrf, :access_vlan, :description,
:ipv4_address, :ipv4_netmask_length,
]
INTF_BOOL_PROPS = [
@@ -148,6 +151,23 @@ def ipv4_addr_mask_set
end
end
+# override vrf setter
+ def vrf=(val)
+ val = @interface.default_vrf if val == :default
+ @property_flush[:vrf] = val
+
+ # flush other L3 properties because vrf will wipe them out
+ l3_props = [
+ :ipv4_proxy_arp, :ipv4_redirects,
+ :ipv4_address, :ipv4_netmask_length,
+ ]
+ l3_props.each { |prop|
+ if @property_flush[prop].nil?
+ @property_flush[prop] = @property_hash[prop] unless @property_hash[prop].nil?
+ end
+ }
+ end
+
def flush
if @property_flush[:ensure] == :absent
@interface.destroy
diff --git a/lib/puppet/provider/cisco_interface_ospf/nxapi.rb b/lib/puppet/provider/cisco_interface_ospf/nxapi.rb
index 40965ff36..39fb4748a 100644
--- a/lib/puppet/provider/cisco_interface_ospf/nxapi.rb
+++ b/lib/puppet/provider/cisco_interface_ospf/nxapi.rb
@@ -29,6 +29,7 @@
desc "The nxapi provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_ospf/nxapi.rb b/lib/puppet/provider/cisco_ospf/nxapi.rb
index 1944b4a1a..e54f6f8f3 100644
--- a/lib/puppet/provider/cisco_ospf/nxapi.rb
+++ b/lib/puppet/provider/cisco_ospf/nxapi.rb
@@ -22,6 +22,7 @@
desc "The NXAPI provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_ospf_vrf/nxapi.rb b/lib/puppet/provider/cisco_ospf_vrf/nxapi.rb
index 4bf191564..06a32b073 100644
--- a/lib/puppet/provider/cisco_ospf_vrf/nxapi.rb
+++ b/lib/puppet/provider/cisco_ospf_vrf/nxapi.rb
@@ -30,6 +30,7 @@
desc "The NXAPI provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_snmp_community/nxapi.rb b/lib/puppet/provider/cisco_snmp_community/nxapi.rb
index 8572e4904..5537af9bb 100644
--- a/lib/puppet/provider/cisco_snmp_community/nxapi.rb
+++ b/lib/puppet/provider/cisco_snmp_community/nxapi.rb
@@ -23,6 +23,7 @@
desc "The NXAPI provider for cisco_snmp_community"
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_snmp_group/nxapi.rb b/lib/puppet/provider/cisco_snmp_group/nxapi.rb
index 009c5c7fd..d949bfd71 100644
--- a/lib/puppet/provider/cisco_snmp_group/nxapi.rb
+++ b/lib/puppet/provider/cisco_snmp_group/nxapi.rb
@@ -22,6 +22,7 @@
desc "The NXAPI provider for snmp group."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_snmp_server/nxapi.rb b/lib/puppet/provider/cisco_snmp_server/nxapi.rb
index 7dc0dae5a..aa3654c31 100644
--- a/lib/puppet/provider/cisco_snmp_server/nxapi.rb
+++ b/lib/puppet/provider/cisco_snmp_server/nxapi.rb
@@ -22,6 +22,7 @@
desc "The nxapi provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_snmp_user/nxapi.rb b/lib/puppet/provider/cisco_snmp_user/nxapi.rb
index 11b27847b..8fe99dc73 100644
--- a/lib/puppet/provider/cisco_snmp_user/nxapi.rb
+++ b/lib/puppet/provider/cisco_snmp_user/nxapi.rb
@@ -22,6 +22,7 @@
desc "The NXAPI provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_tacacs_server/nxapi.rb b/lib/puppet/provider/cisco_tacacs_server/nxapi.rb
index 6aaaed5f8..a5c74022f 100644
--- a/lib/puppet/provider/cisco_tacacs_server/nxapi.rb
+++ b/lib/puppet/provider/cisco_tacacs_server/nxapi.rb
@@ -24,6 +24,7 @@
desc "The nxapi provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_tacacs_server_host/nxapi.rb b/lib/puppet/provider/cisco_tacacs_server_host/nxapi.rb
index e44169f68..d59e88922 100644
--- a/lib/puppet/provider/cisco_tacacs_server_host/nxapi.rb
+++ b/lib/puppet/provider/cisco_tacacs_server_host/nxapi.rb
@@ -24,6 +24,7 @@
desc "The NXAPI provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_vlan/nxapi.rb b/lib/puppet/provider/cisco_vlan/nxapi.rb
index c66bc3514..3a7d63cc8 100644
--- a/lib/puppet/provider/cisco_vlan/nxapi.rb
+++ b/lib/puppet/provider/cisco_vlan/nxapi.rb
@@ -29,6 +29,7 @@
desc "The new NXAPI provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/cisco_vtp/nxapi.rb b/lib/puppet/provider/cisco_vtp/nxapi.rb
index b604376dd..7b6710cad 100644
--- a/lib/puppet/provider/cisco_vtp/nxapi.rb
+++ b/lib/puppet/provider/cisco_vtp/nxapi.rb
@@ -29,6 +29,7 @@
desc "The nxapi provider."
confine :feature => :cisco_node_utils
+ defaultfor :operatingsystem => :nexus
mk_resource_methods
diff --git a/lib/puppet/provider/package/nxapi.rb b/lib/puppet/provider/package/nxapi.rb
index a8ebecae5..bcfc38f19 100644
--- a/lib/puppet/provider/package/nxapi.rb
+++ b/lib/puppet/provider/package/nxapi.rb
@@ -32,11 +32,7 @@
# these commands must exist to execute native yum provider
commands :yum => "yum", :rpm => "rpm", :python => "python"
- # (TEMPORARY) must include line to prevent default yum getting chosen in GS
- defaultfor :osfamily => :RedHat
- # uncomment these lines when new facter facts are implemented
- #defaultfor :osfamily => :wrlinux
- #defaultfor :operatingsystem => :nexus
+ defaultfor :operatingsystem => :nexus
# if the following commands aren't present, we're in trouble
if command('rpm')
diff --git a/lib/puppet/type/cisco_interface.rb b/lib/puppet/type/cisco_interface.rb
index 0f59a83fa..3e79cb465 100644
--- a/lib/puppet/type/cisco_interface.rb
+++ b/lib/puppet/type/cisco_interface.rb
@@ -225,6 +225,16 @@ def self.title_patterns
}
end # property ipv4_netmask_length
+ newproperty(:vrf) do
+ desc " VRF member of the interface. Valid values
+ are string, keyword 'default'."
+
+ munge { |value|
+ value = :default if value == 'default'
+ value
+ }
+ end # property vrf
+
# validate ipv4 address and mask combination
validate do
if self[:ipv4_address] != :default and
diff --git a/lib/puppet/type/cisco_interface_ospf.rb b/lib/puppet/type/cisco_interface_ospf.rb
index a58fddc7b..9adeaa399 100644
--- a/lib/puppet/type/cisco_interface_ospf.rb
+++ b/lib/puppet/type/cisco_interface_ospf.rb
@@ -229,7 +229,7 @@ def name
munge { |value|
# Coerce numeric area to the expected dot-decimal format.
- value = IPAddr.new(value, Socket::AF_INET) unless value.to_s[/\./]
+ value = IPAddr.new(value.to_i, Socket::AF_INET) unless value.to_s[/\./]
value.to_s
}
diff --git a/manifests/install.pp b/manifests/install.pp
index 8ee927a03..41dbffe3e 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -24,26 +24,10 @@
$opts = { '--http-proxy' => $proxy }
}
- package { 'net_http_unix' :
- ensure => present,
- provider => 'gem',
- source => $repo,
- install_options => $opts,
- }
-
- package { 'cisco_nxapi' :
- ensure => present,
- provider => 'gem',
- source => $repo,
- install_options => $opts,
- require => Package['net_http_unix'],
- }
-
package { 'cisco_node_utils' :
ensure => present,
provider => 'gem',
source => $repo,
install_options => $opts,
- require => Package['cisco_nxapi'],
}
}
diff --git a/metadata.json b/metadata.json
index 89270d616..95f0bafdc 100644
--- a/metadata.json
+++ b/metadata.json
@@ -1,13 +1,13 @@
{
"name": "puppetlabs-ciscopuppet",
- "version": "0.9.1",
+ "version": "1.0.0",
"author": "cisco",
"summary": "Cisco Puppet providers and types for NX-OS devices",
"license": "Apache-2.0",
- "source": "https://github.com/puppetlabs/cisco-ciscopuppet",
+ "source": "https://github.com/cisco/cisco-network-puppet-module",
"tags": ["cisco","nxos","nx-os","network"],
- "project_page": "https://github.com/puppetlabs/cisco-ciscopuppet",
- "issues_url": "https://github.com/puppetlabs/cisco-ciscopuppet/issues",
+ "project_page": "https://github.com/cisco/cisco-network-puppet-module",
+ "issues_url": "https://github.com/cisco/cisco-network-puppet-module/issues",
"operatingsystem_support": [
{
"operatingsystem":"NX-OS",
diff --git a/tests/beaker_tests/fileservicepkg/filesvcpkglib.rb b/tests/beaker_tests/fileservicepkg/filesvcpkglib.rb
index 67fe4bb1d..8d75357ca 100644
--- a/tests/beaker_tests/fileservicepkg/filesvcpkglib.rb
+++ b/tests/beaker_tests/fileservicepkg/filesvcpkglib.rb
@@ -151,8 +151,9 @@ def FileSvcPkgLib.create_package_sample_manifest_present()
package { 'n9000_sample.x86_64':
name => 'n9000_sample-1.0.0-7.0.3.x86_64.rpm',
ensure => present,
- provider => 'yum',
+ provider => 'nxapi',
source => '/bootflash/n9000_sample-1.0.0-7.0.3.x86_64.rpm',
+ package_settings => {'target' => 'host'},
}
}
EOF"
@@ -169,8 +170,9 @@ def FileSvcPkgLib.create_package_sample_manifest_absent()
package { 'n9000_sample.x86_64':
name => 'n9000_sample-1.0.0-7.0.3.x86_64.rpm',
ensure => absent,
- provider => 'yum',
- source => '/bootflash/puppet-rpm/n9000_sample-1.0.0-7.0.3.x86_64.rpm',
+ provider => 'nxapi',
+ source => '/bootflash/n9000_sample-1.0.0-7.0.3.x86_64.rpm',
+ package_settings => {'target' => 'host'},
}
}
EOF"
diff --git a/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-1.rb b/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-1.rb
index 86a538367..dc53a55a3 100644
--- a/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-1.rb
+++ b/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-1.rb
@@ -70,11 +70,11 @@
# Expected exit_code is 0 since this is a bash shell cmd.
on(master, FileSvcPkgLib.create_package_curl_manifest_latest())
- # Expected exit_code is 2 since this is a puppet agent cmd with change.
- # Or expected exit_code is 0 since this is a puppet agent cmd with no change.
+ # Expected exit_code is 0 since this is a puppet agent cmd with no change.
+ # No change would imply that curl package is installed prior to test.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
"agent -t", options)
- on(agent, cmd_str, {:acceptable_exit_codes => [0, 2]})
+ on(agent, cmd_str, {:acceptable_exit_codes => [0]})
logger.info("Setup switch for provider test :: #{result}")
end
@@ -95,13 +95,14 @@
# @step [Step] Checks package resource on agent using resource cmd.
step "TestStep :: Check package resource presence on agent" do
# Expected exit_code is 0 since this is a puppet resource cmd.
- # Flag is set to false to check for presence of RegExp pattern in stdout.
+ # Flag is set to true to check for absence of RegExp pattern in stdout.
+ # The Curl package state should not be purged.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
"resource package 'curl'", options)
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout,
- {'ensure' => 'present'},
- false, self, logger)
+ {'ensure' => 'purged'},
+ true, self, logger)
end
logger.info("Check package resource presence on agent :: #{result}")
diff --git a/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-2.rb b/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-2.rb
index a854e98e1..ed79d29a8 100644
--- a/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-2.rb
+++ b/tests/beaker_tests/fileservicepkg/package-provider-nondefaults-2.rb
@@ -76,9 +76,12 @@
on(master, FileSvcPkgLib.create_package_sample_manifest_absent())
# Expected exit_code is 0 since this is a puppet agent cmd with no change.
+ # No change would imply that Sample package is uninstalled prior to test.
+ # Or expected exit_code is 2 since this is a puppet agent cmd with change.
+ # Change would imply that Sample package is installed prior to test.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
"agent -t", options)
- on(agent, cmd_str, {:acceptable_exit_codes => [0]})
+ on(agent, cmd_str, {:acceptable_exit_codes => [0, 2]})
logger.info("Setup switch for provider test :: #{result}")
end
@@ -88,10 +91,12 @@
# Expected exit_code is 0 since this is a bash shell cmd.
on(master, FileSvcPkgLib.create_package_sample_manifest_present())
- # Expected exit_code is 0 since this is a puppet agent cmd with no change.
+ # Expected exit_code is 2 since this is a puppet agent cmd with change.
+ # Change would imply that Sample package is uninstalled prior to test and
+ # installed after test.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
"agent -t", options)
- on(agent, cmd_str, {:acceptable_exit_codes => [0]})
+ on(agent, cmd_str, {:acceptable_exit_codes => [2]})
logger.info("Get resource present manifest from master :: #{result}")
end
@@ -99,13 +104,14 @@
# @step [Step] Checks package resource on agent using resource cmd.
step "TestStep :: Check package resource presence on agent" do
# Expected exit_code is 0 since this is a puppet resource cmd.
- # Flag is set to false to check for presence of RegExp pattern in stdout.
+ # Flag is set to true to check for absence of RegExp pattern in stdout.
+ # Sample package state should not be purged.
cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
- "resource package 'n9000_sample.x86_64'", options)
+ "resource package 'n9000_sample'", options)
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout,
- {'ensure' => 'present'},
- false, self, logger)
+ {'ensure' => 'purged'},
+ true, self, logger)
end
logger.info("Check package resource presence on agent :: #{result}")
diff --git a/tests/beaker_tests/loopbackintf/loopbackintf-provider-negatives.rb b/tests/beaker_tests/loopbackintf/loopbackintf-provider-negatives.rb
index e7ef1e913..630431e07 100644
--- a/tests/beaker_tests/loopbackintf/loopbackintf-provider-negatives.rb
+++ b/tests/beaker_tests/loopbackintf/loopbackintf-provider-negatives.rb
@@ -295,6 +295,48 @@
logger.info("Check interface instance absence on agent :: #{result}")
end
+ # @step [Step] Requests manifest from the master server to the agent.
+ step "TestStep :: Get negative test resource manifest from master" do
+ # Expected exit_code is 0 since this is a bash shell cmd.
+ on(master, LoopbackIntfLib.create_loopbackintf_manifest_vrf_negative())
+
+ # Expected exit_code is 1 since this is a puppet agent cmd with error.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "agent -t", options)
+ on(agent, cmd_str, {:acceptable_exit_codes => [1]})
+
+ logger.info("Get negative test resource manifest from master :: #{result}")
+ end
+
+ # @step [Step] Checks cisco_interface resource on agent using resource cmd.
+ step "TestStep :: Check cisco_interface resource absence on agent" do
+ # Expected exit_code is 0 since this is a puppet resource cmd.
+ # Flag is set to true to check for absence of RegExp pattern in stdout.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "resource cisco_interface 'loopback1'", options)
+ on(agent, cmd_str) do
+ UtilityLib.search_pattern_in_output(stdout,
+ {"vrf" => LoopbackIntfLib::VRF_NEGATIVE},
+ true, self, logger)
+ end
+
+ logger.info("Check cisco_interface resource absence on agent :: #{result}")
+ end
+
+ # @step [Step] Checks interface instance on agent using switch show cli cmds.
+ step "TestStep :: Check interface instance absence on agent" do
+ # Expected exit_code is 16 since this is a vegas shell cmd.
+ # Flag is set to true to check for absence of RegExp pattern in stdout.
+ cmd_str = UtilityLib.get_vshell_cmd("show running-config interface loopback1")
+ on(agent, cmd_str, {:acceptable_exit_codes => [16]}) do
+ UtilityLib.search_pattern_in_output(stdout,
+ [/vrf member/],
+ true, self, logger)
+ end
+
+ logger.info("Check interface instance absence on agent :: #{result}")
+ end
+
# @raise [PassTest/FailTest] Raises PassTest/FailTest exception using result.
UtilityLib.raise_passfail_exception(result, testheader, self, logger)
diff --git a/tests/beaker_tests/loopbackintf/loopbackintf-provider-nondefaults.rb b/tests/beaker_tests/loopbackintf/loopbackintf-provider-nondefaults.rb
index fd1507c35..aab36a346 100644
--- a/tests/beaker_tests/loopbackintf/loopbackintf-provider-nondefaults.rb
+++ b/tests/beaker_tests/loopbackintf/loopbackintf-provider-nondefaults.rb
@@ -116,7 +116,8 @@
'shutdown' => 'true',
'switchport_autostate_exclude' => 'false',
'switchport_mode' => 'disabled',
- 'switchport_vtp' => 'false'},
+ 'switchport_vtp' => 'false',
+ 'vrf' => 'test1'},
false, self, logger)
end
@@ -130,7 +131,8 @@
cmd_str = UtilityLib.get_vshell_cmd("show running-config interface loopback1")
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout, [/ip address 192.168.1.1\/16/,
- /shutdown/],
+ /shutdown/,
+ /vrf member test1/],
false, self, logger)
end
@@ -166,7 +168,8 @@
'shutdown' => 'true',
'switchport_autostate_exclude' => 'false',
'switchport_mode' => 'disabled',
- 'switchport_vtp' => 'false'},
+ 'switchport_vtp' => 'false',
+ 'vrf' => 'test1'},
true, self, logger)
end
@@ -180,7 +183,8 @@
cmd_str = UtilityLib.get_vshell_cmd("show running-config interface loopback1")
on(agent, cmd_str, {:acceptable_exit_codes => [16]}) do
UtilityLib.search_pattern_in_output(stdout, [/ip address 192.168.1.1\/16/,
- /shutdown/],
+ /shutdown/,
+ /vrf member test1/],
true, self, logger)
end
diff --git a/tests/beaker_tests/loopbackintf/loopbackintflib.rb b/tests/beaker_tests/loopbackintf/loopbackintflib.rb
index 75b7b7f97..7b60bbb9f 100644
--- a/tests/beaker_tests/loopbackintf/loopbackintflib.rb
+++ b/tests/beaker_tests/loopbackintf/loopbackintflib.rb
@@ -41,6 +41,7 @@ module LoopbackIntfLib
SHUTDOWN_NEGATIVE = 'invalid'
IPV4PROXYARP_NEGATIVE = 'invalid'
IPV4REDIR_NEGATIVE = 'invalid'
+ VRF_NEGATIVE = '~'
# A. Methods to create manifests for cisco_interface Puppet provider test cases.
@@ -57,6 +58,7 @@ def LoopbackIntfLib.create_loopbackintf_manifest_present()
shutdown => false,
ipv4_address => '192.168.1.1',
ipv4_netmask_length => 16,
+ vrf => 'default',
}
}
EOF"
@@ -92,6 +94,7 @@ def LoopbackIntfLib.create_loopbackintf_manifest_nondefaults()
shutdown => true,
ipv4_address => '192.168.1.1',
ipv4_netmask_length => 16,
+ vrf => 'test1',
}
}
EOF"
@@ -179,4 +182,19 @@ def LoopbackIntfLib.create_loopbackintf_manifest_ipv4redir_negative()
return manifest_str
end
+ # Method to create a manifest for LoopbackINTF resource attribute 'vrf'.
+ # @param none [None] No input parameters exist.
+ # @result none [None] Returns no object.
+ def LoopbackIntfLib.create_loopbackintf_manifest_vrf_negative()
+ manifest_str = "cat <#{UtilityLib::PUPPETMASTER_MANIFESTPATH}
+node default {
+ cisco_interface { 'loopback1':
+ ensure => present,
+ shutdown => false,
+ vrf => #{LoopbackIntfLib::VRF_NEGATIVE},
+ }
+}
+EOF"
+ return manifest_str
+ end
end
diff --git a/tests/beaker_tests/ospfintf/ospfintf-provider-negatives.rb b/tests/beaker_tests/ospfintf/ospfintf-provider-negatives.rb
index 992689422..be07a649c 100644
--- a/tests/beaker_tests/ospfintf/ospfintf-provider-negatives.rb
+++ b/tests/beaker_tests/ospfintf/ospfintf-provider-negatives.rb
@@ -107,10 +107,6 @@
{"cost" => OspfIntfLib::COST_NEGATIVE},
true, self, logger)
end
- # cleanup partially configured resource
- cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
- "resource cisco_interface_ospf 'ethernet1/4 test' ensure=absent", options)
- on(agent, cmd_str)
logger.info("Check cisco_intf_ospf resource absence on agent :: #{result}")
end
@@ -122,13 +118,15 @@
cmd_str = UtilityLib.get_vshell_cmd("show running-config ospf")
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout,
- [/interface Ethernet1\/4/,
- /ip ospf cost 1/,
- /ip ospf dead-interval 40/,
- /ip router ospf test area 0.0.0.1/],
+ [/ip ospf cost #{OspfIntfLib::COST_NEGATIVE}/],
true, self, logger)
end
+ # Cleanup partially configured resource.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "resource cisco_interface_ospf 'ethernet1/4 test' ensure=absent", options)
+ on(agent, cmd_str)
+
logger.info("Check ospfintf instance absence on agent :: #{result}")
end
@@ -167,13 +165,15 @@
cmd_str = UtilityLib.get_vshell_cmd("show running-config ospf")
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout,
- [/interface Ethernet1\/4/,
- /ip ospf cost 1/,
- /ip ospf dead-interval 40/,
- /ip router ospf test area 0.0.0.1/],
+ [/ip ospf hello-interval #{OspfIntfLib::HELLOINTERVAL_NEGATIVE}/],
true, self, logger)
end
+ # Cleanup partially configured resource.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "resource cisco_interface_ospf 'ethernet1/4 test' ensure=absent", options)
+ on(agent, cmd_str)
+
logger.info("Check ospfintf instance absence on agent :: #{result}")
end
@@ -212,13 +212,15 @@
cmd_str = UtilityLib.get_vshell_cmd("show running-config ospf")
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout,
- [/interface Ethernet1\/4/,
- /ip ospf cost 1/,
- /ip ospf dead-interval 40/,
- /ip router ospf test area 0.0.0.1/],
+ [/ip ospf dead-interval #{OspfIntfLib::DEADINTERVAL_NEGATIVE}/],
true, self, logger)
end
+ # Cleanup partially configured resource.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "resource cisco_interface_ospf 'ethernet1/4 test' ensure=absent", options)
+ on(agent, cmd_str)
+
logger.info("Check ospfintf instance absence on agent :: #{result}")
end
@@ -257,13 +259,15 @@
cmd_str = UtilityLib.get_vshell_cmd("show running-config ospf")
on(agent, cmd_str) do
UtilityLib.search_pattern_in_output(stdout,
- [/interface Ethernet1\/4/,
- /ip ospf cost 1/,
- /ip ospf dead-interval 40/,
- /ip router ospf test area 0.0.0.1/],
+ [/ip ospf passive-interface #{OspfIntfLib::PASSIVEINTF_NEGATIVE}/],
true, self, logger)
end
+ # Cleanup partially configured resource.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "resource cisco_interface_ospf 'ethernet1/4 test' ensure=absent", options)
+ on(agent, cmd_str)
+
logger.info("Check ospfintf instance absence on agent :: #{result}")
end
diff --git a/tests/beaker_tests/ospfintf/ospfintflib.rb b/tests/beaker_tests/ospfintf/ospfintflib.rb
index f79f446ff..873ffc7eb 100644
--- a/tests/beaker_tests/ospfintf/ospfintflib.rb
+++ b/tests/beaker_tests/ospfintf/ospfintflib.rb
@@ -182,6 +182,7 @@ def OspfIntfLib.create_ospfintf_manifest_hellointerval_negative()
cisco_interface_ospf { 'ethernet1/4 test':
ensure => present,
+ area => '1',
hello_interval => #{OspfIntfLib::HELLOINTERVAL_NEGATIVE},
}
}
@@ -205,6 +206,7 @@ def OspfIntfLib.create_ospfintf_manifest_deadinterval_negative()
cisco_interface_ospf { 'ethernet1/4 test':
ensure => present,
+ area => '1',
dead_interval => #{OspfIntfLib::DEADINTERVAL_NEGATIVE},
}
}
@@ -228,6 +230,7 @@ def OspfIntfLib.create_ospfintf_manifest_passiveintf_negative()
cisco_interface_ospf { 'ethernet1/4 test':
ensure => present,
+ area => '1',
passive_interface => #{OspfIntfLib::PASSIVEINTF_NEGATIVE},
}
}
diff --git a/tests/beaker_tests/routedintf/routedintf-provider-negatives.rb b/tests/beaker_tests/routedintf/routedintf-provider-negatives.rb
index 253bc9459..a399a4c6b 100644
--- a/tests/beaker_tests/routedintf/routedintf-provider-negatives.rb
+++ b/tests/beaker_tests/routedintf/routedintf-provider-negatives.rb
@@ -298,6 +298,48 @@
logger.info("Check interface instance absence on agent :: #{result}")
end
+ # @step [Step] Requests manifest from the master server to the agent.
+ step "TestStep :: Get negative test resource manifest from master" do
+ # Expected exit_code is 0 since this is a bash shell cmd.
+ on(master, RoutedIntfLib.create_routedintf_manifest_vrf_negative())
+
+ # Expected exit_code is 1 since this is a puppet agent cmd with error.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "agent -t", options)
+ on(agent, cmd_str, {:acceptable_exit_codes => [1]})
+
+ logger.info("Get negative test resource manifest from master :: #{result}")
+ end
+
+ # @step [Step] Checks cisco_interface resource on agent using resource cmd.
+ step "TestStep :: Check cisco_interface resource absence on agent" do
+ # Expected exit_code is 0 since this is a puppet resource cmd.
+ # Flag is set to true to check for absence of RegExp pattern in stdout.
+ cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +
+ "resource cisco_interface 'ethernet1/4'", options)
+ on(agent, cmd_str) do
+ UtilityLib.search_pattern_in_output(stdout,
+ {"vrf" => RoutedIntfLib::VRF_NEGATIVE},
+ true, self, logger)
+ end
+
+ logger.info("Check cisco_interface resource absence on agent :: #{result}")
+ end
+
+ # @step [Step] Checks interface instance on agent using switch show cli cmds.
+ step "TestStep :: Check interface instance absence on agent" do
+ # Expected exit_code is 0 since this is a vegas shell cmd.
+ # Flag is set to true to check for absence of RegExp pattern in stdout.
+ cmd_str = UtilityLib.get_vshell_cmd("show running-config interface eth1/4")
+ on(agent, cmd_str) do
+ UtilityLib.search_pattern_in_output(stdout,
+ [/vrf member/],
+ true, self, logger)
+ end
+
+ logger.info("Check interface instance absence on agent :: #{result}")
+ end
+
# @raise [PassTest/FailTest] Raises PassTest/FailTest exception using result.
UtilityLib.raise_passfail_exception(result, testheader, self, logger)
diff --git a/tests/beaker_tests/routedintf/routedintf-provider-nondefaults.rb b/tests/beaker_tests/routedintf/routedintf-provider-nondefaults.rb
index 0ce0ca513..29fca4d55 100644
--- a/tests/beaker_tests/routedintf/routedintf-provider-nondefaults.rb
+++ b/tests/beaker_tests/routedintf/routedintf-provider-nondefaults.rb
@@ -119,7 +119,8 @@
'shutdown' => 'true',
'switchport_autostate_exclude' => 'false',
'switchport_mode' => 'disabled',
- 'switchport_vtp' => 'false'},
+ 'switchport_vtp' => 'false',
+ 'vrf' => 'test1'},
false, self, logger)
end
@@ -135,7 +136,8 @@
UtilityLib.search_pattern_in_output(stdout, [/ip address 192.168.1.1\/16/,
/no switchport/,
/no ip redirects/,
- /ip proxy-arp/],
+ /ip proxy-arp/,
+ /vrf member test1/],
false, self, logger)
end
diff --git a/tests/beaker_tests/routedintf/routedintflib.rb b/tests/beaker_tests/routedintf/routedintflib.rb
index 45605b7a1..6eda475c8 100644
--- a/tests/beaker_tests/routedintf/routedintflib.rb
+++ b/tests/beaker_tests/routedintf/routedintflib.rb
@@ -41,6 +41,7 @@ module RoutedIntfLib
IPV4PROXYARP_NEGATIVE = 'invalid'
IPV4REDIR_NEGATIVE = 'invalid'
SHUTDOWN_NEGATIVE = 'invalid'
+ VRF_NEGATIVE = '~'
# A. Methods to create manifests for cisco_interface Puppet provider test cases.
@@ -62,6 +63,7 @@ def RoutedIntfLib.create_routedintf_manifest_switchport_disabled()
ipv4_redirects => 'default',
switchport_autostate_exclude => 'default',
switchport_vtp => 'default',
+ vrf => 'default',
}
}
EOF"
@@ -105,6 +107,7 @@ def RoutedIntfLib.create_routedintf_manifest_nondefaults()
ipv4_redirects => false,
switchport_autostate_exclude => false,
switchport_vtp => false,
+ vrf => 'test1',
}
}
EOF"
@@ -198,4 +201,20 @@ def RoutedIntfLib.create_routedintf_manifest_ipv4redir_negative()
return manifest_str
end
+ # Method to create a manifest for RoutedINTF resource attribute 'vrf'.
+ # @param none [None] No input parameters exist.
+ # @result none [None] Returns no object.
+ def RoutedIntfLib.create_routedintf_manifest_vrf_negative()
+ manifest_str = "cat <#{UtilityLib::PUPPETMASTER_MANIFESTPATH}
+node default {
+ cisco_interface { 'ethernet1/4':
+ ensure => present,
+ shutdown => false,
+ switchport_mode => disabled,
+ vrf => #{RoutedIntfLib::VRF_NEGATIVE},
+ }
+}
+EOF"
+ return manifest_str
+ end
end