├── .rubocop_todo.yml ├── data └── common.yaml ├── .puppet-lint.rc ├── .yardopts ├── .rspec ├── CODEOWNERS ├── examples ├── banner.pp ├── ios_aaa_new_model.pp ├── snmp_notification.pp ├── syslog_server.pp ├── ios_aaa_session_id.pp ├── ios_access_list.pp ├── network_vlan.pp ├── snmp_community.pp ├── tacacs_server_group.pp ├── network_snmp.pp ├── radius_server_group.pp ├── network_dns.pp ├── ntp_auth_key.pp ├── ntp_config.pp ├── network_interface.pp ├── network_trunk.pp ├── snmp_notification_receiver.pp ├── tacacs.pp ├── radius_global.pp ├── syslog_settings.pp ├── ntp_server.pp ├── ios_aaa_accounting.pp ├── ios_aaa_authorization.pp ├── radius_server.pp ├── tacacs_server.pp ├── ios_aaa_authentication.pp ├── snmp_user.pp ├── port_channel.pp ├── ios_acl_entry.pp ├── ios_stp_global.pp └── ios_config.pp ├── .gitattributes ├── .vscode └── extensions.json ├── spec ├── acceptance │ ├── nodesets │ │ ├── vmpooler.yml │ │ └── default.yml │ ├── network_interface_spec.rb │ ├── snmp_notification_spec.rb │ ├── ios_aaa_session_id_spec.rb │ ├── radius_global_spec.rb │ ├── ios_ip_spec.rb │ ├── network_snmp_spec.rb │ ├── banner_spec.rb │ ├── radius_server_group_spec.rb │ ├── syslog_server_spec.rb │ ├── ios_access_list_spec.rb │ ├── ios_aaa_authorization_spec.rb │ ├── network_dns_spec.rb │ ├── ios_additional_syslog_settings_spec.rb │ ├── ios_ntp_config_spec.rb │ ├── ios_radius_server_group_spec.rb │ ├── ios_config_spec.rb │ ├── port_channel_spec.rb │ └── ios_network_dns_spec.rb ├── unit │ └── puppet │ │ ├── type │ │ ├── banner_spec.rb │ │ ├── ios_ip_spec.rb │ │ ├── ios_acl_spec.rb │ │ ├── ios_cef_spec.rb │ │ ├── ios_config_spec.rb │ │ ├── ios_interface.rb │ │ ├── ios_acl_entry_spec.rb │ │ ├── ios_access_list_spec.rb │ │ ├── ios_network_dns_spec.rb │ │ ├── ios_ntp_config_spec.rb │ │ ├── ios_snmp_global_spec.rb │ │ ├── ios_stp_global_spec.rb │ │ ├── ios_aaa_accounting_spec.rb │ │ ├── ios_aaa_new_model_spec.rb │ │ ├── ios_aaa_session_id_spec.rb │ │ ├── ios_network_trunk_spec.rb │ │ ├── ios_ntp_access_group_spec.rb │ │ ├── ios_aaa_authorization_spec.rb │ │ ├── ios_radius_server_group.rb │ │ ├── ios_aaa_authentication_spec.rb │ │ └── ios_additional_syslog_settings.rb │ │ ├── provider │ │ ├── ios_ip │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ios_acl │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_cef │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ios_acl_entry │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_access_list │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_aaa_new_model │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── banner │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ios_aaa_accounting │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_aaa_session_id │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ios_aaa_authorization │ │ │ └── cisco_ios_spec.rb │ │ ├── ntp_auth_key │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ntp_server │ │ │ └── cisco_ios_spec.rb │ │ ├── network_snmp │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── radius_global │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── radius_server │ │ │ └── cisco_ios_spec.rb │ │ ├── snmp_community │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ios_ntp_access_group │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── snmp_notification │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── snmp_notification_receiver │ │ │ └── cisco_ios_spec.rb │ │ ├── network_interface │ │ │ └── cisco_ios_spec.rb │ │ ├── network_dns │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ntp_config │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_network_dns │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ios_aaa_authentication │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_ntp_config │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── radius_server_group │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── syslog_server │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_additional_syslog_settings │ │ │ ├── test_data.yaml │ │ │ └── cisco_ios_spec.rb │ │ ├── network_trunk │ │ │ └── cisco_ios_spec.rb │ │ ├── ios_radius_global │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── ios_snmp_global │ │ │ └── cisco_ios_spec.rb │ │ ├── port_channel │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── snmp_user │ │ │ └── cisco_ios_spec.rb │ │ ├── tacacs_global │ │ │ ├── test_data.yaml │ │ │ └── cisco_ios_spec.rb │ │ ├── vrf │ │ │ ├── cisco_ios_spec.rb │ │ │ └── test_data.yaml │ │ ├── tacacs_server_group │ │ │ └── cisco_ios_spec.rb │ │ ├── network_vlan │ │ │ └── cisco_ios_spec.rb │ │ └── ios_stp_global │ │ │ └── cisco_ios_spec.rb │ │ └── transport │ │ └── cisco_ios_spec.rb ├── fixtures │ └── inventory.example.yml ├── classes │ ├── proxy_spec.rb │ └── server_spec.rb ├── default_facts.yml └── spec_helper.rb ├── codecov.yml ├── .gitpod.yml ├── manifests ├── init.pp ├── install │ ├── server.pp │ └── agent.pp ├── server.pp ├── install.pp └── proxy.pp ├── lib ├── puppet │ ├── provider │ │ ├── ios_network_dns │ │ │ └── command.yaml │ │ ├── ios_radius_server_group │ │ │ └── command.yaml │ │ ├── ios_radius_global │ │ │ └── command.yaml │ │ ├── ios_aaa_new_model │ │ │ └── command.yaml │ │ ├── ios_aaa_session_id │ │ │ ├── command.yaml │ │ │ └── cisco_ios.rb │ │ ├── ios_access_list │ │ │ └── command.yaml │ │ ├── snmp_notification │ │ │ └── command.yaml │ │ ├── ios_ip │ │ │ └── command.yaml │ │ ├── radius_server_group │ │ │ └── command.yaml │ │ ├── snmp_community │ │ │ └── command.yaml │ │ ├── ios_ntp_config │ │ │ └── command.yaml │ │ ├── network_dns │ │ │ └── command.yaml │ │ ├── ios_additional_syslog_settings │ │ │ └── command.yaml │ │ ├── ntp_config │ │ │ └── command.yaml │ │ ├── banner │ │ │ └── command.yaml │ │ ├── ntp_auth_key │ │ │ └── command.yaml │ │ ├── syslog_server │ │ │ └── command.yaml │ │ ├── network_snmp │ │ │ └── command.yaml │ │ ├── ios_ntp_access_group │ │ │ └── command.yaml │ │ ├── network_vlan │ │ │ └── command.yaml │ │ ├── ios_acl_entry │ │ │ └── command.yaml │ │ ├── tacacs_server_group │ │ │ └── command.yaml │ │ ├── radius_global │ │ │ └── command.yaml │ │ ├── vrf │ │ │ └── command.yaml │ │ ├── tacacs_global │ │ │ └── command.yaml │ │ ├── ios_cef │ │ │ └── command.yaml │ │ ├── ios_aaa_authorization │ │ │ └── command.yaml │ │ ├── ios_network_trunk │ │ │ └── command.yaml │ │ ├── ios_acl │ │ │ └── command.yaml │ │ ├── snmp_notification_receiver │ │ │ └── command.yaml │ │ ├── ios_aaa_authentication │ │ │ └── command.yaml │ │ ├── network_trunk │ │ │ └── command.yaml │ │ ├── ios_aaa_accounting │ │ │ └── command.yaml │ │ ├── ntp_server │ │ │ └── command.yaml │ │ ├── radius_server │ │ │ └── command.yaml │ │ ├── network_interface │ │ │ └── command.yaml │ │ ├── ios_snmp_global │ │ │ └── command.yaml │ │ ├── syslog_settings │ │ │ └── command.yaml │ │ ├── snmp_user │ │ │ └── command.yaml │ │ └── tacacs_server │ │ │ └── command.yaml │ ├── type │ │ ├── ios_aaa_new_model.rb │ │ ├── ios_ip.rb │ │ ├── ios_aaa_session_id.rb │ │ ├── ios_access_list.rb │ │ ├── ios_ntp_access_group.rb │ │ ├── ios_radius_server_group.rb │ │ ├── ios_cef.rb │ │ ├── ios_ntp_config.rb │ │ ├── ios_additional_syslog_settings.rb │ │ ├── ios_network_dns.rb │ │ ├── ios_config.rb │ │ ├── ios_aaa_authorization.rb │ │ └── ios_snmp_global.rb │ ├── util │ │ ├── task_helper.rb │ │ └── network_device │ │ │ └── cisco_ios │ │ │ └── device.rb │ └── transport │ │ └── command.yaml └── puppet_x │ └── puppetlabs │ └── cisco_ios │ └── check.rb ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .fixtures.yml ├── .pmtignore ├── docs ├── README.md ├── 03-update-bolt-inventory │ └── README.md └── 01-install-prerequisites │ └── README.md ├── .github └── workflows │ ├── labeller.yml │ └── stale.yml ├── .gitignore ├── tasks ├── config_save.json ├── restore_startup.json ├── config_save.rb ├── restore_config.json ├── backup_config.json ├── restore_startup.rb ├── cli_command.json ├── cli_command.rb ├── backup_config.rb └── restore_config.rb ├── hiera.yaml ├── .pdkignore ├── .gitpod.Dockerfile ├── metadata.json └── .travis.yml /.rubocop_todo.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/common.yaml: -------------------------------------------------------------------------------- 1 | --- {} 2 | -------------------------------------------------------------------------------- /.puppet-lint.rc: -------------------------------------------------------------------------------- 1 | --relative 2 | -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | --markup markdown 2 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --format documentation 3 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @puppetlabs/community-maintainers 2 | -------------------------------------------------------------------------------- /examples/banner.pp: -------------------------------------------------------------------------------- 1 | banner { 'default': 2 | motd => 'meoooow', 3 | } 4 | -------------------------------------------------------------------------------- /examples/ios_aaa_new_model.pp: -------------------------------------------------------------------------------- 1 | ios_aaa_new_model { 'default': 2 | enable => true, 3 | } -------------------------------------------------------------------------------- /examples/snmp_notification.pp: -------------------------------------------------------------------------------- 1 | snmp_notification { 'stpx': 2 | enable => true 3 | } 4 | -------------------------------------------------------------------------------- /examples/syslog_server.pp: -------------------------------------------------------------------------------- 1 | syslog_server { '1.2.3.4': 2 | ensure => 'present', 3 | } 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.rb eol=lf 2 | *.erb eol=lf 3 | *.pp eol=lf 4 | *.sh eol=lf 5 | *.epp eol=lf 6 | -------------------------------------------------------------------------------- /examples/ios_aaa_session_id.pp: -------------------------------------------------------------------------------- 1 | ios_aaa_session_id { 'default': 2 | session_id_type => 'unique', 3 | } -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "puppet.puppet-vscode", 4 | "rebornix.Ruby" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /examples/ios_access_list.pp: -------------------------------------------------------------------------------- 1 | ios_access_list { 'test43': 2 | ensure => 'present', 3 | access_list_type => 'Extended', 4 | } -------------------------------------------------------------------------------- /examples/network_vlan.pp: -------------------------------------------------------------------------------- 1 | network_vlan { '43': 2 | ensure => 'present', 3 | vlan_name => 'testvlan', 4 | shutdown => false, 5 | } 6 | -------------------------------------------------------------------------------- /examples/snmp_community.pp: -------------------------------------------------------------------------------- 1 | snmp_community { 'ACCEPTANCE': 2 | ensure => 'present', 3 | group => 'RW', 4 | acl => 'GREEN', 5 | } 6 | -------------------------------------------------------------------------------- /examples/tacacs_server_group.pp: -------------------------------------------------------------------------------- 1 | tacacs_server_group { 'test1': 2 | ensure => 'present', 3 | servers => ['1.2.3.5','1.2.3.6'], 4 | } 5 | -------------------------------------------------------------------------------- /examples/network_snmp.pp: -------------------------------------------------------------------------------- 1 | network_snmp { 'default': 2 | enable => true, 3 | contact => 'Mr Tayto', 4 | location => 'Tayto castle', 5 | } 6 | -------------------------------------------------------------------------------- /examples/radius_server_group.pp: -------------------------------------------------------------------------------- 1 | radius_server_group { 'bill': 2 | ensure => 'present', 3 | servers => ['1.2.3.4', '4.3.2.1'], 4 | } 5 | -------------------------------------------------------------------------------- /examples/network_dns.pp: -------------------------------------------------------------------------------- 1 | network_dns { 'default': 2 | ensure => 'present', 3 | servers => ['1.1.1.1', '1.1.1.3'], 4 | search => ['jim.com'], 5 | } 6 | -------------------------------------------------------------------------------- /spec/acceptance/nodesets/vmpooler.yml: -------------------------------------------------------------------------------- 1 | --- 2 | CONFIG: 3 | nfs_server: none 4 | consoleport: 443 5 | pooling_api: http://vmpooler.delivery.puppetlabs.net/ 6 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # disable comments, info can be gotten from the pr status updates, and the comment editing spams the hipchat notifications 3 | comment: false 4 | -------------------------------------------------------------------------------- /examples/ntp_auth_key.pp: -------------------------------------------------------------------------------- 1 | ntp_auth_key { '42': 2 | ensure => present, 3 | algorithm => 'md5', 4 | password => '135445415F59', 5 | mode => 7, 6 | } 7 | -------------------------------------------------------------------------------- /examples/ntp_config.pp: -------------------------------------------------------------------------------- 1 | ntp_config { 'default': 2 | authenticate => true, 3 | source_interface => 'Vlan42', 4 | trusted_key => [12,24,48,96], 5 | } 6 | -------------------------------------------------------------------------------- /examples/network_interface.pp: -------------------------------------------------------------------------------- 1 | network_interface { 'Vlan42': 2 | enable => true, 3 | description => 'This is a test interface.', 4 | mtu => 128, 5 | } 6 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/banner_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the banner type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:banner)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_ip_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_ip type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_ip)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_acl_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_acl type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_acl)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_cef_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_cef type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_cef)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_config type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_config)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /examples/network_trunk.pp: -------------------------------------------------------------------------------- 1 | network_trunk { 'Port-channel1': 2 | ensure => 'present', 3 | encapsulation => 'dot1q', 4 | mode => 'dynamic_desirable', 5 | untagged_vlan => 1, 6 | } 7 | -------------------------------------------------------------------------------- /examples/snmp_notification_receiver.pp: -------------------------------------------------------------------------------- 1 | snmp_notification_receiver { '9.9.9.9 public 1234': 2 | ensure => 'present', 3 | username => 'public', 4 | port => 1234, 5 | type => 'traps', 6 | } 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_interface.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_interface type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_interface)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: 2 | file: .gitpod.Dockerfile 3 | 4 | tasks: 5 | - init: pdk bundle install 6 | 7 | vscode: 8 | extensions: 9 | - puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA== 10 | -------------------------------------------------------------------------------- /manifests/init.pp: -------------------------------------------------------------------------------- 1 | # @summary This class calls the cisco_ios::install class. 2 | # 3 | # @example Declaring the class 4 | # include cisco_ios 5 | class cisco_ios { 6 | class { 'cisco_ios::install': } 7 | } 8 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_acl_entry_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_acl_entry type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_acl_entry)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /examples/tacacs.pp: -------------------------------------------------------------------------------- 1 | tacacs { 'default': 2 | ensure => 'present', 3 | key => 'testkey', 4 | key_format => 0, 5 | source_interface => 'Vlan32', 6 | timeout => 42, 7 | } 8 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_access_list_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_access_list type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_access_list)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_network_dns_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_network_dns type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_network_dns)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_ntp_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_ntp_config type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_ntp_config)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_snmp_global_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_snmp_global type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_snmp_global)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_stp_global_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_stp_global type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_stp_global)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /examples/radius_global.pp: -------------------------------------------------------------------------------- 1 | radius_global { 'default': 2 | key => 'bill', 3 | key_format => 4, 4 | retransmit_count => 60, 5 | source_interface => ['Vlan43'], 6 | timeout => 60, 7 | } 8 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_aaa_accounting_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_aaa_accounting type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_aaa_accounting)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_aaa_new_model_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_aaa_new_model type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_aaa_new_model)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_aaa_session_id_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_aaa_new_model type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_aaa_session_id)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_network_trunk_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_network_trunk type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_network_trunk)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_ntp_access_group_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_ntp_access_group type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_ntp_access_group)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /examples/syslog_settings.pp: -------------------------------------------------------------------------------- 1 | syslog_settings { 'default': 2 | enable => false, 3 | facility => 'local5', 4 | monitor => 6, 5 | console => 6, 6 | source_interface => ['Loopback24'], 7 | } 8 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_aaa_authorization_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_aaa_authorization type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_aaa_authorization)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_radius_server_group.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_radius_server_group type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_radius_server_group)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_aaa_authentication_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_aaa_authentication type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_aaa_authentication)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /examples/ntp_server.pp: -------------------------------------------------------------------------------- 1 | ntp_server { '1.2.3.4': 2 | ensure => 'present', 3 | key => 94, 4 | prefer => true, 5 | minpoll => 4, 6 | maxpoll => 14, 7 | source_interface => 'Vlan 42', 8 | } 9 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/ios_additional_syslog_settings.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | describe 'the ios_additional_syslog_settings type' do 3 | it 'loads' do 4 | expect(Puppet::Type.type(:ios_additional_syslog_settings)).not_to be_nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_network_dns/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | attributes: 3 | ip_domain_lookup: 4 | default: 5 | get_value: 'no ip domain-lookup' 6 | set_value: 'ip domain-lookup' 7 | unset_value: 'no ip domain-lookup' 8 | optional_match: false -------------------------------------------------------------------------------- /examples/ios_aaa_accounting.pp: -------------------------------------------------------------------------------- 1 | ios_aaa_accounting { 'network default': 2 | ensure => 'present', 3 | accounting_service => 'network', 4 | accounting_list => 'default', 5 | accounting_status => 'start-stop', 6 | server_groups => ['radius'], 7 | } -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM puppet/pdk:latest 2 | 3 | # [Optional] Uncomment this section to install additional packages. 4 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 5 | # && apt-get -y install --no-install-recommends 6 | 7 | -------------------------------------------------------------------------------- /spec/fixtures/inventory.example.yml: -------------------------------------------------------------------------------- 1 | nodes: 2 | - name: cisco.delivery.puppetlabs.net 3 | alias: sut 4 | config: 5 | transport: remote 6 | remote: 7 | remote-transport: cisco_ios 8 | user: admin 9 | password: ... 10 | enable_password: .. 11 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_radius_server_group/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | attributes: 3 | private_servers: 4 | default: 5 | get_value: '^ server-private (?\S*)' 6 | set_value: 'server-private ' 7 | unset_value: 'no server-private ' 8 | -------------------------------------------------------------------------------- /spec/classes/proxy_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'cisco_ios::proxy' do 4 | on_supported_os(proxy_os).each do |os, os_facts| 5 | context "on #{os}" do 6 | let(:facts) { os_facts } 7 | 8 | it { is_expected.to compile } 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /manifests/install/server.pp: -------------------------------------------------------------------------------- 1 | # @summary This class installs dependencies of this module into puppetserver, 2 | # and restarts the puppetserver service to activate. 3 | # 4 | # @example Declaring the class 5 | # include cisco_ios::install::server 6 | class cisco_ios::install::server { 7 | } 8 | -------------------------------------------------------------------------------- /.fixtures.yml: -------------------------------------------------------------------------------- 1 | # This file can be used to install module depdencies for unit testing 2 | # See https://github.com/puppetlabs/puppetlabs_spec_helper#using-fixtures for details 3 | --- 4 | fixtures: 5 | forge_modules: 6 | netdev_stdlib: "puppetlabs/netdev_stdlib" 7 | puppetserver_gem: "puppetlabs/puppetserver_gem" -------------------------------------------------------------------------------- /spec/default_facts.yml: -------------------------------------------------------------------------------- 1 | # Use default_module_facts.yml for module specific facts. 2 | # 3 | # Facts specified here will override the values provided by rspec-puppet-facts. 4 | --- 5 | ipaddress: "172.16.254.254" 6 | ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" 7 | is_pe: false 8 | macaddress: "AA:AA:AA:AA:AA:AA" 9 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_radius_global/command.yaml: -------------------------------------------------------------------------------- 1 | attributes: 2 | attributes: 3 | default: 4 | get_value: '.*(?:(?:radius-server attribute (?!list)(?\S*)) (?.*[^\s\\n]))' 5 | set_value: 'radius-server attribute ' 6 | optional_match: true -------------------------------------------------------------------------------- /examples/ios_aaa_authorization.pp: -------------------------------------------------------------------------------- 1 | ios_aaa_authorization { 'auth-proxy default': 2 | ensure => 'present', 3 | authorization_service => 'auth-proxy', 4 | authorization_list => 'default', 5 | server_groups => ['tacacs+'], 6 | local => false, 7 | if_authenticated => false, 8 | } -------------------------------------------------------------------------------- /examples/radius_server.pp: -------------------------------------------------------------------------------- 1 | radius_server { '2.2.2.2': 2 | ensure => 'present', 3 | hostname => '1.2.3.4', 4 | auth_port => 1642, 5 | acct_port => 1643, 6 | key => 'bill', 7 | key_format => 1, 8 | retransmit_count => 7, 9 | timeout => 42, 10 | } 11 | -------------------------------------------------------------------------------- /.pmtignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | pkg/ 3 | Gemfile.lock 4 | Gemfile.local 5 | vendor/ 6 | .vendor/ 7 | spec/fixtures/manifests/ 8 | spec/fixtures/modules/ 9 | .vagrant/ 10 | .bundle/ 11 | .ruby-version 12 | coverage/ 13 | log/ 14 | .idea/ 15 | .dependencies/ 16 | .librarian/ 17 | Puppetfile.lock 18 | *.iml 19 | .*.sw? 20 | .yardoc/ 21 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_aaa_new_model/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | begin aaa new-model' 4 | attributes: 5 | name: 6 | default: 7 | get_value: 'default' 8 | enable: 9 | default: 10 | get_value: '\naaa new-model' 11 | set_value: 'aaa new-model' 12 | -------------------------------------------------------------------------------- /manifests/server.pp: -------------------------------------------------------------------------------- 1 | # @summary This class installs dependencies of this module into puppetserver, 2 | # and restarts the puppetserver service to activate. 3 | # 4 | # @example Declaring the class 5 | # include cisco_ios::server 6 | # 7 | # @note Deprecated, use cisco_ios::install::server 8 | class cisco_ios::server { 9 | } 10 | -------------------------------------------------------------------------------- /examples/tacacs_server.pp: -------------------------------------------------------------------------------- 1 | tacacs_server { 'test_tacacs_1': 2 | ensure => 'present', 3 | port => '7001', 4 | key => '32324222424243', 5 | key_format => '7', 6 | timeout => '420', 7 | hostname => '2001:0000:4136:e378:8000:63bf:3fff:fdd2', 8 | single_connection => true, 9 | } 10 | -------------------------------------------------------------------------------- /spec/classes/server_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'cisco_ios::server' do 4 | let(:pre_condition) { "service { 'puppetserver': }" } 5 | 6 | on_supported_os(server_os).each do |os, os_facts| 7 | context "on #{os}" do 8 | let(:facts) { os_facts } 9 | 10 | it { is_expected.to compile } 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /examples/ios_aaa_authentication.pp: -------------------------------------------------------------------------------- 1 | ios_aaa_authentication { 'login default': 2 | ensure => 'present', 3 | authentication_list_set => 'login', 4 | authentication_list => 'default', 5 | server_groups => ['test1'], 6 | enable_password => false, 7 | local => true, 8 | switch_auth => false, 9 | } -------------------------------------------------------------------------------- /lib/puppet/provider/ios_aaa_session_id/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | begin aaa session-id' 4 | set_values: 5 | default: 'aaa session-id ' 6 | attributes: 7 | name: 8 | default: 9 | get_value: 'name' 10 | optional_match: true 11 | session_id_type: 12 | default: 13 | get_value: '\naaa session-id (.*)' 14 | -------------------------------------------------------------------------------- /examples/snmp_user.pp: -------------------------------------------------------------------------------- 1 | snmp_user { 'bill v3': 2 | ensure => 'present', 3 | version => 'v3', 4 | roles => ['public'], 5 | auth => 'md5', 6 | password => 'b7:d1:92:a4:4e:0d:a1:6c:d1:80:eb:e8:5e:fb:7c:8f', 7 | privacy => 'aes128', 8 | private_key => 'b7:d1:92:a4:4e:0d:a1:6c:d1:80:eb:e8:5e:fb:7c:8f', 9 | enforce_privacy => true, 10 | } 11 | -------------------------------------------------------------------------------- /manifests/install.pp: -------------------------------------------------------------------------------- 1 | # @summary This class installs dependencies of this module 2 | # into the puppet agent, and/or the puppetserver service. 3 | # 4 | # @example Declaring the class 5 | # include cisco_ios::install 6 | class cisco_ios::install { 7 | 8 | include cisco_ios::install::agent 9 | 10 | if $facts['puppetserver_installed'] { 11 | include cisco_ios::install::server 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/port_channel.pp: -------------------------------------------------------------------------------- 1 | port_channel { 'Port-channel42': 2 | ensure => 'present', 3 | description => 'This is a test port channel', 4 | speed => '10m', 5 | duplex => 'half', 6 | flowcontrol_receive => 'on', 7 | flowcontrol_send => 'on', 8 | mode => 'passive', 9 | interfaces => ['GigabitEthernet1/0/4', 'GigabitEthernet1/0/5'], 10 | } 11 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_access_list/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show ip access-lists' 4 | get_instances: 5 | default: '\S* IP access list (?:(?:.| |\n )*\n)' 6 | set_values: 7 | default: 'ip access-list ' 8 | attributes: 9 | name: 10 | default: 11 | get_value: '.*IP access list\s+(\S+)' 12 | access_list_type: 13 | default: 14 | get_value: '(\S*) IP access list.*' 15 | -------------------------------------------------------------------------------- /lib/puppet/provider/snmp_notification/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include snmp-server enable traps' 4 | get_instances: 5 | default: '^snmp-server enable traps.+\\n' 6 | set_values: 7 | default: ' snmp-server enable traps ' 8 | attributes: 9 | name: 10 | default: 11 | get_value: 'snmp-server enable traps (?\S*)' 12 | enable: 13 | default: 14 | get_value: '(?\S*)? snmp-server enable traps' 15 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_ip/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosIp; end 4 | require 'puppet/provider/ios_ip/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosIp::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_acl/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosAcl; end 4 | require 'puppet/provider/ios_acl/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosAcl::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_cef/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosCef; end 4 | require 'puppet/provider/ios_cef/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosCef::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /spec/acceptance/nodesets/default.yml: -------------------------------------------------------------------------------- 1 | HOSTS: 2 | servermachine: 3 | roles: 4 | - default 5 | - server 6 | - dashboard 7 | - database 8 | platform: ubuntu-14.04-amd64 9 | box : puppetlabs/ubuntu-14.04-64-nocm 10 | box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm 11 | hypervisor : vagrant 12 | CONFIG: 13 | type: foss 14 | log_level: debug 15 | color: false 16 | consoleport: 443 17 | pe_dir: http://neptune.puppetlabs.lan/2015.2/ci-ready/ 18 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_acl_entry/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosAclEntry; end 4 | require 'puppet/provider/ios_acl_entry/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosAclEntry::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_ip/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config' 4 | attributes: 5 | routing: 6 | default: 7 | get_value: 'ip routing' 8 | set_value: 'ip routing' 9 | unset_value: 'no ip routing' 10 | optional_match: true 11 | 4503: 12 | get_value: 'no ip routing' 13 | 4507: 14 | get_value: 'no ip routing' 15 | 4948: 16 | get_value: 'no ip routing' 17 | exclusions: 18 | - device: '2960' 19 | - device: '6503' 20 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_access_list/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosAccessList; end 4 | require 'puppet/provider/ios_access_list/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosAccessList::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_aaa_new_model/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosAaaNewModel; end 4 | require 'puppet/provider/ios_aaa_new_model/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosAaaNewModel::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Cisco IOS Hands-on-lab 2 | 3 | This is a lab which explains how to use this module with [Bolt](https://puppet.com/products/bolt). It is similar to the [lab](https://github.com/puppetlabs/puppetlabs-panos/tree/main/docs/01-using-with-bolt) for how to use the module with Palo Alto. 4 | 5 | This labs is intended for a new user and covers off only basic capabilities. Feedback and suggestions for improvement are welcome. 6 | 7 | # Get Started 8 | 9 | [Install prerequisites](./01-install-prerequisites/README.md) 10 | -------------------------------------------------------------------------------- /manifests/install/agent.pp: -------------------------------------------------------------------------------- 1 | # @summary This class install dependencies of this module into puppet agent 2 | # 3 | # @example Declaring the class 4 | # include cisco_ios::install::agent 5 | class cisco_ios::install::agent { 6 | 7 | package { 'net-ssh-telnet': 8 | ensure => present, 9 | provider => 'puppet_gem', 10 | } 11 | 12 | if versioncmp($facts['rubyversion'], '2.3.0') < 0 { 13 | package { 'backport_dig': 14 | ensure => present, 15 | provider => 'puppet_gem', 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/banner/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::Banner; end 4 | require 'puppet/provider/banner/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::Banner::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | it_behaves_like 'a noop canonicalizer' 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_aaa_accounting/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosAaaAccounting; end 4 | require 'puppet/provider/ios_aaa_accounting/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosAaaAccounting::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_aaa_session_id/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosAaaSessionId; end 4 | require 'puppet/provider/ios_aaa_session_id/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosAaaSessionId::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_aaa_authorization/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosAaaAuthorization; end 4 | require 'puppet/provider/ios_aaa_authorization/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosAaaAuthorization::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | end 14 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ntp_auth_key/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::NtpAuthKey; end 4 | require 'puppet/provider/ntp_auth_key/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::NtpAuthKey::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | it_behaves_like 'a noop canonicalizer' 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ntp_server/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::NtpServer; end 4 | require 'puppet/provider/ntp_server/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::NtpServer::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | 14 | it_behaves_like 'a noop canonicalizer' 15 | end 16 | -------------------------------------------------------------------------------- /.github/workflows/labeller.yml: -------------------------------------------------------------------------------- 1 | name: community-labeller 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | pull_request_target: 8 | types: 9 | - opened 10 | 11 | jobs: 12 | label: 13 | runs-on: ubuntu-latest 14 | steps: 15 | 16 | - uses: puppetlabs/community-labeller@v0 17 | name: Label issues or pull requests 18 | with: 19 | label_name: community 20 | label_color: '5319e7' 21 | org_membership: puppetlabs 22 | token: ${{ secrets.IAC_COMMUNITY_LABELER }} 23 | -------------------------------------------------------------------------------- /manifests/proxy.pp: -------------------------------------------------------------------------------- 1 | # @summary This class install dependencies of this module into puppet agent 2 | # 3 | # @example Declaring the class 4 | # include cisco_ios::proxy 5 | # 6 | # @note Deprecated, use cisco_ios::install::agent 7 | class cisco_ios::proxy { 8 | 9 | package { 'net-ssh-telnet': 10 | ensure => present, 11 | provider => 'puppet_gem', 12 | } 13 | 14 | if versioncmp($facts['rubyversion'], '2.3.0') < 0 { 15 | package { 'backport_dig': 16 | ensure => present, 17 | provider => 'puppet_gem', 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/network_snmp/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::NetworkSnmp; end 4 | require 'puppet/provider/network_snmp/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::NetworkSnmp::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | 13 | it_behaves_like 'commands created from instance' 14 | 15 | it_behaves_like 'a noop canonicalizer' 16 | end 17 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/radius_global/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::RadiusGlobal; end 4 | require 'puppet/provider/radius_global/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::RadiusGlobal::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | 14 | it_behaves_like 'a noop canonicalizer' 15 | end 16 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/radius_server/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::RadiusServer; end 4 | require 'puppet/provider/radius_server/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::RadiusServer::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | 14 | it_behaves_like 'a noop canonicalizer' 15 | end 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .git/ 2 | .*.sw[op] 3 | .metadata 4 | .yardoc 5 | .yardwarns 6 | *.iml 7 | /.bundle/ 8 | /.idea/ 9 | /.vagrant/ 10 | /coverage/ 11 | /bin/ 12 | /doc/ 13 | /Gemfile.local 14 | /Gemfile.lock 15 | /junit/ 16 | /log/ 17 | /pkg/ 18 | /spec/fixtures/manifests/ 19 | /spec/fixtures/modules/ 20 | /tmp/ 21 | /vendor/ 22 | /convert_report.txt 23 | /update_report.txt 24 | .DS_Store 25 | .project 26 | .envrc 27 | /inventory.yaml 28 | SSH_I_DUMPED 29 | /spec/fixtures/acceptance-credentials.conf 30 | /spec/fixtures/acceptance-device.conf 31 | /spec/fixtures/inventory.yml 32 | -------------------------------------------------------------------------------- /lib/puppet/type/ios_aaa_new_model.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource_api' 2 | 3 | Puppet::ResourceApi.register_type( 4 | name: 'ios_aaa_new_model', 5 | docs: 'Enable aaa new model on device', 6 | features: ['remote_resource'], 7 | attributes: { 8 | name: { 9 | type: 'String', 10 | desc: 'The name stays as "default"', 11 | behaviour: :namevar, 12 | default: 'default', 13 | }, 14 | enable: { 15 | type: 'Boolean', 16 | desc: 'Enable or disable aaa new model', 17 | }, 18 | }, 19 | ) 20 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/snmp_community/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::SnmpCommunity; end 4 | require 'puppet/provider/snmp_community/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::SnmpCommunity::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | 14 | it_behaves_like 'a noop canonicalizer' 15 | end 16 | -------------------------------------------------------------------------------- /lib/puppet/type/ios_ip.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource_api' 2 | 3 | Puppet::ResourceApi.register_type( 4 | name: 'ios_ip', 5 | docs: 'Manages settings related to the IP', 6 | features: ['remote_resource', 'canonicalize'], 7 | attributes: { 8 | name: { 9 | type: 'String', 10 | desc: 'Resource name, not used to manage the device', 11 | behaviour: :namevar, 12 | default: 'default', 13 | }, 14 | routing: { 15 | type: 'Optional[Boolean]', 16 | desc: 'Whether to Enable IP routing', 17 | }, 18 | }, 19 | ) 20 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_ntp_access_group/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosNtpAccessGroup; end 4 | require 'puppet/provider/ios_ntp_access_group/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosNtpAccessGroup::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | it_behaves_like 'a noop canonicalizer' 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/snmp_notification/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::SnmpNotification; end 4 | require 'puppet/provider/snmp_notification/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::SnmpNotification::CiscoIos do 7 | def self.load_test_data 8 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 9 | end 10 | 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | 14 | it_behaves_like 'a noop canonicalizer' 15 | end 16 | -------------------------------------------------------------------------------- /tasks/config_save.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Save running-config to startup-config", 3 | "remote": true, 4 | "input_method": "stdin", 5 | "supports_noop": false, 6 | "parameters": {}, 7 | "files": [ 8 | "cisco_ios/lib/puppet/util/task_helper.rb", 9 | "cisco_ios/lib/puppet/transport/cisco_ios.rb", 10 | "cisco_ios/lib/puppet/transport/command.yaml", 11 | "cisco_ios/lib/puppet/transport/schema/cisco_ios.rb", 12 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/utility.rb", 13 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/transport_shim.rb" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /lib/puppet/provider/radius_server_group/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | begin aaa' 4 | get_instances: 5 | default: 'aaa group server radius (?:(?:.| |\\n )*\\n)' 6 | set_values: 7 | default: ' aaa group server radius ' 8 | ensure_is_state: 9 | default: 'true' 10 | attributes: 11 | name: 12 | default: 13 | get_value: 'aaa group server radius (?\S*)' 14 | servers: 15 | default: 16 | get_value: '^ server (?\S*)' 17 | set_value: 'server ' 18 | unset_value: 'no server ' 19 | -------------------------------------------------------------------------------- /tasks/restore_startup.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Copys the startup-config to the running-config", 3 | "remote": true, 4 | "input_method": "stdin", 5 | "supports_noop": false, 6 | "parameters": {}, 7 | "files": [ 8 | "cisco_ios/lib/puppet/util/task_helper.rb", 9 | "cisco_ios/lib/puppet/transport/cisco_ios.rb", 10 | "cisco_ios/lib/puppet/transport/command.yaml", 11 | "cisco_ios/lib/puppet/transport/schema/cisco_ios.rb", 12 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/utility.rb", 13 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/transport_shim.rb" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /lib/puppet/type/ios_aaa_session_id.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource_api' 2 | 3 | Puppet::ResourceApi.register_type( 4 | name: 'ios_aaa_session_id', 5 | docs: 'Configure aaa session id on device', 6 | features: ['remote_resource'], 7 | attributes: { 8 | name: { 9 | type: 'String', 10 | desc: 'The name stays as "default"', 11 | behaviour: :namevar, 12 | default: 'default', 13 | }, 14 | session_id_type: { 15 | type: 'Enum["common","unique"]', 16 | desc: 'Type of aaa session id - common or unique', 17 | }, 18 | }, 19 | ) 20 | -------------------------------------------------------------------------------- /examples/ios_acl_entry.pp: -------------------------------------------------------------------------------- 1 | ios_acl_entry { 'test43_30': 2 | ensure => 'present', 3 | entry => 30, 4 | permission => 'deny', 5 | access_list => 'test43', 6 | protocol => 'tcp', 7 | source_address => '1.0.1.4', 8 | source_address_wildcard_mask => '4.3.2.1', 9 | destination_address => '0.2.4.2', 10 | destination_address_wildcard_mask => '1.1.1.1', 11 | match_all => ['+ack', '-fin'], 12 | log => true, 13 | } -------------------------------------------------------------------------------- /lib/puppet/provider/snmp_community/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include snmp-server community' 4 | get_instances: 5 | default: '^snmp-server community .*$' 6 | set_values: 7 | default: ' snmp-server community ' 8 | ensure_is_state: 9 | default: 'true' 10 | attributes: 11 | name: 12 | default: 13 | get_value: '^snmp-server community (?[^\s]+)' 14 | group: 15 | default: 16 | get_value: '^snmp-server community [^\s]+ (?[^\s]+)' 17 | acl: 18 | default: 19 | get_value: '^snmp-server community [^\s]+ [^\s]+ (?[^\s]+)$' 20 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/snmp_notification_receiver/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | include RSpec::Mocks::ExampleMethods 4 | 5 | module Puppet::Provider::SnmpNotificationReceiver; end 6 | require 'puppet/provider/snmp_notification_receiver/cisco_ios' 7 | 8 | describe Puppet::Provider::SnmpNotificationReceiver::CiscoIos do 9 | def self.load_test_data 10 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 11 | end 12 | 13 | it_behaves_like 'resources parsed from cli' 14 | it_behaves_like 'commands created from instance' 15 | 16 | it_behaves_like 'a noop canonicalizer' 17 | end 18 | -------------------------------------------------------------------------------- /lib/puppet_x/puppetlabs/cisco_ios/check.rb: -------------------------------------------------------------------------------- 1 | require 'puppet_x' 2 | module PuppetX::CiscoIOS 3 | # Helper function to check if we should load the resource_api 4 | class Check 5 | def self.use_old_netdev_type 6 | # check if Resource API is available 7 | begin 8 | require 'puppet/resource_api' 9 | rescue LoadError 10 | return true 11 | end 12 | # is this an agent running on a network device do no use RSAPI - there are only a few of them 13 | use_old_netdev = ['aristaeos', 'ios_xr', 'nexus'].include? Facter.value('operatingsystem').downcase 14 | use_old_netdev 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_ip/test_data.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | default: 3 | read_tests: 4 | "ip routing": 5 | cli: "show running-config\nip routing" 6 | expectations: 7 | - :name: 'default' 8 | :routing: true 9 | "no ip routing": 10 | cli: "show running-config\n" 11 | expectations: 12 | - :name: 'default' 13 | :routing: false 14 | update_tests: 15 | "ip routing": 16 | commands: 17 | - "ip routing" 18 | instance: 19 | :routing: true 20 | update_tests: 21 | "no ip routing": 22 | commands: 23 | - "no ip routing" 24 | instance: 25 | :routing: false -------------------------------------------------------------------------------- /lib/puppet/provider/ios_ntp_config/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include ^ntp' 4 | get_instances: 5 | default: 'ntp.+\\n' 6 | attributes: 7 | update_calendar: 8 | default: 9 | get_value: 'ntp update-calendar' 10 | set_value: 'ntp update-calendar' 11 | unset_value: 'no ntp update-calendar' 12 | can_have_no_match: true 13 | exclusions: 14 | - device: '2960' 15 | - device: '3560' 16 | - device: '3650' 17 | - device: '3750' 18 | logging: 19 | default: 20 | get_value: 'ntp logging' 21 | set_value: 'ntp logging' 22 | unset_value: 'no ntp logging' 23 | can_have_no_match: true 24 | -------------------------------------------------------------------------------- /lib/puppet/provider/network_dns/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config' 4 | set_values: 5 | default: 'not used' 6 | attributes: 7 | servers: 8 | default: 9 | get_value: 'ip name-server\s+(?.*)' 10 | set_value: 'ip name-server ' 11 | unset_value: 'no ip name-server ' 12 | domain: 13 | default: 14 | get_value: 'ip (domain-name|domain name) (?\S*)' 15 | set_value: ' ip domain name ' 16 | search: 17 | default: 18 | get_value: 'ip (domain-list|domain list) (?\S*)' 19 | set_value: 'ip domain list ' 20 | unset_value: 'no ip domain list ' 21 | -------------------------------------------------------------------------------- /tasks/config_save.rb: -------------------------------------------------------------------------------- 1 | #!/opt/puppetlabs/puppet/bin/ruby 2 | require_relative '../lib/puppet/util/task_helper' 3 | task = Puppet::Util::TaskHelper.new('cisco_ios') 4 | 5 | result = {} 6 | 7 | unless Puppet.settings.global_defaults_initialized? 8 | Puppet.initialize_settings 9 | end 10 | 11 | begin 12 | rtn = task.transport.save_config 13 | result[:status] = 'success' 14 | result[:results] = "running-config saved to startup-config: #{rtn}" 15 | rescue StandardError => e 16 | result[:_error] = { 17 | msg: e.message, 18 | kind: 'puppetlabs/cisco_ios', 19 | details: { 20 | class: e.class.to_s, 21 | backtrace: e.backtrace, 22 | }, 23 | } 24 | end 25 | 26 | puts result.to_json 27 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_additional_syslog_settings/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include logging' 4 | attributes: 5 | trap: 6 | default: 7 | get_value: '^logging trap (?debugging|informational|notifications|warnings|errors|critical|alerts|emergencies)$' 8 | set_value: 'logging trap ' 9 | unset_value: 'no logging trap' 10 | optional_match: true 11 | origin_id: 12 | default: 13 | get_value: '^logging origin-id (?hostname|ip|ipv6|string\s\S*)$' 14 | set_value: 'logging origin-id ' 15 | unset_value: 'no logging origin-id' 16 | optional_match: true 17 | exclusions: 18 | - device: '4948' 19 | -------------------------------------------------------------------------------- /tasks/restore_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Restore the config to a Cisco IOS device", 3 | "input_method": "stdin", 4 | "remote": true, 5 | "parameters": { 6 | "backup_location": { 7 | "description": "File to restore to device", 8 | "type": "String[1]" 9 | } 10 | }, 11 | "files": [ 12 | "cisco_ios/lib/puppet/util/task_helper.rb", 13 | "cisco_ios/lib/puppet/transport/cisco_ios.rb", 14 | "cisco_ios/lib/puppet/transport/command.yaml", 15 | "cisco_ios/lib/puppet/transport/schema/cisco_ios.rb", 16 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/utility.rb", 17 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/transport_shim.rb", 18 | "ruby_task_helper/files/task_helper.rb" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tasks/backup_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Backup the Cisco IOS running config to a file", 3 | "input_method": "stdin", 4 | "remote": true, 5 | "parameters": { 6 | "backup_location": { 7 | "description": "File to save running config", 8 | "type": "String[1]" 9 | } 10 | }, 11 | "files": [ 12 | "cisco_ios/lib/puppet/util/task_helper.rb", 13 | "cisco_ios/lib/puppet/transport/cisco_ios.rb", 14 | "cisco_ios/lib/puppet/transport/command.yaml", 15 | "cisco_ios/lib/puppet/transport/schema/cisco_ios.rb", 16 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/utility.rb", 17 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/transport_shim.rb", 18 | "ruby_task_helper/files/task_helper.rb" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tasks/restore_startup.rb: -------------------------------------------------------------------------------- 1 | #!/opt/puppetlabs/puppet/bin/ruby 2 | require_relative '../lib/puppet/util/task_helper' 3 | task = Puppet::Util::TaskHelper.new('cisco_ios') 4 | 5 | result = {} 6 | 7 | unless Puppet.settings.global_defaults_initialized? 8 | Puppet.initialize_settings 9 | end 10 | 11 | begin 12 | rtn = task.transport.save_config(from: 'startup-config', to: 'running-config') 13 | result[:status] = 'success' 14 | result[:results] = "startup-config saved to running-config: #{rtn}" 15 | rescue StandardError => e 16 | result[:_error] = { 17 | msg: e.message, 18 | kind: 'puppetlabs/cisco_ios', 19 | details: { 20 | class: e.class.to_s, 21 | backtrace: e.backtrace, 22 | }, 23 | } 24 | end 25 | 26 | puts result.to_json 27 | -------------------------------------------------------------------------------- /hiera.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 5 3 | 4 | defaults: # Used for any hierarchy level that omits these keys. 5 | datadir: data # This path is relative to hiera.yaml's directory. 6 | data_hash: yaml_data # Use the built-in YAML backend. 7 | 8 | hierarchy: 9 | - name: "osfamily/major release" 10 | paths: 11 | # Used to distinguish between Debian and Ubuntu 12 | - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" 13 | - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" 14 | # Used for Solaris 15 | - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml" 16 | - name: "osfamily" 17 | paths: 18 | - "os/%{facts.os.name}.yaml" 19 | - "os/%{facts.os.family}.yaml" 20 | - name: 'common' 21 | path: 'common.yaml' 22 | -------------------------------------------------------------------------------- /tasks/cli_command.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Execute CLI Command", 3 | "input_method": "stdin", 4 | "remote": true, 5 | "parameters": { 6 | "command": { 7 | "description": "CLI Command to execute", 8 | "type": "String[1]" 9 | }, 10 | "raw": { 11 | "description": "Whether to return the raw output or wrap it into JSON", 12 | "type": "Boolean" 13 | } 14 | }, 15 | "files": [ 16 | "cisco_ios/lib/puppet/util/task_helper.rb", 17 | "cisco_ios/lib/puppet/transport/cisco_ios.rb", 18 | "cisco_ios/lib/puppet/transport/command.yaml", 19 | "cisco_ios/lib/puppet/transport/schema/cisco_ios.rb", 20 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/utility.rb", 21 | "cisco_ios/lib/puppet_x/puppetlabs/cisco_ios/transport_shim.rb" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /lib/puppet/provider/ntp_config/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include ^ntp' 4 | get_instances: 5 | default: 'ntp.+\\n' 6 | attributes: 7 | authenticate: 8 | default: 9 | get_value: '(?:(?:ntp authenticate)(?:(?\S*))).*' 10 | set_value: "ntp authenticate" 11 | unset_value: "no ntp authenticate" 12 | source_interface: 13 | default: 14 | get_value: '(?:(?:ntp source )(?:(?\S*))).*' 15 | set_value: "ntp source " 16 | unset_value: "no ntp source" 17 | trusted_key: 18 | default: 19 | get_value: '(?:(?:ntp trusted-key )(?:(?\S*))).*' 20 | set_value: "ntp trusted-key " 21 | unset_value: "no ntp trusted-key " 22 | -------------------------------------------------------------------------------- /examples/ios_stp_global.pp: -------------------------------------------------------------------------------- 1 | ios_stp_global { 'default': 2 | bridge_assurance => true, 3 | loopguard => true, 4 | mode => 'rapid-pvst', 5 | mst_forward_time => 13, 6 | mst_hello_time => 4, 7 | mst_inst_vlan_map => [ 8 | [2, '1-41, 44-65'], 9 | [15, '42-43']], 10 | mst_max_age => 19, 11 | mst_max_hops => 42, 12 | mst_name => 'potato', 13 | mst_priority => [ 14 | ['0-4', 24576], 15 | ['7', 8192]], 16 | mst_revision => 42, 17 | pathcost => 'long', 18 | vlan_forward_time => [ 19 | ['2', 6], 20 | ['3-6', 24]], 21 | vlan_hello_time => [ 22 | ['200-2000', 7]], 23 | vlan_max_age => [ 24 | ['1', 11], 25 | ['42-44', 35]], 26 | vlan_priority => [ 27 | ['1', 40960]], 28 | } 29 | -------------------------------------------------------------------------------- /lib/puppet/provider/banner/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | begin banner' 4 | attributes: 5 | name: 6 | default: 7 | get_value: 'default' 8 | motd: 9 | default: 10 | get_value: 'banner motd \^C(?.*?)\^C' 11 | set_value: 'banner motd %%' 12 | unset_value: 'no banner motd' 13 | multiline: 'true' 14 | login: 15 | default: 16 | get_value: 'banner login \^C(?.*?)\^C' 17 | set_value: 'banner login %%' 18 | unset_value: 'no banner login' 19 | multiline: 'true' 20 | exec: 21 | default: 22 | get_value: 'banner exec \^C(?.*?)\^C' 23 | set_value: 'banner exec %%' 24 | unset_value: 'no banner exec' 25 | multiline: 'true' 26 | -------------------------------------------------------------------------------- /lib/puppet/provider/ntp_auth_key/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include ntp authentication-key' 4 | get_instances: 5 | default: 'ntp authentication-key.+\\n' 6 | set_values: 7 | default: ' ntp authentication-key ' 8 | ensure_is_state: 9 | default: 'true' 10 | attributes: 11 | name: 12 | default: 13 | get_value: '.*(?:ntp authentication-key )(?:(?\d*)).*' 14 | algorithm: 15 | default: 16 | get_value: '.*(?:ntp authentication-key )(?:\S* )(?\S*).*' 17 | mode: 18 | default: 19 | get_value: '.*(?:ntp authentication-key )(?:\S* )(?:\S* )(?:\S* )(?\S*).*' 20 | password: 21 | default: 22 | get_value: '.*(?:ntp authentication-key )(?:\S* )(?:\S* )(?\S*).*' 23 | -------------------------------------------------------------------------------- /lib/puppet/provider/syslog_server/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include ^logging' 4 | get_instances: 5 | default: '^logging (?:host )?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}.*$' 6 | set_values: 7 | default: ' logging host ' 8 | ensure_is_state: 9 | default: 'true' 10 | attributes: 11 | name: 12 | default: 13 | get_value: '^logging (?:host )?(?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' 14 | vrf: 15 | default: 16 | get_value: 'vrf (?.*)$' 17 | exclusions: 18 | - device: '2960' 19 | - device: '4503' 20 | source_interface: 21 | default: 22 | get_value: '^logging source-interface (?.*)$' 23 | severity_level: 24 | default: 25 | get_value: '^logging trap (?.*)$' 26 | -------------------------------------------------------------------------------- /lib/puppet/provider/network_snmp/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include ^snmp-server' 4 | get_instances: 5 | default: 'snmp-server.+\\n' 6 | attributes: 7 | contact: 8 | default: 9 | get_value: '(?:(?:snmp-server contact )(?:(?.*))).*' 10 | set_value: ' snmp-server contact ' 11 | optional_match: true 12 | location: 13 | default: 14 | get_value: '(?:(?:snmp-server location )(?:(?.*))).*' 15 | set_value: ' snmp-server location ' 16 | optional_match: true 17 | name: 18 | default: 19 | get_value: 'default' 20 | optional_match: true 21 | enable: 22 | default: 23 | get_value: 'not used' 24 | set_value: 'no snmp-server' 25 | optional_match: true 26 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_ntp_access_group/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show running-config | include ^ntp access-group' 4 | get_instances: 5 | default: 'ntp access-group.+\\n' 6 | set_values: 7 | default: 'ntp access-group ' 8 | attributes: 9 | access_group_type: 10 | default: 11 | get_value: 'ntp access-group ((ipv6)?)\s?(?peer|peer-only|serve|serve-only)' 12 | ipv6_access_group: 13 | default: 14 | get_value: 'ntp access-group (ipv6)' 15 | exclusions: 16 | - device: '2960' 17 | - device: '3750' 18 | - device: '4507' 19 | - device: '4948' 20 | - device: '6503' 21 | - device: '3560' 22 | name: 23 | default: 24 | get_value: 'ntp access-group ((ipv6)?)\s?(peer|peer-only|serve|serve-only)\s(?[\w.\-]+)' 25 | -------------------------------------------------------------------------------- /.pdkignore: -------------------------------------------------------------------------------- 1 | .git/ 2 | .*.sw[op] 3 | .metadata 4 | .yardoc 5 | .yardwarns 6 | *.iml 7 | /.bundle/ 8 | /.idea/ 9 | /.vagrant/ 10 | /coverage/ 11 | /bin/ 12 | /doc/ 13 | /Gemfile.local 14 | /Gemfile.lock 15 | /junit/ 16 | /log/ 17 | /pkg/ 18 | /spec/fixtures/manifests/ 19 | /spec/fixtures/modules/ 20 | /tmp/ 21 | /vendor/ 22 | /convert_report.txt 23 | /update_report.txt 24 | .DS_Store 25 | .project 26 | .envrc 27 | /inventory.yaml 28 | /appveyor.yml 29 | /.fixtures.yml 30 | /Gemfile 31 | /.gitattributes 32 | /.gitignore 33 | /.gitlab-ci.yml 34 | /.pdkignore 35 | /.puppet-lint.rc 36 | /Rakefile 37 | /rakelib/ 38 | /.rspec 39 | /.rubocop.yml 40 | /.travis.yml 41 | /.yardopts 42 | /spec/ 43 | /.vscode/ 44 | /.sync.yml 45 | SSH_I_DUMPED 46 | /spec/fixtures/acceptance-credentials.conf 47 | /spec/fixtures/acceptance-device.conf 48 | /spec/fixtures/inventory.yml 49 | -------------------------------------------------------------------------------- /tasks/cli_command.rb: -------------------------------------------------------------------------------- 1 | #!/opt/puppetlabs/puppet/bin/ruby 2 | require_relative '../lib/puppet/util/task_helper' 3 | task = Puppet::Util::TaskHelper.new('cisco_ios') 4 | 5 | unless Puppet.settings.global_defaults_initialized? 6 | Puppet.initialize_settings 7 | end 8 | 9 | begin 10 | results = task.transport.run_command_enable_mode(task.params['command']) 11 | if task.params['raw'] 12 | puts results 13 | else 14 | result = {} 15 | result[:success] = 'success' 16 | result[:results] = results.to_s 17 | puts result.to_json 18 | end 19 | exit 0 20 | rescue StandardError => e 21 | result = {} 22 | result[:_error] = { 23 | msg: e.message, 24 | kind: 'puppetlabs/cisco_ios', 25 | details: { 26 | class: e.class.to_s, 27 | backtrace: e.backtrace, 28 | }, 29 | } 30 | puts result.to_json 31 | exit 1 32 | end 33 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/network_interface/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::NetworkInterface; end 4 | require 'puppet/provider/network_interface/cisco_ios' 5 | require 'puppet_x/puppetlabs/cisco_ios/utility' 6 | 7 | RSpec.describe Puppet::Provider::NetworkInterface::CiscoIos do 8 | def self.load_test_data 9 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 10 | end 11 | it_behaves_like 'resources parsed from cli' 12 | it_behaves_like 'commands created from instance' 13 | 14 | context 'Table tests:' do 15 | load_test_data['default']['read_table_tests'].each do |test_name, test| 16 | it test_name.to_s do 17 | expect(PuppetX::CiscoIOS::Utility.read_table(test['status_output']).first).to eq test['instance'] 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /tasks/backup_config.rb: -------------------------------------------------------------------------------- 1 | #!/opt/puppetlabs/puppet/bin/ruby 2 | # frozen_string_literal: true 3 | 4 | require_relative '../lib/puppet/util/task_helper' 5 | task = Puppet::Util::TaskHelper.new('cisco_ios') 6 | 7 | result = {} 8 | 9 | unless Puppet.settings.global_defaults_initialized? 10 | Puppet.initialize_settings 11 | end 12 | 13 | begin 14 | rtn = task.transport.run_command_enable_mode('show running-config') 15 | File.open(task.params['backup_location'], 'wb') do |f| 16 | f.write "#{rtn}\n" 17 | end 18 | result = { 19 | backup_location: task.params['backup_location'], 20 | } 21 | rescue StandardError => e 22 | result[:_error] = { 23 | msg: e.message, 24 | kind: 'puppetlabs/cisco_ios', 25 | details: { 26 | class: e.class.to_s, 27 | backtrace: e.backtrace, 28 | }, 29 | } 30 | end 31 | 32 | puts result.to_json 33 | -------------------------------------------------------------------------------- /lib/puppet/type/ios_access_list.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource_api' 2 | 3 | Puppet::ResourceApi.register_type( 4 | name: 'ios_access_list', 5 | docs: 'Configure access lists. Deprecated, due to unreconcilable implementation issues. Use the ios_acl type instead.', 6 | features: ['remote_resource'], 7 | attributes: { 8 | name: { 9 | type: 'String', 10 | desc: 'Access list name or number.', 11 | behaviour: :namevar, 12 | }, 13 | ensure: { 14 | type: 'Enum[present, absent]', 15 | desc: 'Whether this access list should be present or absent on the target system.', 16 | default: 'present', 17 | }, 18 | access_list_type: { 19 | type: 'Enum["Standard","Extended","Reflexive","none"]', 20 | desc: 'Type of access list - standard, extended, reflexive or no type', 21 | }, 22 | }, 23 | ) 24 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/snmp_notification/test_data.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | default: 3 | read_tests: 4 | "snmp_notification single": 5 | cli: "snmp-server enable traps license\n" 6 | expectations: 7 | - :name: 'license' 8 | :enable: true 9 | "snmp_notification multiple": 10 | cli: "snmp-server enable traps license\nsnmp-server enable traps stpx\n" 11 | expectations: 12 | - :name: 'license' 13 | :enable: true 14 | - :name: 'stpx' 15 | :enable: true 16 | update_tests: 17 | "enable snmp_notification": 18 | commands: 19 | - "snmp-server enable traps license" 20 | instance: 21 | :name: 'license' 22 | :enable: true 23 | "disable snmp_notification": 24 | commands: 25 | - "no snmp-server enable traps license" 26 | instance: 27 | :name: 'license' 28 | :enable: false 29 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet 3 | { 4 | "name": "Puppet Development Kit (Community)", 5 | "dockerFile": "Dockerfile", 6 | 7 | // Set *default* container specific settings.json values on container create. 8 | "settings": { 9 | "terminal.integrated.shell.linux": "/bin/bash" 10 | }, 11 | 12 | // Add the IDs of extensions you want installed when the container is created. 13 | "extensions": [ 14 | "puppet.puppet-vscode", 15 | "rebornix.Ruby" 16 | ] 17 | 18 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 19 | // "forwardPorts": [], 20 | 21 | // Use 'postCreateCommand' to run commands after the container is created. 22 | // "postCreateCommand": "pdk --version", 23 | } 24 | -------------------------------------------------------------------------------- /lib/puppet/provider/network_vlan/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show vlan brief' 4 | header_rows: 5 | default: '(VLAN.*\n)(----.*)' 6 | get_instances: 7 | default: '(?:\n)(\d+.*)' 8 | set_values: 9 | default: 'vlan ' 10 | delete_values: 11 | default: 'no vlan ' 12 | attributes: 13 | id: 14 | default: 15 | get_value: '(?\d+)(?:.*)' 16 | vlan_name: 17 | default: 18 | get_value: '(\d+\s+)(?[\s\S]{0,32}\S)' 19 | set_value: ' name ' 20 | description: 21 | default: 22 | print_key: 'true' 23 | get_value: 'not used' 24 | set_value: '' 25 | optional_match: true 26 | shutdown: 27 | default: 28 | get_value: '(?:\d+\s+)(?:[\s\S]{0,32}\S)(?.*shut\S*)*(?:.*)' 29 | set_value: ' shutdown' 30 | ensure: 31 | default: 32 | get_value: 'not used' 33 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_aaa_session_id/test_data.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | default: 3 | read_tests: 4 | "unique": 5 | cli: "show running-config | begin aaa session-id\naaa session-id unique\nswitch 1 provision ws-c2960s-48fps-l\n!\ncat-3750#" 6 | expectations: 7 | - :name: 'default' 8 | :session_id_type: 'unique' 9 | "common": 10 | cli: "show running-config | begin aaa session-id\naaa session-id common\nswitch 1 provision ws-c2960s-48fps-l\n!\ncat-3750#" 11 | expectations: 12 | - :name: 'default' 13 | :session_id_type: 'common' 14 | update_tests: 15 | "common": 16 | commands: 17 | - "aaa session-id common" 18 | instance: 19 | :name: 'default' 20 | :session_id_type: 'common' 21 | "unique": 22 | commands: 23 | - "aaa session-id unique" 24 | instance: 25 | :name: 'default' 26 | :session_id_type: 'unique' 27 | 28 | -------------------------------------------------------------------------------- /spec/acceptance/network_interface_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'network_interface' do 4 | it 'edit an existing interface' do 5 | # mtu is not supported on the following devices 6 | mtu = ['2960', '3560', '3650', '3750'].include?(device_model) ? '' : 'mtu => 1501,' 7 | pp = <<-EOS 8 | network_interface { 'Vlan42': 9 | enable => true, 10 | description => 'This is a test interface.', 11 | #{mtu} 12 | } 13 | EOS 14 | make_site_pp(pp) 15 | run_device(allow_changes: true) 16 | # Are we idempotent 17 | run_device(allow_changes: false) 18 | # Check puppet resource 19 | result = run_resource('network_interface', 'Vlan42') 20 | expect(result).to match(%r{Vlan42.*}) 21 | expect(result).to match(%r{description.*This is a test interface}) 22 | if result =~ %r{mtu =>.*} 23 | expect(result).to match(%r{mtu.*1501}) 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/puppet/type/ios_ntp_access_group.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource_api' 2 | Puppet::ResourceApi.register_type( 3 | name: 'ios_ntp_access_group', 4 | docs: 'Specify NTP access group config', 5 | features: ['canonicalize', 'simple_get_filter', 'remote_resource'], 6 | attributes: { 7 | name: { 8 | type: 'String', 9 | desc: 'Configuration name, ip access list name', 10 | behaviour: :namevar, 11 | }, 12 | access_group_type: { 13 | type: 'Enum["peer", "serve", "query-only", "serve-only"]', 14 | desc: 'Defines the access group type', 15 | }, 16 | ipv6_access_group: { 17 | type: 'Optional[Boolean]', 18 | desc: 'Whether this access group makes use of ipv6', 19 | }, 20 | ensure: { 21 | type: 'Enum[present, absent]', 22 | desc: 'Whether this access group entry should be present or absent on the target system.', 23 | default: 'present', 24 | }, 25 | }, 26 | ) 27 | -------------------------------------------------------------------------------- /spec/acceptance/snmp_notification_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'snmp_notification' do 4 | it 'enable stpx' do 5 | pp = <<-EOS 6 | snmp_notification { 'stpx': 7 | enable => true 8 | } 9 | EOS 10 | make_site_pp(pp) 11 | run_device(allow_changes: true) 12 | # Are we idempotent 13 | run_device(allow_changes: false) 14 | # Check puppet resource 15 | result = run_resource('snmp_notification', 'stpx') 16 | expect(result).to match(%r{enable.*true}) 17 | end 18 | 19 | it 'disable stpx' do 20 | pp = <<-EOS 21 | snmp_notification { 'stpx': 22 | enable => false 23 | } 24 | EOS 25 | make_site_pp(pp) 26 | run_device(allow_changes: true) 27 | # Are we idempotent 28 | run_device(allow_changes: false) 29 | # Check puppet resource 30 | result = run_resource('snmp_notification', 'stpx') 31 | expect(result).to match(%r{enable.*false}) 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/puppet/type/ios_radius_server_group.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource_api' 2 | 3 | Puppet::ResourceApi.register_type( 4 | name: 'ios_radius_server_group', 5 | docs: 'Configure a RADIUS server group', 6 | features: ['canonicalize', 'remote_resource'], 7 | attributes: { 8 | ensure: { 9 | type: 'Enum[present, absent]', 10 | desc: 'Whether radius_server_group should be present or absent on the target system.', 11 | default: 'present', 12 | }, 13 | name: { 14 | type: 'String', 15 | desc: 'The name of the RADIUS server group', 16 | behaviour: :namevar, 17 | }, 18 | servers: { 19 | type: 'Optional[Array[String]]', 20 | desc: 'Array of DNS suffixes to search for FQDN entries', 21 | }, 22 | private_servers: { 23 | type: 'Optional[Array[String]]', 24 | desc: 'Array of private DNS suffixes to search for FQDN entries', 25 | }, 26 | }, 27 | ) 28 | -------------------------------------------------------------------------------- /examples/ios_config.pp: -------------------------------------------------------------------------------- 1 | # Simple examples 2 | ios_config { 'bill': 3 | command => 'ip domain-name bill', 4 | idempotent_regex => 'ip domain-name bill' 5 | } 6 | 7 | # Example including regex options 8 | ios_config { 'jimmy': 9 | command => 'ip domain-name jimmy', 10 | idempotent_regex => 'ip domain-name JIMMY', 11 | idempotent_regex_options => ['ignorecase'], 12 | } 13 | 14 | # Advanced example 15 | ios_config { 'test-acl': 16 | command => " 17 | no ip access-list extended test-acl 18 | ip access-list extended test-acl 19 | permit tcp 192.168.10.0 0.0.0.255 any eq 22 log 20 | permit udp 192.168.10.0 0.0.0.255 any 21 | ", 22 | # This regex has a negative lookahead at the end to ensure we do not match any addtional lines 23 | idempotent_regex => 'ip access-list extended test-acl\\n permit tcp 192.168.10.0 0.0.0.255 any eq 22 log\\n permit udp 192.168.10.0 0.0.0.255 any\\n(?!\s+(deny|permit))', 24 | } -------------------------------------------------------------------------------- /spec/unit/puppet/provider/network_dns/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::NetworkDns; end 4 | require 'puppet/provider/network_dns/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::NetworkDns::CiscoIos do 7 | let(:provider) { described_class.new } 8 | 9 | def self.load_test_data 10 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 11 | end 12 | 13 | it_behaves_like 'resources parsed from cli' 14 | 15 | context 'Update tests:' do 16 | load_test_data['default']['update_tests'].each do |test_name, test| 17 | it test_name.to_s do 18 | expect(described_class.commands_from_is_should(test['is'], test['should'])).to eq test['cli'] 19 | end 20 | end 21 | end 22 | 23 | describe '#canonicalize' do 24 | it { expect(provider.canonicalize(anything, [{ name: 'foo', servers: ['2.2.2.2', '1.1.1.1'] }])).to eq [{ name: 'foo', servers: ['1.1.1.1', '2.2.2.2'] }] } 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ntp_config/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::NtpConfig; end 4 | require 'puppet/provider/ntp_config/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::NtpConfig::CiscoIos do 7 | let(:provider) { described_class.new } 8 | 9 | def self.load_test_data 10 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 11 | end 12 | 13 | it_behaves_like 'resources parsed from cli' 14 | 15 | describe '#canonicalize' do 16 | it { expect(provider.canonicalize(anything, [{ name: 'foo', trusted_keys: ['12', '48', '24', '96'] }])).to eq [{ name: 'foo', trusted_keys: ['12', '24', '48', '96'] }] } 17 | end 18 | 19 | context 'Update tests:' do 20 | load_test_data['default']['update_tests'].each do |test_name, test| 21 | it test_name.to_s do 22 | expect(described_class.commands_from_is_should(test['is'], test['should'])).to eq test['cli'] 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/unit/puppet/provider/ios_network_dns/cisco_ios_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | module Puppet::Provider::IosNetworkDns; end 4 | require 'puppet/provider/ios_network_dns/cisco_ios' 5 | 6 | RSpec.describe Puppet::Provider::IosNetworkDns::CiscoIos do 7 | let(:provider) { described_class.new } 8 | 9 | def self.load_test_data 10 | PuppetX::CiscoIOS::Utility.load_yaml(File.expand_path(__dir__) + '/test_data.yaml', false) 11 | end 12 | 13 | it_behaves_like 'resources parsed from cli' 14 | 15 | context 'Update tests:' do 16 | load_test_data['default']['update_tests'].each do |test_name, test| 17 | it test_name.to_s do 18 | expect(described_class.commands_from_is_should(test['is'], test['should'])).to eq test['cli'] 19 | end 20 | end 21 | end 22 | 23 | describe '#canonicalize' do 24 | it { expect(provider.canonicalize(anything, [{ name: 'foo', servers: ['2.2.2.2', '1.1.1.1'] }])).to eq [{ name: 'foo', servers: ['1.1.1.1', '2.2.2.2'] }] } 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Mark stale issues and pull requests 2 | 3 | on: 4 | schedule: 5 | - cron: "30 1 * * *" 6 | 7 | jobs: 8 | stale: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/stale@v3 12 | with: 13 | repo-token: ${{ secrets.GITHUB_TOKEN }} 14 | days-before-stale: 60 15 | days-before-close: 7 16 | stale-issue-message: 'This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.' 17 | stale-issue-label: 'stale' 18 | stale-pr-message: 'This PR has been marked as stale because it has been open for a while and has had no recent activity. If this PR is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.' 19 | stale-pr-label: 'stale' 20 | -------------------------------------------------------------------------------- /lib/puppet/provider/ios_acl_entry/command.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | get_values: 3 | default: 'show ip access-lists' 4 | get_instances: 5 | default: '\S* IP access list (?:(?:.| |\n )*\n)' 6 | set_values: 7 | default: '