Advertisement
Guest User

Untitled

a guest
Mar 9th, 2020
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1. - name: CONFIGURE HOSTNAME
  2. nxos_config:
  3. lines: hostname {{ inventory_hostname }}
  4. provider: "{{ nxos_provider }}"
  5.  
  6. - name: ENABLE FEATURES
  7. nxos_feature:
  8. feature: "{{item.feature }}"
  9. provider: "{{ nxos_provider }}"
  10. with_items: "{{ features }}"
  11.  
  12. - name: CONFIGURE PHYSICAL L3 INTERFACES
  13. nxos_interface:
  14. interface: "{{item.interface }}"
  15. mode: layer3
  16. admin_state: up
  17. provider: "{{ nxos_provider }}"
  18. with_items: "{{ l3_interfaces }}"
  19.  
  20. - name: CONFIGURE LOOPBACK INTERFACES
  21. nxos_interface:
  22. interface: "{{ item.interface }}"
  23. provider: "{{ nxos_provider }}"
  24. with_items: "{{ loopbacks }}"
  25.  
  26. - name: CONFIGURE INTERFACE IP ADDR
  27. nxos_ip_interface:
  28. interface: "{{ item.interface }}"
  29. addr: "{{ item.addr }}"
  30. mask: "{{ item.mask }}"
  31. provider: "{{ nxos_provider }}"
  32. with_items:
  33. - "{{ loopbacks }}"
  34.  
  35. - name: CHANGE INTERFACE MTU TO 9216
  36. nxos_mtu:
  37. mtu: 9216
  38. interface: "{{ item.interface }}"
  39. state: present
  40. provider: "{{ nxos_provider }}"
  41. with_items: "{{ l3_interfaces }}"
  42.  
  43. - name: CONFIGURE INTERFACE IP UNNUMBERED
  44. nxos_config:
  45. lines:
  46. - medium p2p
  47. - ip unnumbered loopback 0
  48. parents:
  49. - 'interface {{ item.interface }}'
  50. provider: "{{ nxos_provider }}"
  51. with_items: "{{ l3_interfaces }}"
  52.  
  53. - name: CONFIGURE OSPF PROCESS ID AND AREA AND ROUTER ID
  54. nxos_ospf_vrf:
  55. ospf: "{{ ospf_process_id }}"
  56. router_id: "{{ router_id }}"
  57. provider: "{{ nxos_provider }}"
  58.  
  59. - name: ASSOCIATE INTERFACES WITH OSPF PROCESS
  60. nxos_interface_ospf:
  61. interface: "{{ item.interface }}"
  62. ospf: "{{ ospf_process_id }}"
  63. area: "{{ ospf_area }}"
  64. provider: "{{ nxos_provider }}"
  65. with_items:
  66. - "{{ l3_interfaces }}"
  67. - "{{ loopbacks }}"
  68.  
  69. - name: CONFIGURE OSPF INTERFACES NETWORK P2P
  70. nxos_config:
  71. lines: ip ospf network point-to-point
  72. parents:
  73. - 'interface {{ item.interface }}'
  74. provider: "{{ nxos_provider }}"
  75. with_items: "{{ l3_interfaces }}"
  76.  
  77. - name: CONFIGURE PIM ANYCAST RP
  78. nxos_config:
  79. lines:
  80. - "ip pim anycast-rp {{ rp_address }} {{ s1_loopback }}"
  81. - "ip pim anycast-rp {{ rp_address }} {{ s2_loopback }}"
  82. provider: "{{ nxos_provider }}"
  83.  
  84. - name: CONFIGURE PIM RP
  85. nxos_pim_rp_address:
  86. rp_address: "{{ rp_address }}"
  87.  
  88. - name: CONFIGURE PIM INTERFACES
  89. nxos_pim_interface:
  90. interface: "{{ item.interface }}"
  91. sparse: true
  92. provider: "{{ nxos_provider }}"
  93. with_items: "{{ l3_interfaces }}"
  94.  
  95. - name: ENABLE NV OVERLAY EVPN
  96. nxos_evpn_global:
  97. nv_overlay_evpn: true
  98. provider: "{{ nxos_provider }}"
  99.  
  100. - name: CONFIGURE BGP ASN AND ROUTER ID
  101. nxos_bgp:
  102. asn: "{{ asn }}"
  103. router_id: "{{ router_id }}"
  104. provider: "{{ nxos_provider }}"
  105. state: present
  106.  
  107. - name: CONFIGURE BGP NEIGHBORS
  108. nxos_bgp_neighbor:
  109. asn: "{{ asn }}"
  110. neighbor: "{{ item.neighbor }}"
  111. remote_as: "{{ item.remote_as }}"
  112. update_source: "{{ item.update_source }}"
  113. provider: "{{ nxos_provider }}"
  114. with_items: "{{ bgp_neighbors }}"
  115.  
  116. - name: CONFIGURE L2VPN EVPN ADDRESS FAMILY FOR BGP NEIGHBORS
  117. nxos_bgp_neighbor_af:
  118. asn: "{{ asn }}"
  119. neighbor: "{{ item.neighbor }}"
  120. afi: l2vpn
  121. safi: evpn
  122. send_community: both
  123. route_reflector_client: "true"
  124. provider: "{{ nxos_provider }}"
  125. with_items: "{{ bgp_neighbors }}"
  126.  
  127. - name: SAVE RUN CONFIG TO STARTUP CONFIG
  128. nxos_config:
  129. save: yes
  130. provider: "{{ nxos_provider }}"
  131.  
  132. Source: https://github.com/mtarking/cisco-nxos-ansible-vxlan-evpn/blob/master/roles/spine/tasks/main.yml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement