Nxos restore provider to nxapi tests (#41818)

* Quick and dirty sed to add provider

* Manually verify the rest of the cases

* Add missing provider
This commit is contained in:
Nathaniel Case 2018-07-02 09:43:51 -04:00 committed by GitHub
parent 1659951710
commit a197125954
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
127 changed files with 713 additions and 0 deletions

View file

@ -9,6 +9,7 @@
deadtime: default deadtime: default
server_timeout: default server_timeout: default
directed_request: default directed_request: default
provider: "{{ connection }}"
state: default state: default
ignore_errors: yes ignore_errors: yes
@ -16,6 +17,7 @@
- name: "Configure radius server defaults" - name: "Configure radius server defaults"
nxos_aaa_server: &configure_default_radius nxos_aaa_server: &configure_default_radius
server_type: radius server_type: radius
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -33,6 +35,7 @@
server_timeout: 9 server_timeout: 9
deadtime: 20 deadtime: 20
directed_request: enabled directed_request: enabled
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -57,6 +60,7 @@
server_type: radius server_type: radius
encrypt_type: 7 encrypt_type: 7
global_key: test_key global_key: test_key
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -75,6 +79,7 @@
server_timeout: default server_timeout: default
global_key: default global_key: default
directed_request: default directed_request: default
provider: "{{ connection }}"
state: default state: default
register: result register: result

View file

@ -6,6 +6,7 @@
- name: "Enable feature tacacs+" - name: "Enable feature tacacs+"
nxos_feature: nxos_feature:
feature: tacacs+ feature: tacacs+
provider: "{{ connection }}"
state: enabled state: enabled
- name: "Setup" - name: "Setup"
@ -14,6 +15,7 @@
deadtime: default deadtime: default
server_timeout: default server_timeout: default
directed_request: default directed_request: default
provider: "{{ connection }}"
state: default state: default
ignore_errors: yes ignore_errors: yes
@ -21,6 +23,7 @@
- name: "Configure tacacs server defaults" - name: "Configure tacacs server defaults"
nxos_aaa_server: &configure_default_tacacs nxos_aaa_server: &configure_default_tacacs
server_type: tacacs server_type: tacacs
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -38,6 +41,7 @@
server_timeout: 9 server_timeout: 9
deadtime: 20 deadtime: 20
directed_request: enabled directed_request: enabled
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -62,6 +66,7 @@
server_type: tacacs server_type: tacacs
encrypt_type: 7 encrypt_type: 7
global_key: test_key global_key: test_key
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -80,6 +85,7 @@
server_timeout: default server_timeout: default
global_key: default global_key: default
directed_request: default directed_request: default
provider: "{{ connection }}"
state: default state: default
register: result register: result
@ -104,6 +110,7 @@
- name: "Disable feature tacacs+" - name: "Disable feature tacacs+"
nxos_feature: nxos_feature:
feature: tacacs+ feature: tacacs+
provider: "{{ connection }}"
state: disabled state: disabled
- debug: msg="END connection={{ ansible_connection }} nxos_aaa_server tacacs.yaml sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_aaa_server tacacs.yaml sanity test"

View file

@ -7,6 +7,7 @@
nxos_aaa_server_host: &remove nxos_aaa_server_host: &remove
server_type: radius server_type: radius
address: 8.8.8.8 address: 8.8.8.8
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -15,6 +16,7 @@
nxos_aaa_server_host: &configure_default_radius nxos_aaa_server_host: &configure_default_radius
server_type: radius server_type: radius
address: 8.8.8.8 address: 8.8.8.8
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -49,6 +51,7 @@
host_timeout: 25 host_timeout: 25
auth_port: 2083 auth_port: 2083
acct_port: 2084 acct_port: 2084
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -67,6 +70,7 @@
host_timeout: default host_timeout: default
auth_port: 1000 auth_port: 1000
acct_port: default acct_port: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -87,6 +91,7 @@
acct_port: 2084 acct_port: 2084
encrypt_type: 0 encrypt_type: 0
key: hello key: hello
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -113,6 +118,7 @@
acct_port: 2084 acct_port: 2084
encrypt_type: 7 encrypt_type: 7
key: hello key: hello
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -133,6 +139,7 @@
acct_port: default acct_port: default
encrypt_type: 7 encrypt_type: 7
key: default key: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -152,6 +159,7 @@
auth_port: default auth_port: default
acct_port: default acct_port: default
key: default key: default
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -6,12 +6,14 @@
- name: "Enable feature tacacs+" - name: "Enable feature tacacs+"
nxos_feature: nxos_feature:
feature: tacacs+ feature: tacacs+
provider: "{{ connection }}"
state: enabled state: enabled
- name: "Setup" - name: "Setup"
nxos_aaa_server_host: &remove nxos_aaa_server_host: &remove
server_type: tacacs server_type: tacacs
address: 8.8.8.8 address: 8.8.8.8
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -21,6 +23,7 @@
nxos_aaa_server_host: &configure_default_tacacs nxos_aaa_server_host: &configure_default_tacacs
server_type: tacacs server_type: tacacs
address: 8.8.8.8 address: 8.8.8.8
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -54,6 +57,7 @@
address: 8.8.8.8 address: 8.8.8.8
host_timeout: 25 host_timeout: 25
tacacs_port: 89 tacacs_port: 89
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -71,6 +75,7 @@
address: 8.8.8.8 address: 8.8.8.8
host_timeout: default host_timeout: default
tacacs_port: 100 tacacs_port: 100
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -90,6 +95,7 @@
tacacs_port: default tacacs_port: default
encrypt_type: 0 encrypt_type: 0
key: hello key: hello
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -115,6 +121,7 @@
tacacs_port: 89 tacacs_port: 89
encrypt_type: 7 encrypt_type: 7
key: hello key: hello
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -134,6 +141,7 @@
tacacs_port: 89 tacacs_port: 89
encrypt_type: 7 encrypt_type: 7
key: default key: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -152,6 +160,7 @@
host_timeout: default host_timeout: default
tacacs_port: default tacacs_port: default
key: default key: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -176,6 +185,7 @@
- name: "Disable feature tacacs+" - name: "Disable feature tacacs+"
nxos_feature: nxos_feature:
feature: tacacs+ feature: tacacs+
provider: "{{ connection }}"
state: disabled state: disabled
- debug: msg="END connection={{ ansible_connection }} nxos_aaa_server_host tacacs.yaml sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_aaa_server_host tacacs.yaml sanity test"

View file

@ -10,6 +10,7 @@
nxos_acl: &remove nxos_acl: &remove
name: TEST_ACL name: TEST_ACL
seq: 10 seq: 10
provider: "{{ connection }}"
state: delete_acl state: delete_acl
ignore_errors: yes ignore_errors: yes
@ -36,6 +37,7 @@
rst: 'enable' rst: 'enable'
syn: 'enable' syn: 'enable'
time_range: "{{time_range|default(omit)}}" time_range: "{{time_range|default(omit)}}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -74,6 +76,7 @@
rst: 'enable' rst: 'enable'
syn: 'enable' syn: 'enable'
time_range: "{{time_range|default(omit)}}" time_range: "{{time_range|default(omit)}}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -91,6 +94,7 @@
seq: 20 seq: 20
action: remark action: remark
remark: test_remark remark: test_remark
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -108,6 +112,7 @@
seq: 20 seq: 20
action: remark action: remark
remark: changed_remark remark: changed_remark
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -129,6 +134,7 @@
dest: any dest: any
fragments: enable fragments: enable
precedence: network precedence: network
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -149,6 +155,7 @@
src: any src: any
dest: any dest: any
precedence: network precedence: network
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -171,6 +178,7 @@
src_port1: 1200 src_port1: 1200
dest: any dest: any
precedence: network precedence: network
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -191,6 +199,7 @@
src: any src: any
dest: any dest: any
precedence: network precedence: network
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -206,6 +215,7 @@
nxos_acl: &remace30 nxos_acl: &remace30
name: TEST_ACL name: TEST_ACL
seq: 30 seq: 30
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -13,6 +13,7 @@
nxos_config: &default nxos_config: &default
lines: lines:
- "default interface {{ intname }}" - "default interface {{ intname }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: "Setup: Put interface into no switch port mode" - name: "Setup: Put interface into no switch port mode"
@ -22,12 +23,14 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: "Setup: Cleanup possibly existing acl" - name: "Setup: Cleanup possibly existing acl"
nxos_acl: &remove nxos_acl: &remove
name: ANSIBLE_ACL name: ANSIBLE_ACL
seq: 10 seq: 10
provider: "{{ connection }}"
state: delete_acl state: delete_acl
ignore_errors: yes ignore_errors: yes
@ -39,6 +42,7 @@
proto: tcp proto: tcp
src: 192.0.2.1/24 src: 192.0.2.1/24
dest: any dest: any
provider: "{{ connection }}"
- block: - block:
- name: Configure acl interface egress - name: Configure acl interface egress
@ -46,6 +50,7 @@
name: ANSIBLE_ACL name: ANSIBLE_ACL
interface: "{{ intname }}" interface: "{{ intname }}"
direction: egress direction: egress
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -66,6 +71,7 @@
name: ANSIBLE_ACL name: ANSIBLE_ACL
interface: "{{ intname }}" interface: "{{ intname }}"
direction: ingress direction: ingress
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -82,6 +88,7 @@
name: ANSIBLE_ACL name: ANSIBLE_ACL
interface: "{{ intname }}" interface: "{{ intname }}"
direction: egress direction: egress
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -98,6 +105,7 @@
name: ANSIBLE_ACL name: ANSIBLE_ACL
interface: "{{ intname }}" interface: "{{ intname }}"
direction: ingress direction: ingress
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -5,6 +5,7 @@
- name: setup - remove exec - name: setup - remove exec
nxos_banner: &remove nxos_banner: &remove
banner: exec banner: exec
provider: "{{ connection }}"
state: absent state: absent
- name: Set exec - name: Set exec
@ -14,6 +15,7 @@
this is my exec banner this is my exec banner
that has a multiline that has a multiline
string string
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -4,6 +4,7 @@
- name: setup - remove motd - name: setup - remove motd
nxos_banner: &remove nxos_banner: &remove
banner: motd banner: motd
provider: "{{ connection }}"
state: absent state: absent
- name: Set motd - name: Set motd
@ -13,6 +14,7 @@
this is my motd banner this is my motd banner
that has a multiline that has a multiline
string string
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -7,11 +7,13 @@
text: | text: |
Junk motd banner Junk motd banner
over multiple lines over multiple lines
provider: "{{ connection }}"
state: present state: present
- name: remove motd - name: remove motd
nxos_banner: &rm-motd nxos_banner: &rm-motd
banner: motd banner: motd
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -12,12 +12,14 @@
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -28,6 +30,7 @@
disable_policy_batching: true disable_policy_batching: true
disable_policy_batching_ipv4_prefix_list: v4_p disable_policy_batching_ipv4_prefix_list: v4_p
disable_policy_batching_ipv6_prefix_list: v6_p disable_policy_batching_ipv6_prefix_list: v6_p
provider: "{{ connection }}"
register: result register: result
when: bgp_disable_policy when: bgp_disable_policy
@ -52,6 +55,7 @@
disable_policy_batching: false disable_policy_batching: false
disable_policy_batching_ipv4_prefix_list: default disable_policy_batching_ipv4_prefix_list: default
disable_policy_batching_ipv6_prefix_list: default disable_policy_batching_ipv6_prefix_list: default
provider: "{{ connection }}"
register: result register: result
when: bgp_disable_policy when: bgp_disable_policy
@ -73,6 +77,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -12,6 +12,7 @@
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
when: test_helsinki when: test_helsinki
@ -19,6 +20,7 @@
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
when: test_helsinki when: test_helsinki
@ -36,6 +38,7 @@
reconnect_interval: 55 reconnect_interval: 55
timer_bgp_hold: 110 timer_bgp_hold: 110
timer_bgp_keepalive: 45 timer_bgp_keepalive: 45
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
when: test_helsinki when: test_helsinki
@ -67,6 +70,7 @@
reconnect_interval: default reconnect_interval: default
timer_bgp_hold: default timer_bgp_hold: default
timer_bgp_keepalive: default timer_bgp_keepalive: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
when: test_helsinki when: test_helsinki
@ -90,6 +94,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
when: test_helsinki when: test_helsinki

View file

@ -13,12 +13,14 @@
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -29,6 +31,7 @@
nxos_bgp: &set1 nxos_bgp: &set1
asn: 65535 asn: 65535
isolate: false isolate: false
provider: "{{ connection }}"
register: result register: result
when: bgp_isolate when: bgp_isolate
@ -51,6 +54,7 @@
nxos_bgp: &reset1 nxos_bgp: &reset1
asn: 65535 asn: 65535
isolate: true isolate: true
provider: "{{ connection }}"
register: result register: result
when: bgp_isolate when: bgp_isolate
@ -72,6 +76,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -6,12 +6,14 @@
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -33,6 +35,7 @@
graceful_restart_helper: true graceful_restart_helper: true
log_neighbor_changes: true log_neighbor_changes: true
maxas_limit: 50 maxas_limit: 50
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -64,6 +67,7 @@
log_neighbor_changes: false log_neighbor_changes: false
maxas_limit: default maxas_limit: default
router_id: default router_id: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -81,6 +85,7 @@
asn: 65535 asn: 65535
vrf: "{{ item }}" vrf: "{{ item }}"
cluster_id: 10.0.0.1 cluster_id: 10.0.0.1
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -98,6 +103,7 @@
asn: 65535 asn: 65535
vrf: "{{ item }}" vrf: "{{ item }}"
cluster_id: default cluster_id: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -118,6 +124,7 @@
- 16 - 16
- 22 - 22
- 18 - 18
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -133,6 +140,7 @@
asn: 65535 asn: 65535
confederation_id: default confederation_id: default
confederation_peers: default confederation_peers: default
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -153,6 +161,7 @@
- 16 - 16
- 22 - 22
- 18 - 18
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -170,6 +179,7 @@
local_as: default local_as: default
confederation_id: default confederation_id: default
confederation_peers: default confederation_peers: default
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -186,6 +196,7 @@
vrf: myvrf vrf: myvrf
local_as: 33 local_as: 33
confederation_id: 99 confederation_id: 99
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -202,6 +213,7 @@
vrf: myvrf vrf: myvrf
confederation_id: default confederation_id: default
local_as: default local_as: default
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -223,6 +235,7 @@
fast_external_fallover: false fast_external_fallover: false
flush_routes: true flush_routes: true
shutdown: true shutdown: true
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -241,6 +254,7 @@
fast_external_fallover: true fast_external_fallover: true
flush_routes: false flush_routes: false
shutdown: false shutdown: false
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -255,6 +269,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -15,12 +15,14 @@
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
- name: "Setup" - name: "Setup"
nxos_bgp: &remove nxos_bgp: &remove
asn: 65535 asn: 65535
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
register: result register: result
@ -30,6 +32,7 @@
nxos_bgp: &configure_default nxos_bgp: &configure_default
asn: 65535 asn: 65535
router_id: 192.0.2.1 router_id: 192.0.2.1
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -91,6 +94,7 @@
event_history_events: size_medium event_history_events: size_medium
event_history_periodic: size_small event_history_periodic: size_small
suppress_fib_pending: true suppress_fib_pending: true
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -117,6 +121,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
rescue: rescue:
@ -127,6 +132,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -14,12 +14,14 @@
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -31,6 +33,7 @@
asn: 65535 asn: 65535
vrf: "{{ item }}" vrf: "{{ item }}"
timer_bestpath_limit: 255 timer_bestpath_limit: 255
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -52,6 +55,7 @@
asn: 65535 asn: 65535
vrf: "{{ item }}" vrf: "{{ item }}"
timer_bestpath_limit: default timer_bestpath_limit: default
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -72,6 +76,7 @@
nxos_bgp: &set2 nxos_bgp: &set2
asn: 65535 asn: 65535
suppress_fib_pending: false suppress_fib_pending: false
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -89,6 +94,7 @@
nxos_bgp: &reset2 nxos_bgp: &reset2
asn: 65535 asn: 65535
suppress_fib_pending: true suppress_fib_pending: true
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -109,6 +115,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -9,18 +9,21 @@
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
- name: "Enable feature nv overlay" - name: "Enable feature nv overlay"
nxos_feature: nxos_feature:
feature: nv overlay feature: nv overlay
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
- name: "Setup" - name: "Setup"
nxos_bgp: &remove nxos_bgp: &remove
asn: 65535 asn: 65535
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -38,6 +41,7 @@
afi: ipv4 afi: ipv4
safi: unicast safi: unicast
advertise_l2vpn_evpn: "{{advertise_l2vpn_evpn|default(omit)}}" advertise_l2vpn_evpn: "{{advertise_l2vpn_evpn|default(omit)}}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -59,6 +63,7 @@
vrf: testing vrf: testing
afi: ipv4 afi: ipv4
safi: unicast safi: unicast
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -77,6 +82,7 @@
additional_paths_send: true additional_paths_send: true
client_to_client: False client_to_client: False
default_information_originate: true default_information_originate: true
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -103,6 +109,7 @@
additional_paths_send: False additional_paths_send: False
client_to_client: True client_to_client: True
default_information_originate: False default_information_originate: False
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -122,6 +129,7 @@
vrf: "{{ item }}" vrf: "{{ item }}"
afi: ipv4 afi: ipv4
safi: unicast safi: unicast
provider: "{{ connection }}"
state: absent state: absent
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -145,6 +153,7 @@
suppress_inactive: true suppress_inactive: true
table_map: RouteMap table_map: RouteMap
table_map_filter: true table_map_filter: true
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -175,6 +184,7 @@
suppress_inactive: False suppress_inactive: False
table_map: default table_map: default
table_map_filter: False table_map_filter: False
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -209,6 +219,7 @@
inject_map: [['lax_inject_map', 'lax_exist_map'], ['nyc_inject_map', 'nyc_exist_map', 'copy-attributes'], ['fsd_inject_map', 'fsd_exist_map']] inject_map: [['lax_inject_map', 'lax_exist_map'], ['nyc_inject_map', 'nyc_exist_map', 'copy-attributes'], ['fsd_inject_map', 'fsd_exist_map']]
networks: [['10.0.0.0/16', 'routemap_LA'], ['192.168.1.1/32', 'Chicago'], ['192.168.2.0/24'], ['192.168.3.0/24', 'routemap_NYC']] networks: [['10.0.0.0/16', 'routemap_LA'], ['192.168.1.1/32', 'Chicago'], ['192.168.2.0/24'], ['192.168.3.0/24', 'routemap_NYC']]
redistribute: [['direct', 'rm_direct'], ['lisp', 'rm_lisp']] redistribute: [['direct', 'rm_direct'], ['lisp', 'rm_lisp']]
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -236,6 +247,7 @@
inject_map: [['fsd_inject_map', 'fsd_exist_map']] inject_map: [['fsd_inject_map', 'fsd_exist_map']]
networks: [['192.168.2.0/24']] networks: [['192.168.2.0/24']]
redistribute: [['lisp', 'rm_lisp']] redistribute: [['lisp', 'rm_lisp']]
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -263,6 +275,7 @@
inject_map: default inject_map: default
networks: default networks: default
redistribute: default redistribute: default
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -299,11 +312,13 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: &disable_bgp nxos_feature: &disable_bgp
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
- name: "Disable feature nv overlay" - name: "Disable feature nv overlay"
nxos_feature: &disable_nvoverlay nxos_feature: &disable_nvoverlay
feature: nv overlay feature: nv overlay
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -18,6 +18,7 @@
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -26,6 +27,7 @@
asn: 65535 asn: 65535
neighbor: 192.0.2.3 neighbor: 192.0.2.3
vrf: "{{ item }}" vrf: "{{ item }}"
provider: "{{ connection }}"
state: absent state: absent
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
ignore_errors: yes ignore_errors: yes
@ -35,6 +37,7 @@
asn: 65535 asn: 65535
neighbor: 192.0.2.3/32 neighbor: 192.0.2.3/32
vrf: "{{ item }}" vrf: "{{ item }}"
provider: "{{ connection }}"
state: absent state: absent
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
ignore_errors: yes ignore_errors: yes
@ -60,6 +63,7 @@
description: "just a description" description: "just a description"
update_source: "{{ intname.capitalize() }}" update_source: "{{ intname.capitalize() }}"
shutdown: true shutdown: true
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -97,6 +101,7 @@
description: default description: default
update_source: default update_source: default
shutdown: False shutdown: False
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -131,6 +136,7 @@
vrf: "{{ item }}" vrf: "{{ item }}"
description: "tested by ansible" description: "tested by ansible"
remove_private_as: "{{remove_private_asa|default(omit)}}" remove_private_as: "{{remove_private_asa|default(omit)}}"
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -151,6 +157,7 @@
vrf: "{{ item }}" vrf: "{{ item }}"
description: "tested by ansible" description: "tested by ansible"
remove_private_as: "{{remove_private_asr|default(omit)}}" remove_private_as: "{{remove_private_asr|default(omit)}}"
provider: "{{ connection }}"
state: present state: present
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -307,6 +314,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: &disable_bgp nxos_feature: &disable_bgp
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
- debug: msg="END connection={{ ansible_connection }} nxos_bgp_neighbor sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_bgp_neighbor sanity test"

View file

@ -9,12 +9,14 @@
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: &disable_bgp nxos_feature: &disable_bgp
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -45,6 +47,7 @@
suppress_inactive: True suppress_inactive: True
unsuppress_map: 'unsup_map' unsuppress_map: 'unsup_map'
weight: '30' weight: '30'
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -86,6 +89,7 @@
suppress_inactive: False suppress_inactive: False
unsuppress_map: default unsuppress_map: default
weight: default weight: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -103,6 +107,7 @@
neighbor: '192.0.2.3' neighbor: '192.0.2.3'
afi: ipv4 afi: ipv4
safi: unicast safi: unicast
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -128,6 +133,7 @@
max_prefix_threshold: 50 max_prefix_threshold: 50
route_map_in: 'rm_in' route_map_in: 'rm_in'
route_map_out: 'rm_out' route_map_out: 'rm_out'
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -153,6 +159,7 @@
max_prefix_threshold: default max_prefix_threshold: default
route_map_in: default route_map_in: default
route_map_out: default route_map_out: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -182,6 +189,7 @@
vrf: 'blue' vrf: 'blue'
neighbor: '192.0.2.3' neighbor: '192.0.2.3'
remote_as: 2 remote_as: 2
provider: "{{ connection }}"
- name: "Configure BGP neighbor 3" - name: "Configure BGP neighbor 3"
nxos_bgp_neighbor_af: &configure3 nxos_bgp_neighbor_af: &configure3
@ -196,6 +204,7 @@
send_community: 'standard' send_community: 'standard'
soft_reconfiguration_in: "{{soft_reconfiguration_ina|default(omit)}}" soft_reconfiguration_in: "{{soft_reconfiguration_ina|default(omit)}}"
soo: '3:3' soo: '3:3'
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -219,6 +228,7 @@
as_override: False as_override: False
send_community: default send_community: default
soo: default soo: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -233,6 +243,7 @@
- name: "Setup: Remove BGP config" - name: "Setup: Remove BGP config"
nxos_bgp: &remove nxos_bgp: &remove
asn: 65535 asn: 65535
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -243,6 +254,7 @@
asn: 65535 asn: 65535
neighbor: '192.0.2.2' neighbor: '192.0.2.2'
remote_as: 65535 remote_as: 65535
provider: "{{ connection }}"
- name: "Configure BGP neighbor 4" - name: "Configure BGP neighbor 4"
nxos_bgp_neighbor_af: &configure4 nxos_bgp_neighbor_af: &configure4
@ -251,6 +263,7 @@
afi: ipv4 afi: ipv4
safi: unicast safi: unicast
route_reflector_client: 'true' route_reflector_client: 'true'
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -268,6 +281,7 @@
afi: ipv4 afi: ipv4
safi: unicast safi: unicast
route_reflector_client: False route_reflector_client: False
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true

View file

@ -8,6 +8,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.state foo up" - "result[1].TABLE_interface.ROW_interface.state foo up"
provider: "{{ connection }}"
register: result register: result
ignore_errors: yes ignore_errors: yes

View file

@ -9,6 +9,7 @@
wait_for: wait_for:
- "result[0] contains NX-OS" - "result[0] contains NX-OS"
- "result[1].TABLE_interface.ROW_interface.interface contains mgmt" - "result[1].TABLE_interface.ROW_interface.interface contains mgmt"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -8,6 +8,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.state eq up" - "result[1].TABLE_interface.ROW_interface.state eq up"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -21,6 +22,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.state == up" - "result[1].TABLE_interface.ROW_interface.state == up"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -8,6 +8,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask gt 0" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask gt 0"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -21,6 +22,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask > 0" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask > 0"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -8,6 +8,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask ge 0" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask ge 0"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -21,6 +22,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask >= 0" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask >= 0"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -4,6 +4,7 @@
- name: run invalid command - name: run invalid command
nxos_command: nxos_command:
commands: ['show foo'] commands: ['show foo']
provider: "{{ connection }}"
register: result register: result
ignore_errors: yes ignore_errors: yes
@ -16,6 +17,7 @@
commands: commands:
- show version - show version
- show foo - show foo
provider: "{{ connection }}"
register: result register: result
ignore_errors: yes ignore_errors: yes

View file

@ -8,6 +8,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask lt 33" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask lt 33"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -21,6 +22,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask lt 33" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask lt 33"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -8,6 +8,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask le 32" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask le 32"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -21,6 +22,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.eth_ip_mask <= 32" - "result[1].TABLE_interface.ROW_interface.eth_ip_mask <= 32"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -8,6 +8,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.state neq down" - "result[1].TABLE_interface.ROW_interface.state neq down"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -22,6 +23,7 @@
- show interface mgmt0 | json - show interface mgmt0 | json
wait_for: wait_for:
- "result[1].TABLE_interface.ROW_interface.state != down" - "result[1].TABLE_interface.ROW_interface.state != down"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -4,6 +4,7 @@
- name: get output for single command - name: get output for single command
nxos_command: nxos_command:
commands: ['show version'] commands: ['show version']
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -15,6 +16,7 @@
commands: commands:
- show version - show version
- show interface - show interface
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -7,6 +7,7 @@
- show version - show version
wait_for: wait_for:
- "result[0] contains bad_value_string" - "result[0] contains bad_value_string"
provider: "{{ connection }}"
register: result register: result
ignore_errors: yes ignore_errors: yes

View file

@ -4,6 +4,7 @@
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
- block: - block:
@ -21,12 +22,14 @@
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
- name: "Configure BGP defaults" - name: "Configure BGP defaults"
nxos_bgp: &configure_default nxos_bgp: &configure_default
asn: 65535 asn: 65535
router_id: 192.0.2.1 router_id: 192.0.2.1
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -61,6 +64,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
- debug: msg="END nxapi/sanity.yaml on connection={{ ansible_connection }}" - debug: msg="END nxapi/sanity.yaml on connection={{ ansible_connection }}"

View file

@ -12,6 +12,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
- name: collect any backup files - name: collect any backup files
find: &backups find: &backups
@ -34,6 +35,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
backup: yes backup: yes
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -12,6 +12,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
- name: configure device with defaults included - name: configure device with defaults included
nxos_config: nxos_config:
@ -21,6 +22,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
defaults: yes defaults: yes
provider: "{{ connection }}"
register: result register: result
- debug: var=result - debug: var=result
@ -38,6 +40,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
defaults: yes defaults: yes
provider: "{{ connection }}"
register: result register: result
- debug: var=result - debug: var=result

View file

@ -5,6 +5,7 @@
nxos_config: nxos_config:
lines: ip access-list test lines: ip access-list test
match: none match: none
provider: "{{ connection }}"
- name: "nxos_config sanity test" - name: "nxos_config sanity test"
nxos_config: nxos_config:
@ -17,6 +18,7 @@
parents: ip access-list test parents: ip access-list test
before: no ip access-list test before: no ip access-list test
match: exact match: exact
provider: "{{ connection }}"
- name: "nxos_config sanity test - replace block" - name: "nxos_config sanity test - replace block"
nxos_config: nxos_config:
@ -28,10 +30,12 @@
parents: ip access-list test parents: ip access-list test
before: no ip access-list test before: no ip access-list test
replace: block replace: block
provider: "{{ connection }}"
- name: teardown - name: teardown
nxos_config: nxos_config:
lines: no ip access-list test lines: no ip access-list test
match: none match: none
provider: "{{ connection }}"
- debug: msg="END common/sanity.yaml on connection={{ ansible_connection }}" - debug: msg="END common/sanity.yaml on connection={{ ansible_connection }}"

View file

@ -12,11 +12,13 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
- name: save config - name: save config
nxos_config: nxos_config:
save_when: always save_when: always
timeout: 300 timeout: 300
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -27,6 +29,7 @@
nxos_config: nxos_config:
save_when: always save_when: always
timeout: 300 timeout: 300
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -12,6 +12,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
- name: configure device with config - name: configure device with config
nxos_config: nxos_config:
@ -21,6 +22,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
defaults: yes defaults: yes
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -37,6 +39,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
defaults: yes defaults: yes
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -6,6 +6,7 @@
- name: configure with invalid src - name: configure with invalid src
nxos_config: nxos_config:
src: basic/foobar.j2 src: basic/foobar.j2
provider: "{{ connection }}"
register: result register: result
ignore_errors: yes ignore_errors: yes

View file

@ -12,6 +12,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
- name: configure device with config - name: configure device with config
nxos_config: nxos_config:
@ -22,6 +23,7 @@
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
defaults: yes defaults: yes
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -38,6 +40,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
defaults: yes defaults: yes
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -5,6 +5,7 @@
nxos_config: &clear nxos_config: &clear
lines: no ip access-list test lines: no ip access-list test
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: configure sub level command using block replace - name: configure sub level command using block replace
@ -16,6 +17,7 @@
- 40 permit ip 192.0.2.4/32 any log - 40 permit ip 192.0.2.4/32 any log
parents: ip access-list test parents: ip access-list test
replace: block replace: block
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -36,6 +38,7 @@
- 40 permit ip 192.0.2.4/32 any log - 40 permit ip 192.0.2.4/32 any log
parents: ip access-list test parents: ip access-list test
replace: block replace: block
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -5,10 +5,12 @@
nxos_config: nxos_config:
lines: hostname switch lines: hostname switch
match: none match: none
provider: "{{ connection }}"
- name: configure top level command - name: configure top level command
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -19,6 +21,7 @@
- name: configure top level command idempotent check - name: configure top level command idempotent check
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -29,5 +32,6 @@
nxos_config: nxos_config:
lines: hostname switch lines: hostname switch
match: none match: none
provider: "{{ connection }}"
- debug: msg='END common/toplevel.yaml on connection={{ ansible_connection }}' - debug: msg='END common/toplevel.yaml on connection={{ ansible_connection }}'

View file

@ -5,11 +5,13 @@
nxos_config: nxos_config:
lines: hostname switch lines: hostname switch
match: none match: none
provider: "{{ connection }}"
- name: configure top level command - name: configure top level command
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
match: strict match: strict
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -21,6 +23,7 @@
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
match: strict match: strict
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -31,5 +34,6 @@
nxos_config: nxos_config:
lines: hostname switch lines: hostname switch
match: none match: none
provider: "{{ connection }}"
- debug: msg="END common/nonidempotent.yaml on connection={{ ansible_connection }}" - debug: msg="END common/nonidempotent.yaml on connection={{ ansible_connection }}"

View file

@ -5,6 +5,7 @@
nxos_config: nxos_config:
lines: feature bgp lines: feature bgp
match: none match: none
provider: "{{ connection }}"
- name: configure multi level command - name: configure multi level command
nxos_config: nxos_config:
@ -12,6 +13,7 @@
parents: parents:
- router bgp 1 - router bgp 1
- address-family ipv4 unicast - address-family ipv4 unicast
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -27,6 +29,7 @@
parents: parents:
- router bgp 1 - router bgp 1
- address-family ipv4 unicast - address-family ipv4 unicast
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -37,5 +40,6 @@
nxos_config: nxos_config:
lines: no feature bgp lines: no feature bgp
match: none match: none
provider: "{{ connection }}"
- debug: msg="END nxapi/mulitlevel.yaml" - debug: msg="END nxapi/mulitlevel.yaml"

View file

@ -5,12 +5,14 @@
nxos_config: nxos_config:
lines: no ip access-list test lines: no ip access-list test
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: configure sub level command - name: configure sub level command
nxos_config: nxos_config:
lines: 10 permit ip any any log lines: 10 permit ip any any log
parents: ip access-list test parents: ip access-list test
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -23,6 +25,7 @@
nxos_config: nxos_config:
lines: 10 permit ip any any log lines: 10 permit ip any any log
parents: ip access-list test parents: ip access-list test
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -33,5 +36,6 @@
nxos_config: nxos_config:
lines: no ip access-list test lines: no ip access-list test
match: none match: none
provider: "{{ connection }}"
- debug: msg="END nxapi/sublevel.yaml" - debug: msg="END nxapi/sublevel.yaml"

View file

@ -11,6 +11,7 @@
- 50 permit ip 192.0.2.5/32 any log - 50 permit ip 192.0.2.5/32 any log
parents: ip access-list test parents: ip access-list test
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: configure sub level command using exact match - name: configure sub level command using exact match
@ -24,6 +25,7 @@
before: no ip access-list test before: no ip access-list test
match: exact match: exact
replace: block replace: block
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -45,6 +47,7 @@
- 40 permit ip 192.0.2.4/32 any log - 40 permit ip 192.0.2.4/32 any log
parents: ip access-list test parents: ip access-list test
match: exact match: exact
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -55,5 +58,6 @@
nxos_config: nxos_config:
lines: no ip access-list test lines: no ip access-list test
match: none match: none
provider: "{{ connection }}"
- debug: msg="END nxapi/sublevel_exact.yaml" - debug: msg="END nxapi/sublevel_exact.yaml"

View file

@ -11,6 +11,7 @@
- 50 permit ip 192.0.2.5/32 any log - 50 permit ip 192.0.2.5/32 any log
parents: ip access-list test parents: ip access-list test
match: none match: none
provider: "{{ connection }}"
- name: configure sub level command using strict match - name: configure sub level command using strict match
nxos_config: nxos_config:
@ -23,6 +24,7 @@
before: no ip access-list test before: no ip access-list test
match: strict match: strict
replace: block replace: block
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -44,6 +46,7 @@
- 40 permit ip 192.0.2.4/32 any log - 40 permit ip 192.0.2.4/32 any log
parents: ip access-list test parents: ip access-list test
match: strict match: strict
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -54,5 +57,6 @@
nxos_config: nxos_config:
lines: no ip access-list test lines: no ip access-list test
match: none match: none
provider: "{{ connection }}"
- debug: msg="END nxapi/sublevel_strict.yaml" - debug: msg="END nxapi/sublevel_strict.yaml"

View file

@ -6,12 +6,14 @@
lines: lines:
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname switch" - "hostname switch"
provider: "{{ connection }}"
match: none match: none
- name: configure top level command with before - name: configure top level command with before
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
after: snmp-server contact bar after: snmp-server contact bar
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -24,6 +26,7 @@
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
after: snmp-server contact foo after: snmp-server contact foo
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -36,5 +39,6 @@
- "no snmp-server contact ansible" - "no snmp-server contact ansible"
- "hostname switch" - "hostname switch"
match: none match: none
provider: "{{ connection }}"
- debug: msg="END nxapi/toplevel_after.yaml" - debug: msg="END nxapi/toplevel_after.yaml"

View file

@ -7,11 +7,13 @@
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname switch" - "hostname switch"
match: none match: none
provider: "{{ connection }}"
- name: configure top level command with before - name: configure top level command with before
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
before: snmp-server contact bar before: snmp-server contact bar
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -24,6 +26,7 @@
nxos_config: nxos_config:
lines: hostname foo lines: hostname foo
before: snmp-server contact foo before: snmp-server contact foo
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -36,5 +39,6 @@
- "no snmp-server contact ansible" - "no snmp-server contact ansible"
- "hostname switch" - "hostname switch"
match: none match: none
provider: "{{ connection }}"
- debug: msg="END nxapi/toplevel_before.yaml" - debug: msg="END nxapi/toplevel_before.yaml"

View file

@ -12,6 +12,7 @@
- name: "Disable feature nv overlay" - name: "Disable feature nv overlay"
nxos_feature: &disable_feature_nv_overlay nxos_feature: &disable_feature_nv_overlay
feature: nv overlay feature: nv overlay
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
@ -19,6 +20,7 @@
- name: "Enable feature nv overlay" - name: "Enable feature nv overlay"
nxos_feature: &enable_feature_nv_overlay nxos_feature: &enable_feature_nv_overlay
feature: nv overlay feature: nv overlay
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes

View file

@ -7,18 +7,21 @@
nxos_config: &remove_evpn nxos_config: &remove_evpn
lines: no nv overlay evpn lines: no nv overlay evpn
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- block: - block:
- name: "Enable feature BGP" - name: "Enable feature BGP"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
- name: "Enable nv overlay evpn" - name: "Enable nv overlay evpn"
nxos_config: nxos_config:
lines: nv overlay evpn lines: nv overlay evpn
match: none match: none
provider: "{{ connection }}"
- name: "Configure nxos_evpn_vni" - name: "Configure nxos_evpn_vni"
nxos_evpn_vni: &evpn_vni nxos_evpn_vni: &evpn_vni
@ -32,6 +35,7 @@
- auto - auto
- "5000:10" - "5000:10"
- "192.0.2.1:43" - "192.0.2.1:43"
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -52,6 +56,7 @@
route_distinguisher: "50:20" route_distinguisher: "50:20"
route_target_import: auto route_target_import: auto
route_target_export: auto route_target_export: auto
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -68,6 +73,7 @@
route_distinguisher: default route_distinguisher: default
route_target_import: default route_target_import: default
route_target_export: default route_target_export: default
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -81,6 +87,7 @@
- name: "remove nxos_evpn_vni" - name: "remove nxos_evpn_vni"
nxos_evpn_vni: &rvni nxos_evpn_vni: &rvni
vni: 6000 vni: 6000
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -102,6 +109,7 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -9,6 +9,7 @@
gather_subset: gather_subset:
- all - all
timeout: 60 timeout: 60
provider: "{{ connection }}"
register: result register: result

View file

@ -6,6 +6,7 @@
- name: test getting default facts - name: test getting default facts
nxos_facts: nxos_facts:
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -8,6 +8,7 @@
nxos_facts: nxos_facts:
gather_subset: gather_subset:
- "foobar" - "foobar"
provider: "{{ connection }}"
register: result register: result
ignore_errors: true ignore_errors: true
@ -30,6 +31,7 @@
gather_subset: gather_subset:
- "!hardware" - "!hardware"
- "hardware" - "hardware"
provider: "{{ connection }}"
register: result register: result
ignore_errors: true ignore_errors: true

View file

@ -9,6 +9,7 @@
gather_subset: gather_subset:
- "!hardware" - "!hardware"
timeout: 30 timeout: 30
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -6,6 +6,7 @@
- name: "nxos_facts gather hardware facts" - name: "nxos_facts gather hardware facts"
nxos_facts: nxos_facts:
gather_subset: hardware gather_subset: hardware
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -30,6 +31,7 @@
- name: "nxos_facts gather config facts" - name: "nxos_facts gather config facts"
nxos_facts: nxos_facts:
gather_subset: config gather_subset: config
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -52,6 +54,7 @@
gather_subset: gather_subset:
- hardware - hardware
- config - config
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -5,10 +5,12 @@
nxos_config: nxos_config:
lines: no feature bgp lines: no feature bgp
match: none match: none
provider: "{{ connection }}"
- name: enable bgp - name: enable bgp
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
register: result register: result
@ -19,6 +21,7 @@
- name: verify bgp - name: verify bgp
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: enabled state: enabled
register: result register: result
@ -29,6 +32,7 @@
- name: disable bgp - name: disable bgp
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
register: result register: result
@ -39,6 +43,7 @@
- name: verify bgp - name: verify bgp
nxos_feature: nxos_feature:
feature: bgp feature: bgp
provider: "{{ connection }}"
state: disabled state: disabled
register: result register: result
@ -50,5 +55,6 @@
nxos_config: nxos_config:
lines: no feature bgp lines: no feature bgp
match: none match: none
provider: "{{ connection }}"
- debug: msg="END connection={{ ansible_connection }}/configure.yaml" - debug: msg="END connection={{ ansible_connection }}/configure.yaml"

View file

@ -4,6 +4,7 @@
- name: configure invalid feature name - name: configure invalid feature name
nxos_feature: nxos_feature:
feature: invalid feature: invalid
provider: "{{ connection }}"
register: result register: result
ignore_errors: yes ignore_errors: yes

View file

@ -6,18 +6,21 @@
- name: "Setup - Remove maintenace mode profiles" - name: "Setup - Remove maintenace mode profiles"
nxos_gir_profile_management: &remove_maintenance nxos_gir_profile_management: &remove_maintenance
mode: maintenance mode: maintenance
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
- name: "Setup - Remove normal mode profiles" - name: "Setup - Remove normal mode profiles"
nxos_gir_profile_management: &remove_normal nxos_gir_profile_management: &remove_normal
mode: normal mode: normal
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
- name: "Setup - Turn on feature eigrp" - name: "Setup - Turn on feature eigrp"
nxos_feature: nxos_feature:
feature: eigrp feature: eigrp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -28,6 +31,7 @@
commands: commands:
- router eigrp 11 - router eigrp 11
- isolate - isolate
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -49,6 +53,7 @@
commands: commands:
- router eigrp 11 - router eigrp 11
- isolate - isolate
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -101,6 +106,7 @@
- name: "Turn off feature eigrp" - name: "Turn off feature eigrp"
nxos_feature: nxos_feature:
feature: eigrp feature: eigrp
provider: "{{ connection }}"
state: disabled state: disabled
- debug: msg="END connection={{ ansible_connection }} nxos_gir_profile_management sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_gir_profile_management sanity test"

View file

@ -11,6 +11,7 @@
- name: "Enable feature hsrp" - name: "Enable feature hsrp"
nxos_feature: nxos_feature:
feature: hsrp feature: hsrp
provider: "{{ connection }}"
state: enabled state: enabled
- name: "change int1 mode" - name: "change int1 mode"
@ -20,6 +21,7 @@
parents: parents:
- "interface {{ intname1 }}" - "interface {{ intname1 }}"
match: none match: none
provider: "{{ connection }}"
- name: "change int2 mode" - name: "change int2 mode"
nxos_config: nxos_config:
@ -28,6 +30,7 @@
parents: parents:
- "interface {{ intname2 }}" - "interface {{ intname2 }}"
match: none match: none
provider: "{{ connection }}"
- name: "configure nxos_hsrp" - name: "configure nxos_hsrp"
nxos_hsrp: &conf1000 nxos_hsrp: &conf1000
@ -39,6 +42,7 @@
preempt: enabled preempt: enabled
auth_type: md5 auth_type: md5
auth_string: "7 1234" auth_string: "7 1234"
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -63,6 +67,7 @@
preempt: enabled preempt: enabled
auth_type: md5 auth_type: md5
auth_string: "0 1234" auth_string: "0 1234"
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -83,6 +88,7 @@
preempt: disabled preempt: disabled
auth_type: md5 auth_type: md5
auth_string: "0 1234" auth_string: "0 1234"
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -101,6 +107,7 @@
interface: "{{ intname2 }}" interface: "{{ intname2 }}"
auth_type: text auth_type: text
auth_string: "1234" auth_string: "1234"
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -119,6 +126,7 @@
interface: "{{ intname2 }}" interface: "{{ intname2 }}"
auth_type: text auth_type: text
auth_string: default auth_string: default
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -133,6 +141,7 @@
nxos_hsrp: &remove nxos_hsrp: &remove
group: 1000 group: 1000
interface: "{{ intname1 }}" interface: "{{ intname1 }}"
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -148,6 +157,7 @@
- name: "Disable feature hsrp" - name: "Disable feature hsrp"
nxos_feature: nxos_feature:
feature: hsrp feature: hsrp
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -13,6 +13,7 @@
flush_routes: true flush_routes: true
enforce_rtr_alert: true enforce_rtr_alert: true
restart: false restart: false
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -33,6 +34,7 @@
flush_routes: false flush_routes: false
enforce_rtr_alert: false enforce_rtr_alert: false
restart: "{{restart|default(omit)}}" restart: "{{restart|default(omit)}}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -50,6 +52,7 @@
- name: Configure igmp state as values - name: Configure igmp state as values
nxos_igmp: &sdefault nxos_igmp: &sdefault
provider: "{{ connection }}"
state: default state: default
register: result register: result

View file

@ -12,6 +12,7 @@
- name: "Enable feature PIM" - name: "Enable feature PIM"
nxos_feature: nxos_feature:
feature: pim feature: pim
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -20,6 +21,7 @@
commands: commands:
- "default interface {{ intname }}" - "default interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- block: - block:
@ -32,6 +34,7 @@
parents: parents:
- "interface {{ intname }}" - "interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
- name: Configure igmp interface with non-default values - name: Configure igmp interface with non-default values
nxos_igmp_interface: &non-default nxos_igmp_interface: &non-default
@ -51,6 +54,7 @@
# deprecated # deprecated
oif_prefix: 239.255.255.2 oif_prefix: 239.255.255.2
oif_source: 192.0.2.1 oif_source: 192.0.2.1
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -83,6 +87,7 @@
- {'prefix': '238.2.2.6'} - {'prefix': '238.2.2.6'}
- {'prefix': '238.2.2.5'} - {'prefix': '238.2.2.5'}
- {'source': '192.0.2.1', 'prefix': '238.2.2.5'} - {'source': '192.0.2.1', 'prefix': '238.2.2.5'}
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -98,11 +103,13 @@
nxos_igmp_interface: &restart nxos_igmp_interface: &restart
interface: "{{ intname }}" interface: "{{ intname }}"
restart: "{{restart|default(omit)}}" restart: "{{restart|default(omit)}}"
provider: "{{ connection }}"
- name: Configure igmp interface with default oif_ps - name: Configure igmp interface with default oif_ps
nxos_igmp_interface: &defoif nxos_igmp_interface: &defoif
interface: "{{ intname }}" interface: "{{ intname }}"
oif_ps: default oif_ps: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -122,6 +129,7 @@
startup_query_count: 5 startup_query_count: 5
robustness: 6 robustness: 6
oif_routemap: abcd oif_routemap: abcd
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -136,6 +144,7 @@
- name: Configure igmp interface with default state - name: Configure igmp interface with default state
nxos_igmp_interface: &default nxos_igmp_interface: &default
interface: "{{ intname }}" interface: "{{ intname }}"
provider: "{{ connection }}"
state: default state: default
register: result register: result
@ -150,6 +159,7 @@
- name: Configure igmp interface with absent state - name: Configure igmp interface with absent state
nxos_igmp_interface: &absent nxos_igmp_interface: &absent
interface: "{{ intname }}" interface: "{{ intname }}"
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -171,10 +181,12 @@
commands: commands:
- "default interface {{ intname }}" - "default interface {{ intname }}"
match: none match: none
provider: "{{ connection }}"
- name: "Disable feature PIM" - name: "Disable feature PIM"
nxos_feature: nxos_feature:
feature: pim feature: pim
provider: "{{ connection }}"
state: disabled state: disabled
- debug: msg="END connection={{ ansible_connection }} nxos_igmp_interface sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_igmp_interface sanity test"

View file

@ -22,6 +22,7 @@
link_local_grp_supp: false link_local_grp_supp: false
report_supp: false report_supp: false
v3_report_supp: true v3_report_supp: true
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -41,6 +42,7 @@
- name: Configure igmp snooping with default group timeout - name: Configure igmp snooping with default group timeout
nxos_igmp_snooping: &defgt nxos_igmp_snooping: &defgt
group_timeout: "{{def_group_timeout|default(omit)}}" group_timeout: "{{def_group_timeout|default(omit)}}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -57,6 +59,7 @@
- name: Configure igmp snooping with default values - name: Configure igmp snooping with default values
nxos_igmp_snooping: &default nxos_igmp_snooping: &default
provider: "{{ connection }}"
state: default state: default
register: result register: result

View file

@ -10,6 +10,7 @@
lines: lines:
- "default interface {{ testint1 }}" - "default interface {{ testint1 }}"
- "default interface {{ testint2 }}" - "default interface {{ testint2 }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: Check intent arguments - name: Check intent arguments
@ -18,6 +19,7 @@
admin_state: up admin_state: up
tx_rate: ge(0) tx_rate: ge(0)
rx_rate: ge(0) rx_rate: ge(0)
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -30,6 +32,7 @@
admin_state: down admin_state: down
tx_rate: gt(0) tx_rate: gt(0)
rx_rate: lt(0) rx_rate: lt(0)
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
register: result register: result
@ -44,6 +47,7 @@
aggregate: aggregate:
- { name: "{{ testint1 }}", description: "Test aggregation on first interface" } - { name: "{{ testint1 }}", description: "Test aggregation on first interface" }
- { name: "{{ testint2 }}", mode: layer3 } - { name: "{{ testint2 }}", mode: layer3 }
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -55,6 +59,7 @@
lines: lines:
- "default interface {{ testint1 }}" - "default interface {{ testint1 }}"
- "default interface {{ testint2 }}" - "default interface {{ testint2 }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_interface intent test" - debug: msg="END connection={{ ansible_connection }} nxos_interface intent test"

View file

@ -8,6 +8,7 @@
- name: "Setup: Enable feature interface-vlan" - name: "Setup: Enable feature interface-vlan"
nxos_feature: nxos_feature:
feature: interface-vlan feature: interface-vlan
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -15,6 +16,7 @@
nxos_config: &intcleanup nxos_config: &intcleanup
lines: lines:
- "default interface {{ testint }}" - "default interface {{ testint }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: "Setup: Remove possibly existing vlan interfaces" - name: "Setup: Remove possibly existing vlan interfaces"
@ -24,6 +26,7 @@
- "no interface vlan 710" - "no interface vlan 710"
- "no interface vlan 711" - "no interface vlan 711"
- "no interface vlan 712" - "no interface vlan 712"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- block: - block:
@ -33,6 +36,7 @@
mode: layer3 mode: layer3
description: 'Configured by Ansible - Layer3' description: 'Configured by Ansible - Layer3'
admin_state: up admin_state: up
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -54,6 +58,7 @@
mode: layer2 mode: layer2
description: 'Configured by Ansible - Layer2' description: 'Configured by Ansible - Layer2'
admin_state: down admin_state: down
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -69,6 +74,7 @@
nxos_interface: &createvlans nxos_interface: &createvlans
interface: "{{ item.os_svi_int }}" interface: "{{ item.os_svi_int }}"
description: "{{ item.os_svi_desc }}" description: "{{ item.os_svi_desc }}"
provider: "{{ connection }}"
with_items: &vlanitems with_items: &vlanitems
- {os_svi_int: vlan2, os_svi_desc: SVI_VLAN2} - {os_svi_int: vlan2, os_svi_desc: SVI_VLAN2}
- {os_svi_int: vlan710, os_svi_desc: SVI_VLAN710} - {os_svi_int: vlan710, os_svi_desc: SVI_VLAN710}
@ -84,6 +90,7 @@
addr: "{{ item.ipv4_addr }}" addr: "{{ item.ipv4_addr }}"
mask: "{{ item.ipv4_mask }}" mask: "{{ item.ipv4_mask }}"
version: "{{ item.ipv4_ver }}" version: "{{ item.ipv4_ver }}"
provider: "{{ connection }}"
with_items: &vlanips with_items: &vlanips
- {os_svi_int: vlan2, ipv4_addr: 192.168.2.1, ipv4_mask: 24, ipv4_ver: v4} - {os_svi_int: vlan2, ipv4_addr: 192.168.2.1, ipv4_mask: 24, ipv4_ver: v4}
- {os_svi_int: vlan710, ipv4_addr: 192.168.3.1, ipv4_mask: 24, ipv4_ver: v4} - {os_svi_int: vlan710, ipv4_addr: 192.168.3.1, ipv4_mask: 24, ipv4_ver: v4}
@ -118,6 +125,7 @@
- name: "Setup: Disable feature interface-vlan" - name: "Setup: Disable feature interface-vlan"
nxos_feature: nxos_feature:
feature: interface-vlan feature: interface-vlan
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -7,10 +7,12 @@
nxos_config: nxos_config:
lines: lines:
- interface Loopback1 - interface Loopback1
provider: "{{ connection }}"
- name: set state=absent - name: set state=absent
nxos_interface: nxos_interface:
interface: Loopback1 interface: Loopback1
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -21,6 +23,7 @@
- name: verify state=absent - name: verify state=absent
nxos_interface: nxos_interface:
interface: Loopback1 interface: Loopback1
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -7,11 +7,13 @@
nxos_config: nxos_config:
lines: lines:
- no interface Loopback1 - no interface Loopback1
provider: "{{ connection }}"
ignore_errors: yes # Fails if the interface is already absent ignore_errors: yes # Fails if the interface is already absent
- name: set state=present - name: set state=present
nxos_interface: nxos_interface:
interface: Loopback1 interface: Loopback1
provider: "{{ connection }}"
state: present state: present
description: 'Configured by Ansible - Layer3' description: 'Configured by Ansible - Layer3'
register: result register: result
@ -23,6 +25,7 @@
- name: verify state=present - name: verify state=present
nxos_interface: nxos_interface:
interface: Loopback1 interface: Loopback1
provider: "{{ connection }}"
state: present state: present
description: 'Configured by Ansible - Layer3' description: 'Configured by Ansible - Layer3'
register: result register: result

View file

@ -8,6 +8,7 @@
- name: Setup - delete sub-interface - name: Setup - delete sub-interface
nxos_interface: &rm nxos_interface: &rm
name: "{{ testint }}.20" name: "{{ testint }}.20"
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -15,6 +16,7 @@
nxos_interface: nxos_interface:
name: "{{ testint }}" name: "{{ testint }}"
mode: layer3 mode: layer3
provider: "{{ connection }}"
- name: Create sub-interface - name: Create sub-interface
nxos_interface: &sub_int nxos_interface: &sub_int
@ -22,6 +24,7 @@
description: "sub-interface Configured by Ansible" description: "sub-interface Configured by Ansible"
admin_state: up admin_state: up
mtu: 800 mtu: 800
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -42,6 +45,7 @@
description: "sub-interface Configured by Ansible" description: "sub-interface Configured by Ansible"
admin_state: down admin_state: down
mtu: 800 mtu: 800
provider: "{{ connection }}"
register: result register: result
- assert: - assert:

View file

@ -8,12 +8,14 @@
- name: "Setup - Disable feature OSPF" - name: "Setup - Disable feature OSPF"
nxos_feature: &disable nxos_feature: &disable
feature: ospf feature: ospf
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
- name: "Setup - Enable feature OSPF" - name: "Setup - Enable feature OSPF"
nxos_feature: &enable nxos_feature: &enable
feature: ospf feature: ospf
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -21,6 +23,7 @@
nxos_config: &intdefault nxos_config: &intdefault
lines: lines:
- "default interface {{ testint }}" - "default interface {{ testint }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: "Remove switchport config" - name: "Remove switchport config"
@ -29,6 +32,7 @@
- no switchport - no switchport
parents: parents:
- "interface {{ testint }}" - "interface {{ testint }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: "Remove possibly existing port-channel and loopback ints" - name: "Remove possibly existing port-channel and loopback ints"
@ -38,6 +42,7 @@
- no interface port-channel11 - no interface port-channel11
- no interface loopback55 - no interface loopback55
- no interface loopback77 - no interface loopback77
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- block: - block:
@ -50,6 +55,7 @@
passive_interface: true passive_interface: true
hello_interval: 15 hello_interval: 15
dead_interval: 75 dead_interval: 75
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -74,6 +80,7 @@
passive_interface: false passive_interface: false
hello_interval: 17 hello_interval: 17
dead_interval: 70 dead_interval: 70
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -93,6 +100,7 @@
cost: default cost: default
hello_interval: 10 hello_interval: 10
dead_interval: default dead_interval: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -114,6 +122,7 @@
message_digest_algorithm_type: md5 message_digest_algorithm_type: md5
message_digest_encryption_type: 3des message_digest_encryption_type: 3des
message_digest_password: b69f7bc54725b1bfd1ea93afa7b09400 message_digest_password: b69f7bc54725b1bfd1ea93afa7b09400
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -135,6 +144,7 @@
message_digest_algorithm_type: default message_digest_algorithm_type: default
message_digest_encryption_type: default message_digest_encryption_type: default
message_digest_password: default message_digest_password: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -154,6 +164,7 @@
- interface loopback55 - interface loopback55
- interface loopback77 - interface loopback77
match: none match: none
provider: "{{ connection }}"
- name: "Ensure port-channels are layer3" - name: "Ensure port-channels are layer3"
nxos_config: nxos_config:
@ -161,6 +172,7 @@
- no switchport - no switchport
parents: parents:
- "interface {{ item }}" - "interface {{ item }}"
provider: "{{ connection }}"
with_items: with_items:
- port-channel10 - port-channel10
- port-channel11 - port-channel11
@ -174,6 +186,7 @@
passive_interface: true passive_interface: true
hello_interval: 15 hello_interval: 15
dead_interval: 75 dead_interval: 75
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -194,6 +207,7 @@
passive_interface: true passive_interface: true
hello_interval: 15 hello_interval: 15
dead_interval: 75 dead_interval: 75
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -213,6 +227,7 @@
cost: 55 cost: 55
hello_interval: 15 hello_interval: 15
dead_interval: 75 dead_interval: 75
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -232,6 +247,7 @@
cost: 77 cost: 77
hello_interval: 45 hello_interval: 45
dead_interval: 75 dead_interval: 75
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -252,6 +268,7 @@
passive_interface: true passive_interface: true
hello_interval: 15 hello_interval: 15
dead_interval: 75 dead_interval: 75
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -24,6 +24,7 @@
mode: layer3 mode: layer3
description: 'Configured by Ansible - Layer3' description: 'Configured by Ansible - Layer3'
admin_state: 'up' admin_state: 'up'
provider: "{{ connection }}"
state: present state: present
- name: "Make {{testint2}} a layer3 interface" - name: "Make {{testint2}} a layer3 interface"
@ -32,6 +33,7 @@
mode: layer3 mode: layer3
description: 'Configured by Ansible - Layer3' description: 'Configured by Ansible - Layer3'
admin_state: 'up' admin_state: 'up'
provider: "{{ connection }}"
state: present state: present
# For titanium # For titanium
@ -39,6 +41,7 @@
nxos_ip_interface: nxos_ip_interface:
interface: "{{ testint1 }}" interface: "{{ testint1 }}"
version: v4 version: v4
provider: "{{ connection }}"
state: absent state: absent
addr: 20.20.20.20 addr: 20.20.20.20
mask: 24 mask: 24
@ -48,6 +51,7 @@
nxos_ip_interface: nxos_ip_interface:
interface: "{{ testint2 }}" interface: "{{ testint2 }}"
version: v6 version: v6
provider: "{{ connection }}"
state: absent state: absent
addr: 'fd56:31f7:e4ad:5585::1' addr: 'fd56:31f7:e4ad:5585::1'
mask: 64 mask: 64
@ -56,6 +60,7 @@
nxos_ip_interface: &ipv4 nxos_ip_interface: &ipv4
interface: "{{ testint1 }}" interface: "{{ testint1 }}"
version: v4 version: v4
provider: "{{ connection }}"
state: present state: present
addr: 20.20.20.20 addr: 20.20.20.20
mask: 24 mask: 24
@ -77,6 +82,7 @@
nxos_ip_interface: &ipv6 nxos_ip_interface: &ipv6
interface: "{{ testint2 }}" interface: "{{ testint2 }}"
version: v6 version: v6
provider: "{{ connection }}"
state: present state: present
addr: 'fd56:31f7:e4ad:5585::1' addr: 'fd56:31f7:e4ad:5585::1'
mask: 64 mask: 64

View file

@ -10,6 +10,7 @@
- name: "Setup vlans" - name: "Setup vlans"
nxos_vlan: nxos_vlan:
vlan_range: "6,15" vlan_range: "6,15"
provider: "{{ connection }}"
- name: Setup - Ensure interfaces are layer2 - name: Setup - Ensure interfaces are layer2
nxos_interface: nxos_interface:
@ -17,12 +18,14 @@
- { name: "{{ intname1 }}" } - { name: "{{ intname1 }}" }
- { name: "{{ intname2 }}" } - { name: "{{ intname2 }}" }
mode: layer2 mode: layer2
provider: "{{ connection }}"
- name: Setup - Remove interface aggregate before testing - name: Setup - Remove interface aggregate before testing
nxos_l2_interface: nxos_l2_interface:
aggregate: aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 } - { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 } - { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
provider: "{{ connection }}"
state: absent state: absent
- name: Sleep for 2 seconds on Fretta Platform - name: Sleep for 2 seconds on Fretta Platform
@ -35,6 +38,7 @@
aggregate: aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 } - { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 } - { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -58,6 +62,7 @@
aggregate: aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 } - { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 } - { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -81,6 +86,7 @@
- name: "remove vlans" - name: "remove vlans"
nxos_vlan: nxos_vlan:
vlan_range: "6,15" vlan_range: "6,15"
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -89,6 +95,7 @@
aggregate: aggregate:
- { name: "{{ intname1 }}", mode: access, access_vlan: 6 } - { name: "{{ intname1 }}", mode: access, access_vlan: 6 }
- { name: "{{ intname2 }}", mode: access, access_vlan: 15 } - { name: "{{ intname2 }}", mode: access, access_vlan: 15 }
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes

View file

@ -13,21 +13,25 @@
nxos_config: &default nxos_config: &default
lines: lines:
- "default interface {{ intname }}" - "default interface {{ intname }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: Setup - Ensure interface is layer2 - name: Setup - Ensure interface is layer2
nxos_interface: nxos_interface:
interface: "{{ intname }}" interface: "{{ intname }}"
mode: layer2 mode: layer2
provider: "{{ connection }}"
- name: "Setup vlans" - name: "Setup vlans"
nxos_vlan: nxos_vlan:
vlan_range: "5-10,20" vlan_range: "5-10,20"
provider: "{{ connection }}"
- block: - block:
- name: Ensure interface is in its default switchport state - name: Ensure interface is in its default switchport state
nxos_l2_interface: &def_swi nxos_l2_interface: &def_swi
name: "{{ intname }}" name: "{{ intname }}"
provider: "{{ connection }}"
state: unconfigured state: unconfigured
- name: Ensure interface is configured for access vlan 20 - name: Ensure interface is configured for access vlan 20
@ -35,6 +39,7 @@
name: "{{ intname }}" name: "{{ intname }}"
mode: access mode: access
access_vlan: 20 access_vlan: 20
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -59,6 +64,7 @@
mode: trunk mode: trunk
native_vlan: 10 native_vlan: 10
trunk_allowed_vlans: 5-10 trunk_allowed_vlans: 5-10
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -75,6 +81,7 @@
mode: trunk mode: trunk
native_vlan: 10 native_vlan: 10
trunk_vlans: 2-50 trunk_vlans: 2-50
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -90,6 +97,7 @@
name: "{{ intname }}" name: "{{ intname }}"
mode: trunk mode: trunk
trunk_vlans: 2-50 trunk_vlans: 2-50
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -118,6 +126,7 @@
name: "{{ intname }}" name: "{{ intname }}"
mode: trunk mode: trunk
trunk_vlans: 30-4094 trunk_vlans: 30-4094
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -145,6 +154,7 @@
- name: "remove vlans" - name: "remove vlans"
nxos_vlan: nxos_vlan:
vlan_range: "5-10,20" vlan_range: "5-10,20"
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes

View file

@ -16,6 +16,7 @@
aggregate: aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 } - { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" } - { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -25,11 +26,13 @@
- name: "{{ testint2 }}" - name: "{{ testint2 }}"
- name: "{{ testint3 }}" - name: "{{ testint3 }}"
mode: layer3 mode: layer3
provider: "{{ connection }}"
- name: Configure ipv4 address to interface - name: Configure ipv4 address to interface
nxos_l3_interface: &conf nxos_l3_interface: &conf
name: "{{ testint2 }}" name: "{{ testint2 }}"
ipv4: 192.168.22.1/24 ipv4: 192.168.22.1/24
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -48,6 +51,7 @@
nxos_l3_interface: &rm nxos_l3_interface: &rm
name: "{{ testint2 }}" name: "{{ testint2 }}"
ipv4: 192.168.22.1/24 ipv4: 192.168.22.1/24
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -68,6 +72,7 @@
aggregate: aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 } - { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" } - { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -87,6 +92,7 @@
aggregate: aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 } - { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" } - { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -9,6 +9,7 @@
- name: "Enable feature LACP" - name: "Enable feature LACP"
nxos_feature: nxos_feature:
feature: lacp feature: lacp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -17,6 +18,7 @@
lines: lines:
- no interface port-channel 20 - no interface port-channel 20
- no interface port-channel 100 - no interface port-channel 100
provider: "{{ connection }}"
- name: setup - remove config used in test(part2) - name: setup - remove config used in test(part2)
nxos_config: nxos_config:
@ -34,11 +36,13 @@
- { name: "{{testint1}}" } - { name: "{{testint1}}" }
- { name: "{{testint2}}" } - { name: "{{testint2}}" }
mode: layer2 mode: layer2
provider: "{{ connection }}"
when: platform is match("N35") when: platform is match("N35")
- name: create linkagg - name: create linkagg
nxos_linkagg: &create nxos_linkagg: &create
group: 20 group: 20
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -63,6 +67,7 @@
members: members:
- "{{ testint1 }}" - "{{ testint1 }}"
- "{{ testint2 }}" - "{{ testint2 }}"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -88,6 +93,7 @@
force: True force: True
members: members:
- "{{ testint2 }}" - "{{ testint2 }}"
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -107,6 +113,7 @@
- name: remove linkagg - name: remove linkagg
nxos_linkagg: &remove nxos_linkagg: &remove
group: 20 group: 20
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -128,6 +135,7 @@
aggregate: aggregate:
- { group: 20, min_links: 3 } - { group: 20, min_links: 3 }
- { group: 100, min_links: 4 } - { group: 100, min_links: 4 }
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -151,6 +159,7 @@
aggregate: aggregate:
- { group: 20, min_links: 3 } - { group: 20, min_links: 3 }
- { group: 100, min_links: 4 } - { group: 100, min_links: 4 }
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -173,12 +182,14 @@
lines: lines:
- no interface port-channel 20 - no interface port-channel 20
- no interface port-channel 100 - no interface port-channel 100
provider: "{{ connection }}"
- name: teardown - remove config used in test(part2) - name: teardown - remove config used in test(part2)
nxos_config: nxos_config:
lines: lines:
- no channel-group 20 - no channel-group 20
parents: "{{ item }}" parents: "{{ item }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
loop: loop:
- "interface {{ testint1 }}" - "interface {{ testint1 }}"
@ -187,6 +198,7 @@
- name: "Disable feature LACP" - name: "Disable feature LACP"
nxos_feature: nxos_feature:
feature: lacp feature: lacp
provider: "{{ connection }}"
state: disabled state: disabled
timeout: 60 timeout: 60

View file

@ -6,10 +6,12 @@
- name: Make sure LLDP is not running before tests - name: Make sure LLDP is not running before tests
nxos_feature: nxos_feature:
feature: lldp feature: lldp
provider: "{{ connection }}"
state: disabled state: disabled
- name: Enable LLDP service - name: Enable LLDP service
nxos_lldp: nxos_lldp:
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -20,6 +22,7 @@
- name: Enable LLDP service again (idempotent) - name: Enable LLDP service again (idempotent)
nxos_lldp: nxos_lldp:
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -29,6 +32,7 @@
- name: Disable LLDP service - name: Disable LLDP service
nxos_lldp: nxos_lldp:
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -39,6 +43,7 @@
- name: Disable LLDP service (idempotent) - name: Disable LLDP service (idempotent)
nxos_lldp: nxos_lldp:
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -7,6 +7,7 @@
nxos_logging: &clog nxos_logging: &clog
dest: console dest: console
dest_level: 0 dest_level: 0
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -28,6 +29,7 @@
dest: logfile dest: logfile
name: test name: test
dest_level: 1 dest_level: 1
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -46,6 +48,7 @@
nxos_logging: &molog nxos_logging: &molog
dest: module dest: module
dest_level: 2 dest_level: 2
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -63,6 +66,7 @@
nxos_logging: &mlog nxos_logging: &mlog
dest: monitor dest: monitor
dest_level: 3 dest_level: 3
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -80,6 +84,7 @@
nxos_logging: &flog nxos_logging: &flog
facility: daemon facility: daemon
facility_level: 4 facility_level: 4
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -101,6 +106,7 @@
- { dest: monitor, dest_level: 3 } - { dest: monitor, dest_level: 3 }
- { dest: logfile, dest_level: 1, name: test } - { dest: logfile, dest_level: 1, name: test }
- { facility: daemon, facility_level: 4 } - { facility: daemon, facility_level: 4 }
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -10,6 +10,7 @@
net_logging: net_logging:
dest: console dest: console
dest_level: 0 dest_level: 0
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -17,6 +18,7 @@
net_logging: net_logging:
dest: console dest: console
dest_level: 0 dest_level: 0
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -29,6 +31,7 @@
net_logging: net_logging:
dest: console dest: console
dest_level: 0 dest_level: 0
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -10,6 +10,7 @@
prefer: disabled prefer: disabled
vrf_name: management vrf_name: management
source_addr: 192.0.2.5 source_addr: 192.0.2.5
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -22,6 +23,7 @@
prefer: enabled prefer: enabled
vrf_name: management vrf_name: management
source_addr: 192.0.2.5 source_addr: 192.0.2.5
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -44,6 +46,7 @@
prefer: enabled prefer: enabled
vrf_name: default vrf_name: default
source_addr: default source_addr: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -72,6 +75,7 @@
source_int: Ethernet1/3 source_int: Ethernet1/3
peer: 1.2.3.4 peer: 1.2.3.4
prefer: enabled prefer: enabled
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -86,6 +90,7 @@
- name: Remove source interface - name: Remove source interface
nxos_ntp: &config3 nxos_ntp: &config3
source_int: default source_int: default
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -7,6 +7,7 @@
nxos_ntp_auth: &setup nxos_ntp_auth: &setup
key_id: 32 key_id: 32
md5string: hello md5string: hello
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -17,6 +18,7 @@
key_id: 32 key_id: 32
md5string: hello md5string: hello
authentication: off authentication: off
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -29,6 +31,7 @@
key_id: 32 key_id: 32
md5string: hello md5string: hello
authentication: off authentication: off
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -39,6 +42,7 @@
key_id: 32 key_id: 32
md5string: hello md5string: hello
auth_type: encrypt auth_type: encrypt
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -55,6 +59,7 @@
- name: Turn on authentication - name: Turn on authentication
nxos_ntp_auth: &authon nxos_ntp_auth: &authon
authentication: on authentication: on
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -69,6 +74,7 @@
- name: Turn off authentication - name: Turn off authentication
nxos_ntp_auth: &authoff nxos_ntp_auth: &authoff
authentication: off authentication: off
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -84,6 +90,7 @@
nxos_ntp_auth: &tkey nxos_ntp_auth: &tkey
key_id: 32 key_id: 32
trusted_key: true trusted_key: true
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -99,6 +106,7 @@
nxos_ntp_auth: &rtkey nxos_ntp_auth: &rtkey
key_id: 32 key_id: 32
trusted_key: false trusted_key: false
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -116,6 +124,7 @@
md5string: hello md5string: hello
auth_type: encrypt auth_type: encrypt
authentication: on authentication: on
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -5,6 +5,7 @@
- name: "Apply default ntp config" - name: "Apply default ntp config"
nxos_ntp_options: &default nxos_ntp_options: &default
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -14,6 +15,7 @@
nxos_ntp_options: &configure_master_default_stratum nxos_ntp_options: &configure_master_default_stratum
master: true master: true
logging: true logging: true
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -33,6 +35,7 @@
nxos_ntp_options: &configure_master_non_default_stratum nxos_ntp_options: &configure_master_non_default_stratum
master: true master: true
stratum: 10 stratum: 10
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -49,6 +52,7 @@
master: true master: true
stratum: 10 stratum: 10
logging: false logging: false
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -64,6 +68,7 @@
nxos_ntp_options: &configure_no_master nxos_ntp_options: &configure_no_master
master: false master: false
logging: true logging: true
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -6,6 +6,7 @@
- name: "Enable feature OSPF" - name: "Enable feature OSPF"
nxos_feature: nxos_feature:
feature: ospf feature: ospf
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -13,6 +14,7 @@
- name: Configure ospf - name: Configure ospf
nxos_ospf: &config nxos_ospf: &config
ospf: 1 ospf: 1
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -32,6 +34,7 @@
- name: "Disable feature OSPF" - name: "Disable feature OSPF"
nxos_feature: nxos_feature:
feature: ospf feature: ospf
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes
@ -39,6 +42,7 @@
- name: Unconfigure ospf - name: Unconfigure ospf
nxos_ospf: &unconfig nxos_ospf: &unconfig
ospf: 1 ospf: 1
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -6,6 +6,7 @@
- name: "Enable feature OSPF" - name: "Enable feature OSPF"
nxos_feature: nxos_feature:
feature: ospf feature: ospf
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -22,6 +23,7 @@
timer_throttle_lsa_max: 3000 timer_throttle_lsa_max: 3000
vrf: test vrf: test
passive_interface: true passive_interface: true
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -47,6 +49,7 @@
log_adjacency: log log_adjacency: log
vrf: default vrf: default
passive_interface: true passive_interface: true
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -67,6 +70,7 @@
timer_throttle_spf_hold: default timer_throttle_spf_hold: default
passive_interface: false passive_interface: false
vrf: default vrf: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -82,6 +86,7 @@
nxos_ospf_vrf: &unconfig1 nxos_ospf_vrf: &unconfig1
ospf: 2 ospf: 2
vrf: default vrf: default
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -97,6 +102,7 @@
nxos_ospf_vrf: &unconfig nxos_ospf_vrf: &unconfig
ospf: 1 ospf: 1
vrf: test vrf: test
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -112,6 +118,7 @@
- name: "Disable feature OSPF" - name: "Disable feature OSPF"
nxos_feature: nxos_feature:
feature: ospf feature: ospf
provider: "{{ connection }}"
state: disabled state: disabled
ignore_errors: yes ignore_errors: yes

View file

@ -16,6 +16,7 @@
- name: "Enable nv overlay evpn" - name: "Enable nv overlay evpn"
nxos_evpn_global: &enable_evpn nxos_evpn_global: &enable_evpn
nv_overlay_evpn: true nv_overlay_evpn: true
provider: "{{ connection }}"
- name: "Apply N7K specific setup config" - name: "Apply N7K specific setup config"
include: targets/nxos_overlay_global/tasks/platform/n7k/setup.yaml include: targets/nxos_overlay_global/tasks/platform/n7k/setup.yaml
@ -27,11 +28,13 @@
- feature-set fabric - feature-set fabric
- feature fabric forwarding - feature fabric forwarding
match: none match: none
provider: "{{ connection }}"
when: platform is match('N7K') when: platform is match('N7K')
- name: "Remove possibly existing mac" - name: "Remove possibly existing mac"
nxos_overlay_global: nxos_overlay_global:
anycast_gateway_mac: "default" anycast_gateway_mac: "default"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
when: overlay_global_supported when: overlay_global_supported
@ -42,6 +45,7 @@
- name: Configure overlay global - name: Configure overlay global
nxos_overlay_global: &configure nxos_overlay_global: &configure
anycast_gateway_mac: "b.b.b" anycast_gateway_mac: "b.b.b"
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -59,6 +63,7 @@
- name: Update anycast gateway mac - name: Update anycast gateway mac
nxos_overlay_global: &update nxos_overlay_global: &update
anycast_gateway_mac: "a.a.a" anycast_gateway_mac: "a.a.a"
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -73,6 +78,7 @@
- name: Remove anycast gateway mac - name: Remove anycast gateway mac
nxos_overlay_global: &remove nxos_overlay_global: &remove
anycast_gateway_mac: "default" anycast_gateway_mac: "default"
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -93,6 +99,7 @@
- name: "Disable nv overlay evpn" - name: "Disable nv overlay evpn"
nxos_evpn_global: &disable_evpn nxos_evpn_global: &disable_evpn
nv_overlay_evpn: false nv_overlay_evpn: false
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
when: overlay_global_supported when: overlay_global_supported

View file

@ -6,16 +6,19 @@
- name: "Setup: Disable feature PIM" - name: "Setup: Disable feature PIM"
nxos_feature: &disable_feature nxos_feature: &disable_feature
feature: pim feature: pim
provider: "{{ connection }}"
state: disabled state: disabled
- name: "Setup: Enable feature PIM" - name: "Setup: Enable feature PIM"
nxos_feature: nxos_feature:
feature: pim feature: pim
provider: "{{ connection }}"
state: enabled state: enabled
- name: "Setup: Configure ssm_range none" - name: "Setup: Configure ssm_range none"
nxos_pim: &none nxos_pim: &none
ssm_range: "none" ssm_range: "none"
provider: "{{ connection }}"
- block: - block:
- name: Configure ssm_range - name: Configure ssm_range
@ -23,6 +26,7 @@
ssm_range: ssm_range:
- "239.128.1.0/24" - "239.128.1.0/24"
- "224.0.0.0/8" - "224.0.0.0/8"
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -40,6 +44,7 @@
- name: Configure ssm_range default - name: Configure ssm_range default
nxos_pim: &conf_default nxos_pim: &conf_default
ssm_range: "default" ssm_range: "default"
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true

View file

@ -6,11 +6,13 @@
- name: "Disable feature PIM" - name: "Disable feature PIM"
nxos_feature: &disable_feature nxos_feature: &disable_feature
feature: pim feature: pim
provider: "{{ connection }}"
state: disabled state: disabled
- name: "Enable feature PIM" - name: "Enable feature PIM"
nxos_feature: nxos_feature:
feature: pim feature: pim
provider: "{{ connection }}"
state: enabled state: enabled
- set_fact: testint="{{ nxos_int1 }}" - set_fact: testint="{{ nxos_int1 }}"
@ -19,6 +21,7 @@
nxos_config: nxos_config:
lines: lines:
- "default interface {{ testint }}" - "default interface {{ testint }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: "Ensure {{testint}} is layer3" - name: "Ensure {{testint}} is layer3"
@ -27,12 +30,14 @@
mode: layer3 mode: layer3
description: 'Configured by Ansible - Layer3' description: 'Configured by Ansible - Layer3'
admin_state: 'up' admin_state: 'up'
provider: "{{ connection }}"
state: present state: present
- block: - block:
- name: Configure nxos_pim_interface state absent - name: Configure nxos_pim_interface state absent
nxos_pim_interface: &pimabsent nxos_pim_interface: &pimabsent
interface: "{{ testint }}" interface: "{{ testint }}"
provider: "{{ connection }}"
state: absent state: absent
- name: configure jp policy and type - name: configure jp policy and type
@ -44,6 +49,7 @@
jp_type_out: routemap jp_type_out: routemap
sparse: True sparse: True
border: True border: True
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -63,6 +69,7 @@
interface: "{{ testint }}" interface: "{{ testint }}"
neighbor_policy: NPR neighbor_policy: NPR
neighbor_type: routemap neighbor_type: routemap
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -81,6 +88,7 @@
interface: "{{ testint }}" interface: "{{ testint }}"
neighbor_policy: NPPF neighbor_policy: NPPF
neighbor_type: prefix neighbor_type: prefix
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -95,6 +103,7 @@
nxos_pim_interface: &confighak1 nxos_pim_interface: &confighak1
interface: "{{ testint }}" interface: "{{ testint }}"
hello_auth_key: password1 hello_auth_key: password1
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -106,6 +115,7 @@
hello_interval: 40 hello_interval: 40
sparse: True sparse: True
border: True border: True
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -122,6 +132,7 @@
interface: "{{ testint }}" interface: "{{ testint }}"
sparse: False sparse: False
border: False border: False
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -139,6 +150,7 @@
- name: configure state default - name: configure state default
nxos_pim_interface: &configdefault nxos_pim_interface: &configdefault
interface: "{{ testint }}" interface: "{{ testint }}"
provider: "{{ connection }}"
state: default state: default
register: result register: result
@ -154,6 +166,7 @@
nxos_pim_interface: &configb nxos_pim_interface: &configb
interface: "{{ testint }}" interface: "{{ testint }}"
border: True border: True
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -11,11 +11,13 @@
- name: "Disable feature PIM" - name: "Disable feature PIM"
nxos_feature: &disable_feature nxos_feature: &disable_feature
feature: pim feature: pim
provider: "{{ connection }}"
state: disabled state: disabled
- name: "Enable feature PIM" - name: "Enable feature PIM"
nxos_feature: &enable_feature nxos_feature: &enable_feature
feature: pim feature: pim
provider: "{{ connection }}"
state: enabled state: enabled
- name: Configure rp_address + group_list - name: Configure rp_address + group_list
@ -23,6 +25,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
group_list: "224.0.0.0/8" group_list: "224.0.0.0/8"
bidir: "{{ bidir }}" bidir: "{{ bidir }}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -43,6 +46,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
group_list: "224.0.0.0/8" group_list: "224.0.0.0/8"
bidir: False bidir: False
provider: "{{ connection }}"
state: present state: present
register: result register: result
when: platform is not match("N3L") when: platform is not match("N3L")
@ -62,6 +66,7 @@
nxos_pim_rp_address: &configbi nxos_pim_rp_address: &configbi
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
bidir: "{{ bidir }}" bidir: "{{ bidir }}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -77,6 +82,7 @@
nxos_pim_rp_address: &confignbi nxos_pim_rp_address: &confignbi
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
bidir: False bidir: False
provider: "{{ connection }}"
state: present state: present
register: result register: result
when: platform is not match("N3L") when: platform is not match("N3L")
@ -96,6 +102,7 @@
nxos_pim_rp_address: &configglr nxos_pim_rp_address: &configglr
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
group_list: "224.0.0.0/8" group_list: "224.0.0.0/8"
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -110,6 +117,7 @@
- name: Remove rp_address - name: Remove rp_address
nxos_pim_rp_address: &configbir nxos_pim_rp_address: &configbir
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -126,6 +134,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
prefix_list: "pim_prefix_list" prefix_list: "pim_prefix_list"
bidir: "{{ bidir }}" bidir: "{{ bidir }}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -142,6 +151,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
prefix_list: "pim_prefix_list" prefix_list: "pim_prefix_list"
bidir: False bidir: False
provider: "{{ connection }}"
state: present state: present
register: result register: result
when: platform is not match("N3L") when: platform is not match("N3L")
@ -162,6 +172,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
prefix_list: "pim_prefix_list" prefix_list: "pim_prefix_list"
bidir: False bidir: False
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -178,6 +189,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
route_map: "pim_routemap" route_map: "pim_routemap"
bidir: "{{ bidir }}" bidir: "{{ bidir }}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -194,6 +206,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
route_map: "pim_routemap" route_map: "pim_routemap"
bidir: False bidir: False
provider: "{{ connection }}"
state: present state: present
register: result register: result
when: platform is not match("N3L") when: platform is not match("N3L")
@ -214,6 +227,7 @@
rp_address: "10.1.1.20" rp_address: "10.1.1.20"
route_map: "pim_routemap" route_map: "pim_routemap"
bidir: False bidir: False
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -9,6 +9,7 @@
- name: "Enable feature LACP" - name: "Enable feature LACP"
nxos_feature: nxos_feature:
feature: lacp feature: lacp
provider: "{{ connection }}"
state: enabled state: enabled
ignore_errors: yes ignore_errors: yes
@ -16,12 +17,14 @@
nxos_config: &intdefault1 nxos_config: &intdefault1
lines: lines:
- "default interface {{ testint1 }}" - "default interface {{ testint1 }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: "Put interface {{testint2}} into default state" - name: "Put interface {{testint2}} into default state"
nxos_config: &intdefault2 nxos_config: &intdefault2
lines: lines:
- "default interface {{ testint2 }}" - "default interface {{ testint2 }}"
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: Remove possibly configured port-channel 99 - name: Remove possibly configured port-channel 99
@ -29,6 +32,7 @@
group: 99 group: 99
members: ["{{ testint1 }}", "{{ testint2 }}"] members: ["{{ testint1 }}", "{{ testint2 }}"]
force: 'true' force: 'true'
provider: "{{ connection }}"
state: absent state: absent
timeout: 60 timeout: 60
@ -39,6 +43,7 @@
members: ["{{ testint1 }}", "{{ testint2 }}"] members: ["{{ testint1 }}", "{{ testint2 }}"]
mode: active mode: active
force: 'true' force: 'true'
provider: "{{ connection }}"
state: present state: present
timeout: 60 timeout: 60
register: result register: result
@ -61,6 +66,7 @@
members: ["{{ testint1 }}", "{{ testint2 }}"] members: ["{{ testint1 }}", "{{ testint2 }}"]
mode: passive mode: passive
force: 'true' force: 'true'
provider: "{{ connection }}"
state: present state: present
timeout: 60 timeout: 60
register: result register: result
@ -83,6 +89,7 @@
- name: "Disable feature LACP" - name: "Disable feature LACP"
nxos_feature: nxos_feature:
feature: lacp feature: lacp
provider: "{{ connection }}"
state: disabled state: disabled
timeout: 60 timeout: 60

View file

@ -9,16 +9,19 @@
- terminal dont-ask - terminal dont-ask
- delete backup.cfg - delete backup.cfg
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: Create checkpoint file - name: Create checkpoint file
nxos_rollback: nxos_rollback:
checkpoint_file: backup.cfg checkpoint_file: backup.cfg
provider: "{{ connection }}"
timeout: 300 timeout: 300
- name: rollback to the previously created checkpoint file - name: rollback to the previously created checkpoint file
nxos_rollback: nxos_rollback:
rollback_to: backup.cfg rollback_to: backup.cfg
provider: "{{ connection }}"
timeout: 300 timeout: 300
- name: cleanup checkpoint file - name: cleanup checkpoint file

View file

@ -40,6 +40,7 @@
- name: Remove smu RPM - name: Remove smu RPM
nxos_rpm: &rsmurpm nxos_rpm: &rsmurpm
pkg: "nxos.sample-n9k_ALL-1.0.0-7.0.3.I6.1.lib32_n9000.rpm" pkg: "nxos.sample-n9k_ALL-1.0.0-7.0.3.I6.1.lib32_n9000.rpm"
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -79,6 +80,7 @@
aggregate: aggregate:
- { pkg: "healthMonitor-1.0-1.5.0.x86_64.rpm" } - { pkg: "healthMonitor-1.0-1.5.0.x86_64.rpm" }
- { pkg: "customCliApp-1.0-1.0.0.x86_64.rpm" } - { pkg: "customCliApp-1.0-1.0.0.x86_64.rpm" }
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -103,6 +105,7 @@
- name: Wait for device to come back up - name: Wait for device to come back up
wait_for: wait_for:
port: 22 port: 22
provider: "{{ connection }}"
state: started state: started
timeout: 600 timeout: 600
delay: 60 delay: 60
@ -123,6 +126,7 @@
- name: Remove reload smu RPM - name: Remove reload smu RPM
nxos_rpm: &rrsmurpm nxos_rpm: &rrsmurpm
pkg: "nxos.CSCve91311-n9k_ALL-1.0.0-7.0.3.I6.1.lib32_n9000.rpm" pkg: "nxos.CSCve91311-n9k_ALL-1.0.0-7.0.3.I6.1.lib32_n9000.rpm"
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -131,6 +135,7 @@
- name: Wait for device to come back up - name: Wait for device to come back up
wait_for: wait_for:
port: 22 port: 22
provider: "{{ connection }}"
state: started state: started
timeout: 600 timeout: 600
delay: 60 delay: 60

View file

@ -30,6 +30,7 @@
- name: delete backup files - name: delete backup files
file: file:
path: "{{ item.path }}" path: "{{ item.path }}"
provider: "{{ connection }}"
state: absent state: absent
with_items: "{{backup_files.files|default([])}}" with_items: "{{backup_files.files|default([])}}"

View file

@ -12,6 +12,7 @@
nxos_command: nxos_command:
commands: commands:
- show version - show version
provider: "{{ connection }}"
# hit to_list() # hit to_list()
- name: setup - name: setup

View file

@ -22,6 +22,7 @@
snapshot_name: test_snapshot1 snapshot_name: test_snapshot1
description: Ansible description: Ansible
save_snapshot_locally: True save_snapshot_locally: True
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -45,6 +46,7 @@
row_id: ROW_intf row_id: ROW_intf
element_key1: intf-name element_key1: intf-name
element_key2: intf-name element_key2: intf-name
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -66,6 +68,7 @@
show_command: show ip interface brief show_command: show ip interface brief
row_id: ROW_intf row_id: ROW_intf
element_key1: intf-name element_key1: intf-name
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -84,11 +87,13 @@
comparison_results_file: compare_snapshots.txt comparison_results_file: compare_snapshots.txt
compare_option: summary compare_option: summary
path: '.' path: '.'
provider: "{{ connection }}"
- name: delete snapshot - name: delete snapshot
nxos_snapshot: &del nxos_snapshot: &del
snapshot_name: test_snapshot2 snapshot_name: test_snapshot2
action: delete action: delete
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -102,6 +107,7 @@
- name: delete all snapshots - name: delete all snapshots
nxos_snapshot: &delall nxos_snapshot: &delall
action: delete_all action: delete_all
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -120,11 +126,13 @@
commands: commands:
- snapshot section delete myshow - snapshot section delete myshow
match: none match: none
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- name: delete all snapshots - name: delete all snapshots
nxos_snapshot: nxos_snapshot:
action: delete_all action: delete_all
provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_snapshot sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_snapshot sanity test"

View file

@ -7,6 +7,7 @@
nxos_snmp_community: &remove nxos_snmp_community: &remove
community: TESTING7 community: TESTING7
group: network-operator group: network-operator
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -16,6 +17,7 @@
nxos_snmp_community: &config nxos_snmp_community: &config
community: TESTING7 community: TESTING7
group: network-operator group: network-operator
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -35,6 +37,7 @@
nxos_snmp_community: &chg nxos_snmp_community: &chg
community: TESTING7 community: TESTING7
group: network-admin group: network-admin
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -62,6 +65,7 @@
nxos_snmp_community: &configaccess nxos_snmp_community: &configaccess
community: TESTING7 community: TESTING7
access: ro access: ro
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -90,6 +94,7 @@
community: TESTING7 community: TESTING7
access: rw access: rw
acl: ansible_acl acl: ansible_acl
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -106,6 +111,7 @@
community: TESTING7 community: TESTING7
access: rw access: rw
acl: new_acl acl: new_acl
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -122,6 +128,7 @@
community: TESTING7 community: TESTING7
access: rw access: rw
acl: default acl: default
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -6,6 +6,7 @@
- name: Setup - Remove snmp_contact if configured - name: Setup - Remove snmp_contact if configured
nxos_snmp_contact: &remove nxos_snmp_contact: &remove
contact: Test contact: Test
provider: "{{ connection }}"
state: absent state: absent
- block: - block:
@ -13,6 +14,7 @@
- name: Configure snmp contact - name: Configure snmp contact
nxos_snmp_contact: &config nxos_snmp_contact: &config
contact: Testing contact: Testing
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -31,6 +33,7 @@
- name: Change snmp contact - name: Change snmp contact
nxos_snmp_contact: &config1 nxos_snmp_contact: &config1
contact: Test contact: Test
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -20,6 +20,7 @@
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
udp: 222 udp: 222
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -35,6 +36,7 @@
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
udp: 222 udp: 222
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -56,6 +58,7 @@
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
vrf_filter: default vrf_filter: default
udp: 222 udp: 222
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -75,6 +78,7 @@
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
vrf: management vrf: management
vrf_filter: management vrf_filter: management
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -92,6 +96,7 @@
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
udp: 222 udp: 222
vrf_filter: default vrf_filter: default
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -20,6 +20,7 @@
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
udp: 222 udp: 222
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -35,6 +36,7 @@
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
udp: 222 udp: 222
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -56,6 +58,7 @@
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
vrf_filter: default vrf_filter: default
udp: 222 udp: 222
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -75,6 +78,7 @@
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
vrf: management vrf: management
vrf_filter: management vrf_filter: management
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -92,6 +96,7 @@
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
udp: 222 udp: 222
vrf_filter: default vrf_filter: default
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -25,6 +25,7 @@
vrf: management vrf: management
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -40,6 +41,7 @@
vrf: management vrf: management
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -60,6 +62,7 @@
nxos_snmp_host: &config1 nxos_snmp_host: &config1
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
vrf_filter: default vrf_filter: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -78,6 +81,7 @@
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
vrf: management vrf: management
vrf_filter: management vrf_filter: management
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -94,6 +98,7 @@
nxos_snmp_host: &rem2 nxos_snmp_host: &rem2
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
vrf_filter: default vrf_filter: default
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -22,6 +22,7 @@
vrf: management vrf: management
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes
@ -38,6 +39,7 @@
vrf: management vrf: management
vrf_filter: management vrf_filter: management
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -59,6 +61,7 @@
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
udp: 222 udp: 222
vrf_filter: default vrf_filter: default
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -78,6 +81,7 @@
src_intf: "{{ intname|default(omit) }}" src_intf: "{{ intname|default(omit) }}"
vrf: management vrf: management
vrf_filter: management vrf_filter: management
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -95,6 +99,7 @@
snmp_host: 192.0.2.3 snmp_host: 192.0.2.3
udp: 222 udp: 222
vrf_filter: default vrf_filter: default
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -6,12 +6,14 @@
- name: Setup - Remove snmp_location if configured - name: Setup - Remove snmp_location if configured
nxos_snmp_location: &remove nxos_snmp_location: &remove
location: Test location: Test
provider: "{{ connection }}"
state: absent state: absent
- block: - block:
- name: Configure snmp location - name: Configure snmp location
nxos_snmp_location: &config nxos_snmp_location: &config
location: Testing location: Testing
provider: "{{ connection }}"
state: present state: present
register: result register: result
@ -30,6 +32,7 @@
- name: Change snmp location - name: Change snmp location
nxos_snmp_location: &config1 nxos_snmp_location: &config1
location: Test location: Test
provider: "{{ connection }}"
state: present state: present
register: result register: result

View file

@ -6,12 +6,14 @@
- name: Setup - Remove snmp_traps if configured - name: Setup - Remove snmp_traps if configured
nxos_snmp_traps: &remove nxos_snmp_traps: &remove
group: all group: all
provider: "{{ connection }}"
state: disabled state: disabled
- block: - block:
- name: Configure one snmp trap group - name: Configure one snmp trap group
nxos_snmp_traps: &config nxos_snmp_traps: &config
group: bridge group: bridge
provider: "{{ connection }}"
state: enabled state: enabled
register: result register: result
@ -30,6 +32,7 @@
- name: Remove snmp trap group - name: Remove snmp trap group
nxos_snmp_traps: &rem1 nxos_snmp_traps: &rem1
group: bridge group: bridge
provider: "{{ connection }}"
state: disabled state: disabled
register: result register: result
@ -44,6 +47,7 @@
- name: Configure all snmp trap groups - name: Configure all snmp trap groups
nxos_snmp_traps: &config1 nxos_snmp_traps: &config1
group: all group: all
provider: "{{ connection }}"
state: enabled state: enabled
register: result register: result

View file

@ -6,6 +6,7 @@
- name: Remove snmp user - name: Remove snmp user
nxos_snmp_user: &remove nxos_snmp_user: &remove
user: ntc user: ntc
provider: "{{ connection }}"
state: absent state: absent
- pause: - pause:
@ -20,6 +21,7 @@
pwd: N$tOpe%1 pwd: N$tOpe%1
privacy: HelloU$er1 privacy: HelloU$er1
encrypt: true encrypt: true
provider: "{{ connection }}"
register: result register: result
- assert: &true - assert: &true
@ -30,6 +32,7 @@
nxos_snmp_user: &chg nxos_snmp_user: &chg
user: ntc user: ntc
group: network-admin group: network-admin
provider: "{{ connection }}"
register: result register: result
- assert: *true - assert: *true
@ -46,6 +49,7 @@
nxos_snmp_user: &remg nxos_snmp_user: &remg
user: ntc user: ntc
group: network-admin group: network-admin
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -64,6 +68,7 @@
nxos_snmp_user: &remove1 nxos_snmp_user: &remove1
user: ntc user: ntc
group: network-operator group: network-operator
provider: "{{ connection }}"
state: absent state: absent
register: result register: result

View file

@ -12,6 +12,7 @@
pref: 100 pref: 100
tag: 5500 tag: 5500
vrf: "{{ item }}" vrf: "{{ item }}"
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -36,6 +37,7 @@
pref: 10 pref: 10
tag: default tag: default
vrf: "{{ item }}" vrf: "{{ item }}"
provider: "{{ connection }}"
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -55,6 +57,7 @@
route_name: testing route_name: testing
pref: 100 pref: 100
vrf: "{{ item }}" vrf: "{{ item }}"
provider: "{{ connection }}"
state: absent state: absent
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
register: result register: result
@ -73,6 +76,7 @@
aggregate: aggregate:
- { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" } - { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" }
- { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" } - { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" }
provider: "{{ connection }}"
register: result register: result
- assert: - assert:
@ -92,6 +96,7 @@
aggregate: aggregate:
- { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" } - { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" }
- { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" } - { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" }
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -116,6 +121,7 @@
pref: 100 pref: 100
tag: 5500 tag: 5500
vrf: "{{ item }}" vrf: "{{ item }}"
provider: "{{ connection }}"
state: absent state: absent
with_items: "{{ vrfs }}" with_items: "{{ vrfs }}"
ignore_errors: yes ignore_errors: yes
@ -125,6 +131,7 @@
aggregate: aggregate:
- { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" } - { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" }
- { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" } - { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" }
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes

View file

@ -28,6 +28,7 @@
- name: Ensure interface is in its default switchport state - name: Ensure interface is in its default switchport state
nxos_switchport: &def_swi nxos_switchport: &def_swi
interface: "{{ intname }}" interface: "{{ intname }}"
provider: "{{ connection }}"
state: unconfigured state: unconfigured
- name: Ensure interface is configured for access vlan 20 - name: Ensure interface is configured for access vlan 20
@ -86,6 +87,7 @@
interface: "{{ intname }}" interface: "{{ intname }}"
mode: trunk mode: trunk
trunk_vlans: 2-50 trunk_vlans: 2-50
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -114,6 +116,7 @@
interface: "{{ intname }}" interface: "{{ intname }}"
mode: trunk mode: trunk
trunk_vlans: 30-4094 trunk_vlans: 30-4094
provider: "{{ connection }}"
state: absent state: absent
register: result register: result
@ -141,6 +144,7 @@
- name: "remove vlans" - name: "remove vlans"
nxos_vlan: nxos_vlan:
vlan_range: "5-10,20" vlan_range: "5-10,20"
provider: "{{ connection }}"
state: absent state: absent
ignore_errors: yes ignore_errors: yes

Some files were not shown because too many files have changed in this diff Show more