Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_vsx_provisioning_tool.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 #
4 # Ansible module to manage CheckPoint Firewall (c) 2019
5 #
6 # Ansible is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Ansible is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 from __future__ import (absolute_import, division, print_function)
21
22 __metaclass__ = type
23
24 ANSIBLE_METADATA = {'metadata_version': '1.1',
25 'status': ['preview'],
26 'supported_by': 'community'}
27
28 DOCUMENTATION = """
29 ---
30 module: cp_mgmt_vsx_provisioning_tool
31 short_description: Run the VSX provisioning tool with the specified parameters.
32 description:
33 - Run the VSX provisioning tool with the specified parameters. Note - An automatic session publish is part of all the operations in this API.
34 - All operations are performed over Web Services API.
35 - Available from R82 management version.
36 version_added: "6.0.0"
37 author: "Eden Brillant (@chkp-edenbr)"
38 options:
39 operation:
40 description:
41 - The name of the provisioning operation to run. Each operation has its own specific parameters.<br> The available operations
42 are,<ul><li><i>add-vsx-gateway</i> - Adds a new VSX gateway</li><li><i>add-vsx-cluster</i> - Adds a new VSX
43 cluster*</li><li><i>add-vsx-cluster-member</i> - Adds a new VSX cluster member*</li><li><i>add-vd</i> - Adds a new Virtual Device (VS/VSB/VSW/VR) to a
44 VSX gateway or VSX cluster</li><li><i>add-vd-interface</i> - Adds a new virtual interface to a Virtual Device</li><li><i>add-physical-interface</i> -
45 Adds a physical interface to a VSX gateway or VSX cluster</li><li><i>add-route</i> - Adds a route to a Virtual Device</li><li><i>attach-bridge</i> -
46 Attaches a bridge interface to a Virtual System</li><li><i>remove-vsx</i> - Removes a VSX gateway or VSX cluster</li><li><i>remove-vd</i> - Removes a
47 Virtual Device</li><li><i>remove-vd-interface</i> - Removes an interface from a Virtual Device</li><li><i>remove-physical-interface</i> - Removes a
48 physical interface from a VSX gateway or VSX cluster</li><li><i>remove-route</i> - Removes a route from a Virtual Device</li><li><i>set-vd</i> -
49 Modifies a Virtual Device</li><li><i>set-vd-interface</i> - Modifies an interface on a Virtual Device</li><li><i>set-physical-interface</i> - Modifies
50 a physical interface on a VSX cluster or VSX gateway</li></ul><br> * When adding a VSX Cluster, you must also add at least 2 cluster members<br> *
51 Adding cluster members is only allowed when adding a new VSX cluster<br> * To add members to an existing cluster, use vsx-run-operation.
52 type: str
53 choices: ['attach-bridge', 'add-route', 'add-physical-interface', 'add-vd-interface', 'add-vsx-gateway', 'add-vsx-cluster', 'add-vd',
54 'remove-route', 'remove-vd', 'remove-vsx', 'remove-physical-interface', 'remove-vd-interface', 'set-vd', 'set-physical-interface',
55 'set-vd-interface']
56 add_physical_interface_params:
57 description:
58 - Parameters for the operation to add a physical interface to a VSX gateway or VSX Cluster.
59 type: dict
60 suboptions:
61 name:
62 description:
63 - Name of the interface.
64 type: str
65 vsx_name:
66 description:
67 - Name of the VSX Gateway or Cluster object.
68 type: str
69 vlan_trunk:
70 description:
71 - True if this interface is a VLAN trunk.
72 type: bool
73 add_route_params:
74 description:
75 - Parameters for the operation to add a route to a Virtual System or Virtual Router.
76 type: dict
77 suboptions:
78 destination:
79 description:
80 - Route destination. To specify the default route, use 'default' for IPv4 and 'default6' for IPv6.
81 type: str
82 next_hop:
83 description:
84 - Next hop IP address.
85 type: str
86 leads_to:
87 description:
88 - Virtual Router for this route<br/>This VD must have an existing connection to the VR.
89 type: str
90 vd:
91 description:
92 - Name of the Virtual System, Virtual Switch, or Virtual Router.
93 type: str
94 netmask:
95 description:
96 - Subnet mask for this route.
97 type: str
98 prefix:
99 description:
100 - CIDR prefix for this route.
101 type: str
102 propagate:
103 description:
104 - Propagate this route to adjacent virtual devices.
105 type: bool
106 add_vd_interface_params:
107 description:
108 - Parameters for the operation to add a new interface to a Virtual Device.
109 type: dict
110 suboptions:
111 leads_to:
112 description:
113 - Virtual Switch or Virtual Router for this interface.
114 type: str
115 name:
116 description:
117 - Name of the interface.
118 type: str
119 vd:
120 description:
121 - Name of the Virtual System, Virtual Switch, or Virtual Router.
122 type: str
123 anti_spoofing:
124 description:
125 - The anti-spoofing enforcement setting of this interface.
126 type: str
127 choices: ['prevent', 'detect', 'off']
128 anti_spoofing_tracking:
129 description:
130 - The anti-spoofing tracking setting of this interface.
131 type: str
132 choices: ['none', 'alert', 'log']
133 ipv4_address:
134 description:
135 - IPv4 Address of this interface with optional CIDR prefix.<br/>Required if this interface belongs to a Virtual System or Virtual Router.
136 type: str
137 ipv4_netmask:
138 description:
139 - IPv4 Subnet mask of this interface.
140 type: str
141 ipv4_prefix:
142 description:
143 - IPv4 CIDR prefix of this interface.
144 type: str
145 ipv6_address:
146 description:
147 - IPv6 Address of this interface<br/>Required if this interface belongs to a Virtual System or Virtual Router.
148 type: str
149 ipv6_netmask:
150 description:
151 - IPv6 Subnet mask of this interface.
152 type: str
153 ipv6_prefix:
154 description:
155 - IPv6 CIDR prefix of this interface.
156 type: str
157 mtu:
158 description:
159 - MTU of this interface.
160 type: int
161 propagate:
162 description:
163 - Propagate IPv4 route to adjacent virtual devices.
164 type: bool
165 propagate6:
166 description:
167 - Propagate IPv6 route to adjacent virtual devices.
168 type: bool
169 specific_group:
170 description:
171 - Specific group for interface topology.<br/>Only for use with topology option 'internal_specific'.
172 type: str
173 topology:
174 description:
175 - Topology of this interface.<br/>Automatic topology calculation based on routes must be disabled for this VS.
176 type: str
177 choices: ['external', 'internal_undefined', 'internal_this_network', 'internal_specific', 'defined_by_routes']
178 vti_settings:
179 description:
180 - VTI settings for this interface. This Virtual System must have VPN blade enabled.
181 type: dict
182 suboptions:
183 local_ipv4_address:
184 description:
185 - The IPv4 address of the VPN tunnel on this Virtual System.
186 type: str
187 peer_name:
188 description:
189 - The name of the remote peer object as defined in the VPN community.
190 type: str
191 remote_ipv4_address:
192 description:
193 - The IPv4 address of the VPN tunnel on the remote VPN peer.
194 type: str
195 tunnel_id:
196 description:
197 - Optional unique Tunnel ID.<br/>Automatically assigned by the system if empty.
198 type: str
199 add_vd_params:
200 description:
201 - Parameters for the operation to add a new Virtual Device (VS/VSB/VSW/VR).
202 type: dict
203 suboptions:
204 interfaces:
205 description:
206 - The list of interfaces for this new Virtual Device.<br/>Optional if this new VD is a Virtual Switch.
207 type: list
208 elements: dict
209 suboptions:
210 leads_to:
211 description:
212 - Virtual Switch or Virtual Router for this interface.
213 type: str
214 name:
215 description:
216 - Name of the interface.
217 type: str
218 anti_spoofing:
219 description:
220 - The anti-spoofing enforcement setting of this interface.
221 type: str
222 choices: ['prevent', 'detect', 'off']
223 anti_spoofing_tracking:
224 description:
225 - The anti-spoofing tracking setting of this interface.
226 type: str
227 choices: ['none', 'alert', 'log']
228 ipv4_address:
229 description:
230 - IPv4 Address of this interface with optional CIDR prefix.<br/>Required if this interface belongs to a Virtual System or Virtual Router.
231 type: str
232 ipv4_netmask:
233 description:
234 - IPv4 Subnet mask of this interface.
235 type: str
236 ipv4_prefix:
237 description:
238 - IPv4 CIDR prefix of this interface.
239 type: str
240 ipv6_address:
241 description:
242 - IPv6 Address of this interface<br/>Required if this interface belongs to a Virtual System or Virtual Router.
243 type: str
244 ipv6_netmask:
245 description:
246 - IPv6 Subnet mask of this interface.
247 type: str
248 ipv6_prefix:
249 description:
250 - IPv6 CIDR prefix of this interface.
251 type: str
252 mtu:
253 description:
254 - MTU of this interface.
255 type: int
256 propagate:
257 description:
258 - Propagate IPv4 route to adjacent virtual devices.
259 type: bool
260 propagate6:
261 description:
262 - Propagate IPv6 route to adjacent virtual devices.
263 type: bool
264 specific_group:
265 description:
266 - Specific group for interface topology.<br/>Only for use with topology option 'internal_specific'.
267 type: str
268 topology:
269 description:
270 - Topology of this interface.<br/>Automatic topology calculation based on routes must be disabled for this VS.
271 type: str
272 choices: ['external', 'internal_undefined', 'internal_this_network', 'internal_specific', 'defined_by_routes']
273 type:
274 description:
275 - Type of the Virtual Device <br><br>vs - Virtual Firewall<br>vr - Virtual Router<br>vsw - Virtual Switch<br>vsbm - Virtual Firewall in bridge mode.
276 type: str
277 choices: ['vs', 'vr', 'vsw', 'vsbm']
278 vd:
279 description:
280 - Name of the Virtual System, Virtual Switch, or Virtual Router.
281 type: str
282 vsx_name:
283 description:
284 - Name of the VSX Gateway or Cluster object.
285 type: str
286 calc_topology_auto:
287 description:
288 - Calculate interface topology automatically based on routes.<br/>Relevant only for Virtual Systems.<br/>Do not use for virtual devices.
289 type: bool
290 ipv4_address:
291 description:
292 - Main IPv4 Address.<br/>Required if this device is a Virtual System.<br/>Do not use for other virtual devices.
293 type: str
294 ipv4_instances:
295 description:
296 - Number of IPv4 instances for the Virtual System.<br/>Must be greater or equal to 1.<br/>Only relevant for Virtual Systems and Virtual
297 Systems in bridge mode.
298 type: int
299 ipv6_address:
300 description:
301 - Main IPv6 Address.<br/>Required if this device is a Virtual System.<br/>Do not use for other virtual devices.
302 type: str
303 ipv6_instances:
304 description:
305 - Number of IPv6 instances for the Virtual System.<br/>Only relevant for Virtual Systems and Virtual Systems in bridge mode.
306 type: int
307 routes:
308 description:
309 - The list of routes for this new Virtual Device (VS or VR only).
310 type: list
311 elements: dict
312 suboptions:
313 destination:
314 description:
315 - Route destination. To specify the default route, use 'default' for IPv4 and 'default6' for IPv6.
316 type: str
317 next_hop:
318 description:
319 - Next hop IP address.
320 type: str
321 leads_to:
322 description:
323 - Virtual Router for this route<br/>This VD must have an existing connection to the VR.
324 type: str
325 netmask:
326 description:
327 - Subnet mask for this route.
328 type: str
329 prefix:
330 description:
331 - CIDR prefix for this route.
332 type: str
333 propagate:
334 description:
335 - Propagate this route to adjacent virtual devices.
336 type: bool
337 vs_mtu:
338 description:
339 - MTU of the Virtual System.<br/>Only relevant for Virtual Systems in bridge mode.<br/>Do not use for other virtual devices.
340 type: int
341 add_vsx_cluster_params:
342 description:
343 - Parameters for the operation to add a new VSX Cluster.
344 type: dict
345 suboptions:
346 cluster_type:
347 description:
348 - Cluster type for the VSX Cluster Object.<br/>Starting in R81.10, only VSLS can be configured during cluster creation.<br/>To use High
349 Availability ('ha'), first create the cluster as VSLS and then run vsx_util on the Management.
350 type: str
351 choices: ['vsls', 'ha']
352 ipv4_address:
353 description:
354 - Main IPv4 Address of the VSX Gateway or Cluster object.<br/>Optional if main IPv6 Address is defined.
355 type: str
356 ipv6_address:
357 description:
358 - Main IPv6 Address of the VSX Gateway or Cluster object.<br/>Optional if main IPv4 Address is defined.
359 type: str
360 members:
361 description:
362 - The list of cluster members for this new VSX Cluster. Minimum, 2.
363 type: list
364 elements: dict
365 suboptions:
366 ipv4_address:
367 description:
368 - Main IPv4 Address of the VSX Cluster member.<br/>Mandatory if the VSX Cluster has an IPv4 Address.
369 type: str
370 ipv6_address:
371 description:
372 - Main IPv6 Address of the VSX Cluster member.<br/>Mandatory if the VSX Cluster has an IPv6 Address.
373 type: str
374 name:
375 description:
376 - Name of the new VSX Cluster member.
377 type: str
378 sic_otp:
379 description:
380 - SIC one-time-password of the VSX Gateway or Cluster member.<br/>Password must be between 4-127 characters in length.
381 type: str
382 sync_ip:
383 description:
384 - Sync IP address for the VSX Cluster member.
385 type: str
386 sync_if_name:
387 description:
388 - Sync interface name for the VSX Cluster.
389 type: str
390 sync_netmask:
391 description:
392 - Sync interface netmask for the VSX Cluster.
393 type: str
394 vsx_version:
395 description:
396 - Version of the VSX Gateway or Cluster object.
397 type: str
398 vsx_name:
399 description:
400 - Name of the VSX Gateway or Cluster object.
401 type: str
402 rule_drop:
403 description:
404 - Add a default drop rule to the VSX Gateway or Cluster initial policy.
405 type: str
406 choices: ['enable', 'disable']
407 rule_https:
408 description:
409 - Add a rule to allow HTTPS traffic to the VSX Gateway or Cluster initial policy.
410 type: str
411 choices: ['enable', 'disable']
412 rule_ping:
413 description:
414 - Add a rule to allow ping traffic to the VSX Gateway or Cluster initial policy.
415 type: str
416 choices: ['enable', 'disable']
417 rule_ping6:
418 description:
419 - Add a rule to allow ping6 traffic to the VSX Gateway or Cluster initial policy.
420 type: str
421 choices: ['enable', 'disable']
422 rule_snmp:
423 description:
424 - Add a rule to allow SNMP traffic to the VSX Gateway or Cluster initial policy.
425 type: str
426 choices: ['enable', 'disable']
427 rule_ssh:
428 description:
429 - Add a rule to allow SSH traffic to the VSX Gateway or Cluster initial policy.
430 type: str
431 choices: ['enable', 'disable']
432 add_vsx_gateway_params:
433 description:
434 - Parameters for the operation to add a new VSX Gateway.
435 type: dict
436 suboptions:
437 ipv4_address:
438 description:
439 - Main IPv4 Address of the VSX Gateway or Cluster object.<br/>Optional if main IPv6 Address is defined.
440 type: str
441 ipv6_address:
442 description:
443 - Main IPv6 Address of the VSX Gateway or Cluster object.<br/>Optional if main IPv4 Address is defined.
444 type: str
445 sic_otp:
446 description:
447 - SIC one-time-password of the VSX Gateway or Cluster member.<br/>Password must be between 4-127 characters in length.
448 type: str
449 vsx_version:
450 description:
451 - Version of the VSX Gateway or Cluster object.
452 type: str
453 vsx_name:
454 description:
455 - Name of the VSX Gateway or Cluster object.
456 type: str
457 rule_drop:
458 description:
459 - Add a default drop rule to the VSX Gateway or Cluster initial policy.
460 type: str
461 choices: ['enable', 'disable']
462 rule_https:
463 description:
464 - Add a rule to allow HTTPS traffic to the VSX Gateway or Cluster initial policy.
465 type: str
466 choices: ['enable', 'disable']
467 rule_ping:
468 description:
469 - Add a rule to allow ping traffic to the VSX Gateway or Cluster initial policy.
470 type: str
471 choices: ['enable', 'disable']
472 rule_ping6:
473 description:
474 - Add a rule to allow ping6 traffic to the VSX Gateway or Cluster initial policy.
475 type: str
476 choices: ['enable', 'disable']
477 rule_snmp:
478 description:
479 - Add a rule to allow SNMP traffic to the VSX Gateway or Cluster initial policy.
480 type: str
481 choices: ['enable', 'disable']
482 rule_ssh:
483 description:
484 - Add a rule to allow SSH traffic to the VSX Gateway or Cluster initial policy.
485 type: str
486 choices: ['enable', 'disable']
487 attach_bridge_params:
488 description:
489 - Parameters for the operation to attach a new bridge interface to a Virtual System.
490 type: dict
491 suboptions:
492 ifs1:
493 description:
494 - Name of the first interface for the bridge.
495 type: str
496 ifs2:
497 description:
498 - Name of the second interface for the bridge.
499 type: str
500 vd:
501 description:
502 - Name of the Virtual System, Virtual Switch, or Virtual Router.
503 type: str
504 remove_physical_interface_params:
505 description:
506 - Parameters for the operation to remove a physical interface from a VSX (Gateway or Cluster).
507 type: dict
508 suboptions:
509 name:
510 description:
511 - Name of the interface.
512 type: str
513 vsx_name:
514 description:
515 - Name of the VSX Gateway or Cluster object.
516 type: str
517 remove_route_params:
518 description:
519 - Parameters for the operation to remove a route from a Virtual System or Virtual Router.
520 type: dict
521 suboptions:
522 destination:
523 description:
524 - Route destination. To specify the default route, use 'default' for IPv4 and 'default6' for IPv6.
525 type: str
526 vd:
527 description:
528 - Name of the Virtual System, Virtual Switch, or Virtual Router.
529 type: str
530 netmask:
531 description:
532 - Subnet mask for this route.
533 type: str
534 prefix:
535 description:
536 - CIDR prefix for this route.
537 type: str
538 remove_vd_interface_params:
539 description:
540 - Parameters for the operation to remove a logical interface from a Virtual Device.
541 type: dict
542 suboptions:
543 leads_to:
544 description:
545 - Virtual Switch or Virtual Router for this interface.
546 type: str
547 name:
548 description:
549 - Name of the interface.
550 type: str
551 vd:
552 description:
553 - Name of the Virtual System, Virtual Switch, or Virtual Router.
554 type: str
555 remove_vd_params:
556 description:
557 - Parameters for the operation to remove a Virtual Device.
558 type: dict
559 suboptions:
560 vd:
561 description:
562 - Name of the Virtual System, Virtual Switch, or Virtual Router.
563 type: str
564 remove_vsx_params:
565 description:
566 - Parameters for the operation to remove a VSX Gateway or VSX Cluster.
567 type: dict
568 suboptions:
569 vsx_name:
570 description:
571 - Name of the VSX Gateway or Cluster object.
572 type: str
573 set_physical_interface_params:
574 description:
575 - Parameters for the operation to change the configuration of a physical interface.
576 type: dict
577 suboptions:
578 name:
579 description:
580 - Name of the interface.
581 type: str
582 vlan_trunk:
583 description:
584 - True if this interface is a VLAN trunk.
585 type: bool
586 vsx_name:
587 description:
588 - Name of the VSX Gateway or Cluster object.
589 type: str
590 set_vd_interface_params:
591 description:
592 - Parameters for the operation to change the configuration of a logical interface.
593 type: dict
594 suboptions:
595 leads_to:
596 description:
597 - Virtual Switch or Virtual Router for this interface.
598 type: str
599 name:
600 description:
601 - Name of the interface.
602 type: str
603 vd:
604 description:
605 - Name of the Virtual System, Virtual Switch, or Virtual Router.
606 type: str
607 anti_spoofing:
608 description:
609 - The anti-spoofing enforcement setting of this interface.
610 type: str
611 choices: ['prevent', 'detect', 'off']
612 anti_spoofing_tracking:
613 description:
614 - The anti-spoofing tracking setting of this interface.
615 type: str
616 choices: ['none', 'alert', 'log']
617 ipv4_address:
618 description:
619 - IPv4 Address of this interface with optional CIDR prefix.<br/>Required if this interface belongs to a Virtual System or Virtual Router.
620 type: str
621 ipv6_address:
622 description:
623 - IPv6 Address of this interface<br/>Required if this interface belongs to a Virtual System or Virtual Router.
624 type: str
625 mtu:
626 description:
627 - MTU of this interface.
628 type: int
629 new_leads_to:
630 description:
631 - New Virtual Switch or Virtual Router for this interface.
632 type: str
633 propagate:
634 description:
635 - Propagate IPv4 route to adjacent virtual devices.
636 type: bool
637 propagate6:
638 description:
639 - Propagate IPv6 route to adjacent virtual devices.
640 type: bool
641 specific_group:
642 description:
643 - Specific group for interface topology.<br/>Only for use with topology option 'internal_specific'.
644 type: str
645 topology:
646 description:
647 - Topology of this interface.<br/>Automatic topology calculation based on routes must be disabled for this VS.
648 type: str
649 choices: ['external', 'internal_undefined', 'internal_this_network', 'internal_specific', 'defined_by_routes']
650 set_vd_params:
651 description:
652 - Parameters for the operation to change the configuration of a Virtual Device.
653 type: dict
654 suboptions:
655 vd:
656 description:
657 - Name of the Virtual System, Virtual Switch, or Virtual Router.
658 type: str
659 calc_topology_auto:
660 description:
661 - Calculate interface topology automatically based on routes.<br/>Relevant only for Virtual Systems.<br/>Do not use for virtual devices.
662 type: bool
663 ipv4_address:
664 description:
665 - Main IPv4 Address.<br/>Relevant only if this device is a Virtual System.<br/>Do not use for other virtual devices.
666 type: str
667 ipv4_instances:
668 description:
669 - Number of IPv4 instances for the Virtual System.<br/>Must be greater or equal to 1.<br/>Only relevant for Virtual Systems and Virtual
670 Systems in bridge mode.
671 type: int
672 ipv6_address:
673 description:
674 - Main IPv6 Address.<br/>Relevant only if this device is a Virtual System.<br/>Do not use for other virtual devices.
675 type: str
676 ipv6_instances:
677 description:
678 - Number of IPv6 instances for the Virtual System.<br/>Only relevant for Virtual Systems and Virtual Systems in bridge mode.
679 type: int
680 vs_mtu:
681 description:
682 - MTU of the Virtual System.<br/>Only relevant for Virtual Systems in bridge mode.<br/>Do not use for other virtual devices.
683 type: int
684 extends_documentation_fragment: check_point.mgmt.checkpoint_commands
685 """
686
687 EXAMPLES = """
688 - name: vsx-provisioning-tool
689 cp_mgmt_vsx_provisioning_tool:
690 add_vsx_cluster_params:
691 cluster_type: vsls
692 ipv4_address: 10.1.1.15
693 members:
694 - ipv4_address: 10.1.1.1
695 name: VSX1
696 sic_otp: sicotp123
697 sync_ip: 192.168.1.1
698 - ipv4_address: 10.1.1.2
699 name: VSX2
700 sic_otp: sicotp123
701 sync_ip: 192.168.1.2
702 rule_drop: enable
703 rule_ping: enable
704 sync_if_name: eth3
705 sync_netmask: 255.255.255.0
706 vsx_version: R81.10
707 vsx_name: VSX_CLUSTER
708 operation: add-vsx-cluster
709 """
710
711 RETURN = """
712 cp_mgmt_vsx_provisioning_tool:
713 description: The checkpoint vsx-provisioning-tool output.
714 returned: always.
715 type: dict
716 """
717
718 from ansible.module_utils.basic import AnsibleModule
719 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_commands, api_command
720
721
722 def main():
723 argument_spec = dict(
724 operation=dict(type='str', choices=['attach-bridge', 'add-route', 'add-physical-interface',
725 'add-vd-interface', 'add-vsx-gateway', 'add-vsx-cluster', 'add-vd', 'remove-route', 'remove-vd', 'remove-vsx',
726 'remove-physical-interface', 'remove-vd-interface', 'set-vd', 'set-physical-interface', 'set-vd-interface']),
727 add_physical_interface_params=dict(type='dict', options=dict(
728 name=dict(type='str'),
729 vsx_name=dict(type='str'),
730 vlan_trunk=dict(type='bool')
731 )),
732 add_route_params=dict(type='dict', options=dict(
733 destination=dict(type='str'),
734 next_hop=dict(type='str'),
735 leads_to=dict(type='str'),
736 vd=dict(type='str'),
737 netmask=dict(type='str'),
738 prefix=dict(type='str'),
739 propagate=dict(type='bool')
740 )),
741 add_vd_interface_params=dict(type='dict', options=dict(
742 leads_to=dict(type='str'),
743 name=dict(type='str'),
744 vd=dict(type='str'),
745 anti_spoofing=dict(type='str', choices=['prevent', 'detect', 'off']),
746 anti_spoofing_tracking=dict(type='str', choices=['none', 'alert', 'log']),
747 ipv4_address=dict(type='str'),
748 ipv4_netmask=dict(type='str'),
749 ipv4_prefix=dict(type='str'),
750 ipv6_address=dict(type='str'),
751 ipv6_netmask=dict(type='str'),
752 ipv6_prefix=dict(type='str'),
753 mtu=dict(type='int'),
754 propagate=dict(type='bool'),
755 propagate6=dict(type='bool'),
756 specific_group=dict(type='str'),
757 topology=dict(type='str', choices=['external', 'internal_undefined', 'internal_this_network', 'internal_specific', 'defined_by_routes']),
758 vti_settings=dict(type='dict', options=dict(
759 local_ipv4_address=dict(type='str'),
760 peer_name=dict(type='str'),
761 remote_ipv4_address=dict(type='str'),
762 tunnel_id=dict(type='str')
763 ))
764 )),
765 add_vd_params=dict(type='dict', options=dict(
766 interfaces=dict(type='list', elements="dict", options=dict(
767 leads_to=dict(type='str'),
768 name=dict(type='str'),
769 anti_spoofing=dict(type='str', choices=['prevent', 'detect', 'off']),
770 anti_spoofing_tracking=dict(type='str', choices=['none', 'alert', 'log']),
771 ipv4_address=dict(type='str'),
772 ipv4_netmask=dict(type='str'),
773 ipv4_prefix=dict(type='str'),
774 ipv6_address=dict(type='str'),
775 ipv6_netmask=dict(type='str'),
776 ipv6_prefix=dict(type='str'),
777 mtu=dict(type='int'),
778 propagate=dict(type='bool'),
779 propagate6=dict(type='bool'),
780 specific_group=dict(type='str'),
781 topology=dict(type='str', choices=['external', 'internal_undefined', 'internal_this_network', 'internal_specific', 'defined_by_routes'])
782 )),
783 type=dict(type='str', choices=['vs', 'vr', 'vsw', 'vsbm']),
784 vd=dict(type='str'),
785 vsx_name=dict(type='str'),
786 calc_topology_auto=dict(type='bool'),
787 ipv4_address=dict(type='str'),
788 ipv4_instances=dict(type='int'),
789 ipv6_address=dict(type='str'),
790 ipv6_instances=dict(type='int'),
791 routes=dict(type='list', elements="dict", options=dict(
792 destination=dict(type='str'),
793 next_hop=dict(type='str'),
794 leads_to=dict(type='str'),
795 netmask=dict(type='str'),
796 prefix=dict(type='str'),
797 propagate=dict(type='bool')
798 )),
799 vs_mtu=dict(type='int')
800 )),
801 add_vsx_cluster_params=dict(type='dict', options=dict(
802 cluster_type=dict(type='str', choices=['vsls', 'ha']),
803 ipv4_address=dict(type='str'),
804 ipv6_address=dict(type='str'),
805 members=dict(type='list', elements="dict", options=dict(
806 ipv4_address=dict(type='str'),
807 ipv6_address=dict(type='str'),
808 name=dict(type='str'),
809 sic_otp=dict(type='str'),
810 sync_ip=dict(type='str')
811 )),
812 sync_if_name=dict(type='str'),
813 sync_netmask=dict(type='str'),
814 vsx_version=dict(type='str'),
815 vsx_name=dict(type='str'),
816 rule_drop=dict(type='str', choices=['enable', 'disable']),
817 rule_https=dict(type='str', choices=['enable', 'disable']),
818 rule_ping=dict(type='str', choices=['enable', 'disable']),
819 rule_ping6=dict(type='str', choices=['enable', 'disable']),
820 rule_snmp=dict(type='str', choices=['enable', 'disable']),
821 rule_ssh=dict(type='str', choices=['enable', 'disable'])
822 )),
823 add_vsx_gateway_params=dict(type='dict', options=dict(
824 ipv4_address=dict(type='str'),
825 ipv6_address=dict(type='str'),
826 sic_otp=dict(type='str'),
827 vsx_version=dict(type='str'),
828 vsx_name=dict(type='str'),
829 rule_drop=dict(type='str', choices=['enable', 'disable']),
830 rule_https=dict(type='str', choices=['enable', 'disable']),
831 rule_ping=dict(type='str', choices=['enable', 'disable']),
832 rule_ping6=dict(type='str', choices=['enable', 'disable']),
833 rule_snmp=dict(type='str', choices=['enable', 'disable']),
834 rule_ssh=dict(type='str', choices=['enable', 'disable'])
835 )),
836 attach_bridge_params=dict(type='dict', options=dict(
837 ifs1=dict(type='str'),
838 ifs2=dict(type='str'),
839 vd=dict(type='str')
840 )),
841 remove_physical_interface_params=dict(type='dict', options=dict(
842 name=dict(type='str'),
843 vsx_name=dict(type='str')
844 )),
845 remove_route_params=dict(type='dict', options=dict(
846 destination=dict(type='str'),
847 vd=dict(type='str'),
848 netmask=dict(type='str'),
849 prefix=dict(type='str')
850 )),
851 remove_vd_interface_params=dict(type='dict', options=dict(
852 leads_to=dict(type='str'),
853 name=dict(type='str'),
854 vd=dict(type='str')
855 )),
856 remove_vd_params=dict(type='dict', options=dict(
857 vd=dict(type='str')
858 )),
859 remove_vsx_params=dict(type='dict', options=dict(
860 vsx_name=dict(type='str')
861 )),
862 set_physical_interface_params=dict(type='dict', options=dict(
863 name=dict(type='str'),
864 vlan_trunk=dict(type='bool'),
865 vsx_name=dict(type='str')
866 )),
867 set_vd_interface_params=dict(type='dict', options=dict(
868 leads_to=dict(type='str'),
869 name=dict(type='str'),
870 vd=dict(type='str'),
871 anti_spoofing=dict(type='str', choices=['prevent', 'detect', 'off']),
872 anti_spoofing_tracking=dict(type='str', choices=['none', 'alert', 'log']),
873 ipv4_address=dict(type='str'),
874 ipv6_address=dict(type='str'),
875 mtu=dict(type='int'),
876 new_leads_to=dict(type='str'),
877 propagate=dict(type='bool'),
878 propagate6=dict(type='bool'),
879 specific_group=dict(type='str'),
880 topology=dict(type='str', choices=['external', 'internal_undefined', 'internal_this_network', 'internal_specific', 'defined_by_routes'])
881 )),
882 set_vd_params=dict(type='dict', options=dict(
883 vd=dict(type='str'),
884 calc_topology_auto=dict(type='bool'),
885 ipv4_address=dict(type='str'),
886 ipv4_instances=dict(type='int'),
887 ipv6_address=dict(type='str'),
888 ipv6_instances=dict(type='int'),
889 vs_mtu=dict(type='int')
890 ))
891 )
892 argument_spec.update(checkpoint_argument_spec_for_commands)
893
894 module = AnsibleModule(argument_spec=argument_spec)
895
896 command = "vsx-provisioning-tool"
897
898 result = api_command(module, command)
899 module.exit_json(**result)
900
901
902 if __name__ == '__main__':
903 main()