blob: 11963b1f83996710e60e309e98e72ffa25d61345 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
---
- debug: msg="START connection={{ ansible_connection }} nxos_bgp parameter test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- debug: msg="This bgp_disable_policy is not supported on {{ image_version }}"
when: imagetag is search("A8|D1")
- set_fact: bgp_disable_policy="false"
- set_fact: bgp_disable_policy="true"
when: imagetag is not search("A8|D1")
- name: "Disable feature BGP"
nxos_feature:
feature: bgp
provider: "{{ connection }}"
state: disabled
ignore_errors: yes
- name: "Enable feature BGP"
nxos_feature:
feature: bgp
provider: "{{ connection }}"
state: enabled
ignore_errors: yes
- block:
- name: "set disable policy"
nxos_bgp: &set1
asn: 65535
disable_policy_batching: true
disable_policy_batching_ipv4_prefix_list: v4_p
disable_policy_batching_ipv6_prefix_list: v6_p
provider: "{{ connection }}"
register: result
when: bgp_disable_policy
- assert: &true
that:
- "result.changed == true"
when: bgp_disable_policy
- name: "Check Idempotence"
nxos_bgp: *set1
register: result
when: bgp_disable_policy
- assert: &false
that:
- "result.changed == false"
when: bgp_disable_policy
- name: "reset disable policy"
nxos_bgp: &reset1
asn: 65535
disable_policy_batching: false
disable_policy_batching_ipv4_prefix_list: default
disable_policy_batching_ipv6_prefix_list: default
provider: "{{ connection }}"
register: result
when: bgp_disable_policy
- assert: *true
when: bgp_disable_policy
- name: "Check Idempotence"
nxos_bgp: *reset1
register: result
when: bgp_disable_policy
- assert: *false
when: bgp_disable_policy
rescue:
- debug: msg="Tests can fail on A8 or helsinki images"
always:
- name: "Disable feature bgp"
nxos_feature:
feature: bgp
provider: "{{ connection }}"
state: disabled
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_bgp parameter test"
|