|
| 1 | +# Manifest to demo cisco_hsrp_global provider |
| 2 | +# |
| 3 | +# Copyright (c) 2016 Cisco and/or its affiliates. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +class ciscopuppet::cisco::demo_hsrp { |
| 18 | + |
| 19 | + $bfd_all_intf = platform_get() ? { |
| 20 | + /(n5k|n6k|n7k|n9k)/ => true, |
| 21 | + default => undef |
| 22 | + } |
| 23 | + |
| 24 | + cisco_hsrp_global { 'default': |
| 25 | + bfd_all_intf => $bfd_all_intf, |
| 26 | + extended_hold => 200, |
| 27 | + } |
| 28 | + |
| 29 | + $n7k_ath = platform_get() ? { |
| 30 | + 'n7k' => $facts['cisco']['images']['system_image'] ? { |
| 31 | + /(8.0)/ => true, |
| 32 | + default => false |
| 33 | + }, |
| 34 | + /(n3k|n9k)/ => true, |
| 35 | + default => false |
| 36 | + } |
| 37 | + |
| 38 | + if $n7k_ath { |
| 39 | + cisco_interface { 'port-channel100': |
| 40 | + ensure => 'present', |
| 41 | + switchport_mode => 'disabled', |
| 42 | + hsrp_bfd => true, |
| 43 | + hsrp_delay_minimum => 200, |
| 44 | + hsrp_delay_reload => 300, |
| 45 | + hsrp_mac_refresh => 400, |
| 46 | + hsrp_use_bia => 'use_bia_intf', |
| 47 | + hsrp_version => 2, |
| 48 | + } |
| 49 | + |
| 50 | + cisco_interface { 'port-channel200': |
| 51 | + ensure => 'present', |
| 52 | + switchport_mode => 'disabled', |
| 53 | + hsrp_delay_minimum => 50, |
| 54 | + hsrp_delay_reload => 100, |
| 55 | + hsrp_mac_refresh => 300, |
| 56 | + hsrp_version => 2, |
| 57 | + } |
| 58 | + |
| 59 | + cisco_command_config { 'ipv6-addr': |
| 60 | + command => " |
| 61 | + interface Po100 |
| 62 | + ipv6 address 2000::01/64 |
| 63 | + " |
| 64 | + } |
| 65 | + cisco_interface_hsrp_group { 'port-channel100 2 ipv6': |
| 66 | + ensure => 'present', |
| 67 | + authentication_auth_type => 'md5', |
| 68 | + authentication_string => '12345678901234567890', |
| 69 | + authentication_key_type => 'key-string', |
| 70 | + authentication_enc_type => 'encrypted', |
| 71 | + authentication_compatibility => true, |
| 72 | + authentication_timeout => 200, |
| 73 | + ipv6_vip => ['2000::11', '2000::22'], |
| 74 | + ipv6_autoconfig => true, |
| 75 | + group_name => 'MyHsrp', |
| 76 | + preempt => true, |
| 77 | + preempt_delay_minimum => '100', |
| 78 | + preempt_delay_reload => '100', |
| 79 | + preempt_delay_sync => '100', |
| 80 | + priority => '45', |
| 81 | + priority_forward_thresh_lower => '10', |
| 82 | + priority_forward_thresh_upper => '40', |
| 83 | + timers_hello_msec => true, |
| 84 | + timers_hold_msec => true, |
| 85 | + timers_hello => 300, |
| 86 | + timers_hold => 1000, |
| 87 | + } |
| 88 | + |
| 89 | + cisco_interface_hsrp_group { 'port-channel100 2 ipv4': |
| 90 | + ensure => 'present', |
| 91 | + authentication_auth_type => 'cleartext', |
| 92 | + authentication_string => 'MyPass', |
| 93 | + ipv4_enable => true, |
| 94 | + ipv4_vip => '2.2.2.2', |
| 95 | + } |
| 96 | + |
| 97 | + cisco_interface_hsrp_group { 'port-channel200 50 ipv4': |
| 98 | + ensure => 'present', |
| 99 | + ipv4_enable => true, |
| 100 | + mac_addr => '00:00:11:11:22:22', |
| 101 | + } |
| 102 | + } else { |
| 103 | + warning('This platform does not support interface hsrp properties') |
| 104 | + } |
| 105 | +} |
| 106 | + |
0 commit comments