File tree Expand file tree Collapse file tree 6 files changed +24
-6
lines changed
plugins/module_utils/network/vyos
tests/integration/targets
vyos_snmp_server/tests/cli Expand file tree Collapse file tree 6 files changed +24
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ trivial :
3
+ - prepare_vyos_firewall - Remove IP address from eth1 for lag tests
4
+ - vyos_snmp_server - add IP address for 1.4+ OS variants
Original file line number Diff line number Diff line change @@ -68,8 +68,12 @@ def get_capabilities(module):
68
68
def get_config (module , flags = None , format = None ):
69
69
flags = [] if flags is None else flags
70
70
global _DEVICE_CONFIGS
71
-
72
- if _DEVICE_CONFIGS != {} or module .params ["match" ] == "none" :
71
+ # If _DEVICE_CONFIGS is non-empty and module.params["match"] is "none",
72
+ # return the cached device configurations. This avoids redundant calls
73
+ # to the connection when no specific match criteria are provided.
74
+ if _DEVICE_CONFIGS != {} and (
75
+ module .params ["match" ] is not None and module .params ["match" ] == "none"
76
+ ):
73
77
return to_text (_DEVICE_CONFIGS )
74
78
else :
75
79
connection = get_connection (module )
Original file line number Diff line number Diff line change 5
5
set interfaces ethernet eth0 address dhcp
6
6
set interfaces ethernet eth0 speed auto
7
7
set interfaces ethernet eth0 duplex auto
8
- set interfaces ethernet eth1 address 192.0.2.1/24
8
+ set interfaces ethernet eth1
9
9
set interfaces ethernet eth2
10
10
delete interfaces loopback lo
11
11
vars :
Original file line number Diff line number Diff line change 2
2
- name : setup
3
3
vyos.vyos.vyos_config :
4
4
lines :
5
+ - set interface ethernet eth1 address 192.0.2.1/24
5
6
- set interface ethernet eth2 address 20.1.1.1/24
6
7
- set service snmp community switches authorization rw
7
8
- set service snmp community bridges client 1.1.1.1
Original file line number Diff line number Diff line change 6
6
ignore_errors : true
7
7
vars :
8
8
ansible_connection : ansible.netcommon.network_cli
9
+
10
+ - name : remove interfaces address
11
+ vyos.vyos.vyos_config :
12
+ lines :
13
+ - delete interface ethernet eth1 address
14
+ - delete interface ethernet eth2 address
15
+ ignore_errors : true
16
+ vars :
17
+ ansible_connection : ansible.netcommon.network_cli
Original file line number Diff line number Diff line change 55
55
ignore_errors : true
56
56
vyos.vyos.vyos_config :
57
57
lines :
58
- - delete system name-server name-server 192.0.2.1
59
- - delete system name-server name-server 192.0.2.2
60
- - delete system name-server name-server 192.0.2.3
58
+ - delete system name-server 192.0.2.1
59
+ - delete system name-server 192.0.2.2
60
+ - delete system name-server 192.0.2.3
61
61
match : none
62
62
63
63
- debug : msg="END cli/basic.yaml on connection={{ ansible_connection }}"
You can’t perform that action at this time.
0 commit comments