| 1 |
|
| 2 |
from __future__ import absolute_import, division, print_function |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
__metaclass__ = type |
| 7 |
|
| 8 |
ANSIBLE_METADATA = {'status': ['preview'], |
| 9 |
'supported_by': 'community', |
| 10 |
'metadata_version': '1.1'} |
| 11 |
|
| 12 |
DOCUMENTATION = ''' |
| 13 |
--- |
| 14 |
module: fmgr_system_sdnconnector |
| 15 |
short_description: Configure connection to SDN Connector. |
| 16 |
version_added: "2.0.0" |
| 17 |
extends_documentation_fragment: |
| 18 |
- fortinet.fortimanager.general |
| 19 |
- fortinet.fortimanager.general.full_crud |
| 20 |
options: |
| 21 |
revision_note: |
| 22 |
description: The change note that can be specified when an object is created or updated. |
| 23 |
type: str |
| 24 |
adom: |
| 25 |
description: The parameter (adom) in requested url. |
| 26 |
type: str |
| 27 |
required: true |
| 28 |
system_sdnconnector: |
| 29 |
description: The top level parameters set. |
| 30 |
required: false |
| 31 |
type: dict |
| 32 |
suboptions: |
| 33 |
_local_cert: |
| 34 |
type: str |
| 35 |
description: Local cert. |
| 36 |
access_key: |
| 37 |
aliases: ['access-key'] |
| 38 |
type: str |
| 39 |
description: AWS access key ID. |
| 40 |
azure_region: |
| 41 |
aliases: ['azure-region'] |
| 42 |
type: str |
| 43 |
description: Azure server region. |
| 44 |
choices: ['global', 'china', 'germany', 'usgov', 'local'] |
| 45 |
client_id: |
| 46 |
aliases: ['client-id'] |
| 47 |
type: str |
| 48 |
description: Azure client ID |
| 49 |
client_secret: |
| 50 |
aliases: ['client-secret'] |
| 51 |
type: raw |
| 52 |
description: (list) Azure client secret |
| 53 |
compartment_id: |
| 54 |
aliases: ['compartment-id'] |
| 55 |
type: str |
| 56 |
description: Compartment ID. |
| 57 |
external_ip: |
| 58 |
aliases: ['external-ip'] |
| 59 |
type: list |
| 60 |
elements: dict |
| 61 |
description: External ip. |
| 62 |
suboptions: |
| 63 |
name: |
| 64 |
type: str |
| 65 |
description: External IP name. |
| 66 |
gcp_project: |
| 67 |
aliases: ['gcp-project'] |
| 68 |
type: str |
| 69 |
description: GCP project name. |
| 70 |
key_passwd: |
| 71 |
aliases: ['key-passwd'] |
| 72 |
type: raw |
| 73 |
description: (list) Private key password. |
| 74 |
login_endpoint: |
| 75 |
aliases: ['login-endpoint'] |
| 76 |
type: str |
| 77 |
description: Azure Stack login enpoint. |
| 78 |
name: |
| 79 |
type: str |
| 80 |
description: SDN connector name. |
| 81 |
required: true |
| 82 |
nic: |
| 83 |
type: list |
| 84 |
elements: dict |
| 85 |
description: Nic. |
| 86 |
suboptions: |
| 87 |
ip: |
| 88 |
type: list |
| 89 |
elements: dict |
| 90 |
description: Ip. |
| 91 |
suboptions: |
| 92 |
name: |
| 93 |
type: str |
| 94 |
description: IP configuration name. |
| 95 |
public_ip: |
| 96 |
aliases: ['public-ip'] |
| 97 |
type: str |
| 98 |
description: Public IP name. |
| 99 |
resource_group: |
| 100 |
aliases: ['resource-group'] |
| 101 |
type: str |
| 102 |
description: Resource group of Azure public IP. |
| 103 |
private_ip: |
| 104 |
aliases: ['private-ip'] |
| 105 |
type: str |
| 106 |
description: Private IP address. |
| 107 |
name: |
| 108 |
type: str |
| 109 |
description: Network interface name. |
| 110 |
peer_nic: |
| 111 |
aliases: ['peer-nic'] |
| 112 |
type: str |
| 113 |
description: Peer network interface name. |
| 114 |
nsx_cert_fingerprint: |
| 115 |
aliases: ['nsx-cert-fingerprint'] |
| 116 |
type: str |
| 117 |
description: NSX certificate fingerprint. |
| 118 |
oci_cert: |
| 119 |
aliases: ['oci-cert'] |
| 120 |
type: str |
| 121 |
description: OCI certificate. |
| 122 |
oci_fingerprint: |
| 123 |
aliases: ['oci-fingerprint'] |
| 124 |
type: str |
| 125 |
description: Oci fingerprint. |
| 126 |
oci_region: |
| 127 |
aliases: ['oci-region'] |
| 128 |
type: str |
| 129 |
description: OCI server region. |
| 130 |
choices: ['phoenix', 'ashburn', 'frankfurt', 'london', 'toronto'] |
| 131 |
password: |
| 132 |
type: raw |
| 133 |
description: (list) Password of the remote SDN connector as login credentials. |
| 134 |
private_key: |
| 135 |
aliases: ['private-key'] |
| 136 |
type: str |
| 137 |
description: Private key of GCP service account. |
| 138 |
region: |
| 139 |
type: str |
| 140 |
description: AWS region name. |
| 141 |
resource_group: |
| 142 |
aliases: ['resource-group'] |
| 143 |
type: str |
| 144 |
description: Azure resource group. |
| 145 |
resource_url: |
| 146 |
aliases: ['resource-url'] |
| 147 |
type: str |
| 148 |
description: Azure Stack resource URL. |
| 149 |
rest_interface: |
| 150 |
aliases: ['rest-interface'] |
| 151 |
type: str |
| 152 |
description: Interface name for REST service to listen on. |
| 153 |
choices: ['mgmt', 'sync'] |
| 154 |
rest_password: |
| 155 |
aliases: ['rest-password'] |
| 156 |
type: raw |
| 157 |
description: (list) Password for REST service. |
| 158 |
rest_sport: |
| 159 |
aliases: ['rest-sport'] |
| 160 |
type: int |
| 161 |
description: REST service access port |
| 162 |
rest_ssl: |
| 163 |
aliases: ['rest-ssl'] |
| 164 |
type: str |
| 165 |
description: Rest ssl. |
| 166 |
choices: ['disable', 'enable'] |
| 167 |
route: |
| 168 |
type: list |
| 169 |
elements: dict |
| 170 |
description: Route. |
| 171 |
suboptions: |
| 172 |
name: |
| 173 |
type: str |
| 174 |
description: Route name. |
| 175 |
route_table: |
| 176 |
aliases: ['route-table'] |
| 177 |
type: list |
| 178 |
elements: dict |
| 179 |
description: Route table. |
| 180 |
suboptions: |
| 181 |
name: |
| 182 |
type: str |
| 183 |
description: Route table name. |
| 184 |
route: |
| 185 |
type: list |
| 186 |
elements: dict |
| 187 |
description: Route. |
| 188 |
suboptions: |
| 189 |
name: |
| 190 |
type: str |
| 191 |
description: Route name. |
| 192 |
next_hop: |
| 193 |
aliases: ['next-hop'] |
| 194 |
type: str |
| 195 |
description: Next hop address. |
| 196 |
resource_group: |
| 197 |
aliases: ['resource-group'] |
| 198 |
type: str |
| 199 |
description: Resource group of Azure route table. |
| 200 |
subscription_id: |
| 201 |
aliases: ['subscription-id'] |
| 202 |
type: str |
| 203 |
description: Subscription ID of Azure route table. |
| 204 |
secret_key: |
| 205 |
aliases: ['secret-key'] |
| 206 |
type: raw |
| 207 |
description: (list) AWS secret access key. |
| 208 |
server: |
| 209 |
type: str |
| 210 |
description: Server address of the remote SDN connector. |
| 211 |
server_port: |
| 212 |
aliases: ['server-port'] |
| 213 |
type: int |
| 214 |
description: Port number of the remote SDN connector. |
| 215 |
service_account: |
| 216 |
aliases: ['service-account'] |
| 217 |
type: str |
| 218 |
description: GCP service account email. |
| 219 |
status: |
| 220 |
type: str |
| 221 |
description: Enable/disable connection to the remote SDN connector. |
| 222 |
choices: ['disable', 'enable'] |
| 223 |
subscription_id: |
| 224 |
aliases: ['subscription-id'] |
| 225 |
type: str |
| 226 |
description: Azure subscription ID. |
| 227 |
tenant_id: |
| 228 |
aliases: ['tenant-id'] |
| 229 |
type: str |
| 230 |
description: Tenant ID |
| 231 |
type: |
| 232 |
type: str |
| 233 |
description: Type of SDN connector. |
| 234 |
choices: ['aci', 'aws', 'nsx', 'nuage', 'azure', 'gcp', 'oci', 'openstack', |
| 235 |
'kubernetes', 'vmware', 'acs', 'alicloud', 'sepm', 'aci-direct', 'ibm', |
| 236 |
'nutanix', 'sap'] |
| 237 |
update_interval: |
| 238 |
aliases: ['update-interval'] |
| 239 |
type: int |
| 240 |
description: Dynamic object update interval |
| 241 |
use_metadata_iam: |
| 242 |
aliases: ['use-metadata-iam'] |
| 243 |
type: str |
| 244 |
description: Enable/disable using IAM role from metadata to call API. |
| 245 |
choices: ['disable', 'enable'] |
| 246 |
user_id: |
| 247 |
aliases: ['user-id'] |
| 248 |
type: str |
| 249 |
description: User ID. |
| 250 |
username: |
| 251 |
type: str |
| 252 |
description: Username of the remote SDN connector as login credentials. |
| 253 |
vmx_image_url: |
| 254 |
aliases: ['vmx-image-url'] |
| 255 |
type: str |
| 256 |
description: URL of web-hosted VMX image. |
| 257 |
vmx_service_name: |
| 258 |
aliases: ['vmx-service-name'] |
| 259 |
type: str |
| 260 |
description: VMX Service name. |
| 261 |
vpc_id: |
| 262 |
aliases: ['vpc-id'] |
| 263 |
type: str |
| 264 |
description: AWS VPC ID. |
| 265 |
domain: |
| 266 |
type: str |
| 267 |
description: Openstack domain. |
| 268 |
ha_status: |
| 269 |
aliases: ['ha-status'] |
| 270 |
type: str |
| 271 |
description: Enable/disable use for FortiGate HA service. |
| 272 |
choices: ['disable', 'enable'] |
| 273 |
last_update: |
| 274 |
aliases: ['last-update'] |
| 275 |
type: int |
| 276 |
description: Last update. |
| 277 |
oci_region_type: |
| 278 |
aliases: ['oci-region-type'] |
| 279 |
type: str |
| 280 |
description: OCI region type. |
| 281 |
choices: ['commercial', 'government'] |
| 282 |
secret_token: |
| 283 |
aliases: ['secret-token'] |
| 284 |
type: str |
| 285 |
description: Secret token of Kubernetes service account. |
| 286 |
updating: |
| 287 |
type: int |
| 288 |
description: Updating. |
| 289 |
server_ip: |
| 290 |
aliases: ['server-ip'] |
| 291 |
type: str |
| 292 |
description: IP address of the remote SDN connector. |
| 293 |
group_name: |
| 294 |
aliases: ['group-name'] |
| 295 |
type: str |
| 296 |
description: Group name of computers. |
| 297 |
api_key: |
| 298 |
aliases: ['api-key'] |
| 299 |
type: raw |
| 300 |
description: (list) IBM cloud API key or service ID API key. |
| 301 |
compute_generation: |
| 302 |
aliases: ['compute-generation'] |
| 303 |
type: int |
| 304 |
description: Compute generation for IBM cloud infrastructure. |
| 305 |
ibm_region: |
| 306 |
aliases: ['ibm-region'] |
| 307 |
type: str |
| 308 |
description: IBM cloud region name. |
| 309 |
choices: ['us-south', 'us-east', 'germany', 'great-britain', 'japan', 'australia', |
| 310 |
'dallas', 'washington-dc', 'london', 'frankfurt', 'sydney', 'tokyo', |
| 311 |
'osaka', 'toronto', 'sao-paulo', 'dallas-private', |
| 312 |
'washington-dc-private', 'london-private', 'frankfurt-private', |
| 313 |
'sydney-private', 'tokyo-private', 'osaka-private', 'toronto-private', |
| 314 |
'sao-paulo-private', 'madrid', 'madrid-private'] |
| 315 |
ibm_region_gen1: |
| 316 |
aliases: ['ibm-region-gen1'] |
| 317 |
type: str |
| 318 |
description: Ibm region gen1. |
| 319 |
choices: ['us-south', 'us-east', 'germany', 'great-britain', 'japan', 'australia'] |
| 320 |
ibm_region_gen2: |
| 321 |
aliases: ['ibm-region-gen2'] |
| 322 |
type: str |
| 323 |
description: Ibm region gen2. |
| 324 |
choices: ['us-south', 'us-east', 'great-britain'] |
| 325 |
vcenter_password: |
| 326 |
aliases: ['vcenter-password'] |
| 327 |
type: raw |
| 328 |
description: (list) VCenter server password for NSX quarantine. |
| 329 |
vcenter_server: |
| 330 |
aliases: ['vcenter-server'] |
| 331 |
type: str |
| 332 |
description: VCenter server address for NSX quarantine. |
| 333 |
vcenter_username: |
| 334 |
aliases: ['vcenter-username'] |
| 335 |
type: str |
| 336 |
description: VCenter server username for NSX quarantine. |
| 337 |
server_list: |
| 338 |
aliases: ['server-list'] |
| 339 |
type: raw |
| 340 |
description: (list) Server address list of the remote SDN connector. |
| 341 |
external_account_list: |
| 342 |
aliases: ['external-account-list'] |
| 343 |
type: list |
| 344 |
elements: dict |
| 345 |
description: External account list. |
| 346 |
suboptions: |
| 347 |
region_list: |
| 348 |
aliases: ['region-list'] |
| 349 |
type: raw |
| 350 |
description: (list) AWS region name list. |
| 351 |
role_arn: |
| 352 |
aliases: ['role-arn'] |
| 353 |
type: str |
| 354 |
description: AWS role ARN to assume. |
| 355 |
external_id: |
| 356 |
aliases: ['external-id'] |
| 357 |
type: str |
| 358 |
description: AWS external ID. |
| 359 |
forwarding_rule: |
| 360 |
aliases: ['forwarding-rule'] |
| 361 |
type: list |
| 362 |
elements: dict |
| 363 |
description: Forwarding rule. |
| 364 |
suboptions: |
| 365 |
rule_name: |
| 366 |
aliases: ['rule-name'] |
| 367 |
type: str |
| 368 |
description: Forwarding rule name. |
| 369 |
target: |
| 370 |
type: str |
| 371 |
description: Target instance name. |
| 372 |
gcp_project_list: |
| 373 |
aliases: ['gcp-project-list'] |
| 374 |
type: list |
| 375 |
elements: dict |
| 376 |
description: Gcp project list. |
| 377 |
suboptions: |
| 378 |
gcp_zone_list: |
| 379 |
aliases: ['gcp-zone-list'] |
| 380 |
type: raw |
| 381 |
description: (list) Configure GCP zone list. |
| 382 |
id: |
| 383 |
type: str |
| 384 |
description: GCP project ID. |
| 385 |
verify_certificate: |
| 386 |
aliases: ['verify-certificate'] |
| 387 |
type: str |
| 388 |
description: Enable/disable server certificate verification. |
| 389 |
choices: ['disable', 'enable'] |
| 390 |
alt_resource_ip: |
| 391 |
aliases: ['alt-resource-ip'] |
| 392 |
type: str |
| 393 |
description: Enable/disable AWS alternative resource IP. |
| 394 |
choices: ['disable', 'enable'] |
| 395 |
server_ca_cert: |
| 396 |
aliases: ['server-ca-cert'] |
| 397 |
type: str |
| 398 |
description: Trust only those servers whose certificate is directly/indirectly signed by this certificate. |
| 399 |
server_cert: |
| 400 |
aliases: ['server-cert'] |
| 401 |
type: str |
| 402 |
description: Trust servers that contain this certificate only. |
| 403 |
compartment_list: |
| 404 |
aliases: ['compartment-list'] |
| 405 |
type: list |
| 406 |
elements: dict |
| 407 |
description: Compartment list. |
| 408 |
suboptions: |
| 409 |
compartment_id: |
| 410 |
aliases: ['compartment-id'] |
| 411 |
type: str |
| 412 |
description: OCI compartment ID. |
| 413 |
oci_region_list: |
| 414 |
aliases: ['oci-region-list'] |
| 415 |
type: list |
| 416 |
elements: dict |
| 417 |
description: Oci region list. |
| 418 |
suboptions: |
| 419 |
region: |
| 420 |
type: str |
| 421 |
description: OCI region. |
| 422 |
proxy: |
| 423 |
type: str |
| 424 |
description: SDN proxy. |
| 425 |
message_server_port: |
| 426 |
aliases: ['message-server-port'] |
| 427 |
type: int |
| 428 |
description: HTTP port number of the SAP message server. |
| 429 |
microsoft_365: |
| 430 |
aliases: ['microsoft-365'] |
| 431 |
type: str |
| 432 |
description: Enable to use as Microsoft 365 connector. |
| 433 |
choices: ['disable', 'enable'] |
| 434 |
vdom: |
| 435 |
type: raw |
| 436 |
description: (list) Virtual domain name of the remote SDN connector. |
| 437 |
par_id: |
| 438 |
aliases: ['par-id'] |
| 439 |
type: str |
| 440 |
description: Public address range ID. |
| 441 |
''' |
| 442 |
|
| 443 |
EXAMPLES = ''' |
| 444 |
- name: Example playbook |
| 445 |
hosts: fortimanagers |
| 446 |
gather_facts: false |
| 447 |
connection: httpapi |
| 448 |
vars: |
| 449 |
ansible_httpapi_use_ssl: true |
| 450 |
ansible_httpapi_validate_certs: false |
| 451 |
ansible_httpapi_port: 443 |
| 452 |
tasks: |
| 453 |
- name: Configure connection to SDN Connector. |
| 454 |
fortinet.fortimanager.fmgr_system_sdnconnector: |
| 455 |
bypass_validation: false |
| 456 |
adom: ansible |
| 457 |
state: present |
| 458 |
system_sdnconnector: |
| 459 |
azure_region: global # <value in [global, china, germany, ...]> |
| 460 |
# compartment_id: 1 |
| 461 |
name: ansible-test-sdn |
| 462 |
password: fortinet |
| 463 |
server: ALL |
| 464 |
status: disable |
| 465 |
type: aws # <value in [aci, aws, nsx, ...]> |
| 466 |
|
| 467 |
- name: Gathering fortimanager facts |
| 468 |
hosts: fortimanagers |
| 469 |
gather_facts: false |
| 470 |
connection: httpapi |
| 471 |
vars: |
| 472 |
ansible_httpapi_use_ssl: true |
| 473 |
ansible_httpapi_validate_certs: false |
| 474 |
ansible_httpapi_port: 443 |
| 475 |
tasks: |
| 476 |
- name: Retrieve all the connections to SDN Connector |
| 477 |
fortinet.fortimanager.fmgr_fact: |
| 478 |
facts: |
| 479 |
selector: "system_sdnconnector" |
| 480 |
params: |
| 481 |
adom: "ansible" |
| 482 |
sdn_connector: "your_value" |
| 483 |
''' |
| 484 |
|
| 485 |
RETURN = ''' |
| 486 |
meta: |
| 487 |
description: The result of the request. |
| 488 |
type: dict |
| 489 |
returned: always |
| 490 |
contains: |
| 491 |
request_url: |
| 492 |
description: The full url requested. |
| 493 |
returned: always |
| 494 |
type: str |
| 495 |
sample: /sys/login/user |
| 496 |
response_code: |
| 497 |
description: The status of api request. |
| 498 |
returned: always |
| 499 |
type: int |
| 500 |
sample: 0 |
| 501 |
response_data: |
| 502 |
description: The api response. |
| 503 |
type: list |
| 504 |
returned: always |
| 505 |
response_message: |
| 506 |
description: The descriptive message of the api response. |
| 507 |
type: str |
| 508 |
returned: always |
| 509 |
sample: OK. |
| 510 |
system_information: |
| 511 |
description: The information of the target system. |
| 512 |
type: dict |
| 513 |
returned: always |
| 514 |
rc: |
| 515 |
description: The status the request. |
| 516 |
type: int |
| 517 |
returned: always |
| 518 |
sample: 0 |
| 519 |
version_check_warning: |
| 520 |
description: Warning if the parameters used in the playbook are not supported by the current FortiManager version. |
| 521 |
type: list |
| 522 |
returned: complex |
| 523 |
''' |
| 524 |
from ansible.module_utils.basic import AnsibleModule |
| 525 |
from ansible.module_utils.connection import Connection |
| 526 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass |
| 527 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec |
| 528 |
|
| 529 |
|
| 530 |
def main(): |
| 531 |
urls_list = [ |
| 532 |
'/pm/config/adom/{adom}/obj/system/sdn-connector', |
| 533 |
'/pm/config/global/obj/system/sdn-connector' |
| 534 |
] |
| 535 |
module_arg_spec = { |
| 536 |
'adom': {'required': True, 'type': 'str'}, |
| 537 |
'revision_note': {'type': 'str'}, |
| 538 |
'system_sdnconnector': { |
| 539 |
'type': 'dict', 'v_range': [['6.0.0', '']], |
| 540 |
'options': { |
| 541 |
'_local_cert': {'type': 'str'}, |
| 542 |
'access-key': {'no_log': True, 'type': 'str'}, |
| 543 |
'azure-region': {'choices': ['global', 'china', 'germany', 'usgov', 'local'], 'type': 'str'}, |
| 544 |
'client-id': {'type': 'str'}, |
| 545 |
'client-secret': {'no_log': True, 'type': 'raw'}, |
| 546 |
'compartment-id': {'type': 'str'}, |
| 547 |
'external-ip': {'type': 'list', 'options': {'name': {'type': 'str'}}, 'elements': 'dict'}, |
| 548 |
'gcp-project': {'type': 'str'}, |
| 549 |
'key-passwd': {'no_log': True, 'type': 'raw'}, |
| 550 |
'login-endpoint': {'type': 'str'}, |
| 551 |
'name': {'required': True, 'type': 'str'}, |
| 552 |
'nic': { |
| 553 |
'type': 'list', |
| 554 |
'options': { |
| 555 |
'ip': { |
| 556 |
'type': 'list', |
| 557 |
'options': { |
| 558 |
'name': {'type': 'str'}, |
| 559 |
'public-ip': {'type': 'str'}, |
| 560 |
'resource-group': {'v_range': [['6.2.3', '']], 'type': 'str'}, |
| 561 |
'private-ip': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'} |
| 562 |
}, |
| 563 |
'elements': 'dict' |
| 564 |
}, |
| 565 |
'name': {'type': 'str'}, |
| 566 |
'peer-nic': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'} |
| 567 |
}, |
| 568 |
'elements': 'dict' |
| 569 |
}, |
| 570 |
'nsx-cert-fingerprint': {'type': 'str'}, |
| 571 |
'oci-cert': {'type': 'str'}, |
| 572 |
'oci-fingerprint': {'type': 'str'}, |
| 573 |
'oci-region': {'choices': ['phoenix', 'ashburn', 'frankfurt', 'london', 'toronto'], 'type': 'str'}, |
| 574 |
'password': {'no_log': True, 'type': 'raw'}, |
| 575 |
'private-key': {'no_log': True, 'type': 'str'}, |
| 576 |
'region': {'type': 'str'}, |
| 577 |
'resource-group': {'type': 'str'}, |
| 578 |
'resource-url': {'type': 'str'}, |
| 579 |
'rest-interface': {'choices': ['mgmt', 'sync'], 'type': 'str'}, |
| 580 |
'rest-password': {'no_log': True, 'type': 'raw'}, |
| 581 |
'rest-sport': {'type': 'int'}, |
| 582 |
'rest-ssl': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 583 |
'route': {'type': 'list', 'options': {'name': {'type': 'str'}}, 'elements': 'dict'}, |
| 584 |
'route-table': { |
| 585 |
'type': 'list', |
| 586 |
'options': { |
| 587 |
'name': {'type': 'str'}, |
| 588 |
'route': {'type': 'list', 'options': {'name': {'type': 'str'}, 'next-hop': {'type': 'str'}}, 'elements': 'dict'}, |
| 589 |
'resource-group': {'v_range': [['6.2.3', '']], 'type': 'str'}, |
| 590 |
'subscription-id': {'v_range': [['6.2.6', '6.2.13'], ['6.4.1', '']], 'type': 'str'} |
| 591 |
}, |
| 592 |
'elements': 'dict' |
| 593 |
}, |
| 594 |
'secret-key': {'no_log': True, 'type': 'raw'}, |
| 595 |
'server': {'type': 'str'}, |
| 596 |
'server-port': {'type': 'int'}, |
| 597 |
'service-account': {'type': 'str'}, |
| 598 |
'status': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 599 |
'subscription-id': {'type': 'str'}, |
| 600 |
'tenant-id': {'type': 'str'}, |
| 601 |
'type': { |
| 602 |
'choices': [ |
| 603 |
'aci', 'aws', 'nsx', 'nuage', 'azure', 'gcp', 'oci', 'openstack', 'kubernetes', 'vmware', 'acs', 'alicloud', 'sepm', |
| 604 |
'aci-direct', 'ibm', 'nutanix', 'sap' |
| 605 |
], |
| 606 |
'type': 'str' |
| 607 |
}, |
| 608 |
'update-interval': {'type': 'int'}, |
| 609 |
'use-metadata-iam': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 610 |
'user-id': {'type': 'str'}, |
| 611 |
'username': {'type': 'str'}, |
| 612 |
'vmx-image-url': {'type': 'str'}, |
| 613 |
'vmx-service-name': {'type': 'str'}, |
| 614 |
'vpc-id': {'type': 'str'}, |
| 615 |
'domain': {'v_range': [['6.2.0', '']], 'type': 'str'}, |
| 616 |
'ha-status': {'v_range': [['6.2.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 617 |
'last-update': {'v_range': [['6.2.1', '7.2.0']], 'type': 'int'}, |
| 618 |
'oci-region-type': {'v_range': [['6.2.1', '']], 'choices': ['commercial', 'government'], 'type': 'str'}, |
| 619 |
'secret-token': {'v_range': [['6.2.0', '']], 'no_log': True, 'type': 'str'}, |
| 620 |
'updating': {'v_range': [['6.2.1', '7.2.0']], 'type': 'int'}, |
| 621 |
'server-ip': {'v_range': [['6.2.0', '6.4.15'], ['7.4.8', '7.4.10']], 'type': 'str'}, |
| 622 |
'group-name': {'v_range': [['6.2.2', '']], 'type': 'str'}, |
| 623 |
'api-key': {'v_range': [['6.4.1', '']], 'no_log': True, 'type': 'raw'}, |
| 624 |
'compute-generation': {'v_range': [['6.4.1', '']], 'type': 'int'}, |
| 625 |
'ibm-region': { |
| 626 |
'v_range': [['6.4.2', '']], |
| 627 |
'choices': [ |
| 628 |
'us-south', 'us-east', 'germany', 'great-britain', 'japan', 'australia', 'dallas', 'washington-dc', 'london', 'frankfurt', |
| 629 |
'sydney', 'tokyo', 'osaka', 'toronto', 'sao-paulo', 'dallas-private', 'washington-dc-private', 'london-private', |
| 630 |
'frankfurt-private', 'sydney-private', 'tokyo-private', 'osaka-private', 'toronto-private', 'sao-paulo-private', 'madrid', |
| 631 |
'madrid-private' |
| 632 |
], |
| 633 |
'type': 'str' |
| 634 |
}, |
| 635 |
'ibm-region-gen1': { |
| 636 |
'v_range': [['6.4.1', '']], |
| 637 |
'choices': ['us-south', 'us-east', 'germany', 'great-britain', 'japan', 'australia'], |
| 638 |
'type': 'str' |
| 639 |
}, |
| 640 |
'ibm-region-gen2': {'v_range': [['6.4.1', '']], 'choices': ['us-south', 'us-east', 'great-britain'], 'type': 'str'}, |
| 641 |
'vcenter-password': {'v_range': [['6.4.1', '']], 'no_log': True, 'type': 'raw'}, |
| 642 |
'vcenter-server': {'v_range': [['6.4.1', '']], 'type': 'str'}, |
| 643 |
'vcenter-username': {'v_range': [['6.4.1', '']], 'type': 'str'}, |
| 644 |
'server-list': {'v_range': [['6.4.4', '']], 'type': 'raw'}, |
| 645 |
'external-account-list': { |
| 646 |
'v_range': [['7.0.3', '']], |
| 647 |
'type': 'list', |
| 648 |
'options': { |
| 649 |
'region-list': {'v_range': [['7.0.3', '']], 'type': 'raw'}, |
| 650 |
'role-arn': {'v_range': [['7.0.3', '']], 'type': 'str'}, |
| 651 |
'external-id': {'v_range': [['7.0.5', '7.0.16'], ['7.2.1', '']], 'type': 'str'} |
| 652 |
}, |
| 653 |
'elements': 'dict' |
| 654 |
}, |
| 655 |
'forwarding-rule': { |
| 656 |
'v_range': [['7.0.2', '']], |
| 657 |
'type': 'list', |
| 658 |
'options': {'rule-name': {'v_range': [['7.0.2', '']], 'type': 'str'}, 'target': {'v_range': [['7.0.2', '']], 'type': 'str'}}, |
| 659 |
'elements': 'dict' |
| 660 |
}, |
| 661 |
'gcp-project-list': { |
| 662 |
'v_range': [['6.4.7', '6.4.15'], ['7.0.2', '']], |
| 663 |
'type': 'list', |
| 664 |
'options': { |
| 665 |
'gcp-zone-list': {'v_range': [['6.4.7', '6.4.15'], ['7.0.2', '']], 'type': 'raw'}, |
| 666 |
'id': {'v_range': [['6.4.7', '6.4.15'], ['7.0.2', '']], 'type': 'str'} |
| 667 |
}, |
| 668 |
'elements': 'dict' |
| 669 |
}, |
| 670 |
'verify-certificate': {'v_range': [['6.4.8', '6.4.15'], ['7.0.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 671 |
'alt-resource-ip': {'v_range': [['7.2.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 672 |
'server-ca-cert': {'v_range': [['7.2.2', '']], 'type': 'str'}, |
| 673 |
'server-cert': {'v_range': [['7.2.2', '']], 'type': 'str'}, |
| 674 |
'compartment-list': { |
| 675 |
'v_range': [['7.4.0', '']], |
| 676 |
'type': 'list', |
| 677 |
'options': {'compartment-id': {'v_range': [['7.4.0', '']], 'type': 'str'}}, |
| 678 |
'elements': 'dict' |
| 679 |
}, |
| 680 |
'oci-region-list': { |
| 681 |
'v_range': [['7.4.0', '']], |
| 682 |
'type': 'list', |
| 683 |
'options': {'region': {'v_range': [['7.4.0', '']], 'type': 'str'}}, |
| 684 |
'elements': 'dict' |
| 685 |
}, |
| 686 |
'proxy': {'v_range': [['7.4.0', '']], 'type': 'str'}, |
| 687 |
'message-server-port': {'v_range': [['7.6.2', '']], 'type': 'int'}, |
| 688 |
'microsoft-365': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 689 |
'vdom': {'v_range': [['7.6.3', '']], 'type': 'raw'}, |
| 690 |
'par-id': {'v_range': [['7.6.5', '']], 'type': 'str'} |
| 691 |
} |
| 692 |
} |
| 693 |
} |
| 694 |
|
| 695 |
module_option_spec = get_module_arg_spec('full crud') |
| 696 |
module_arg_spec.update(module_option_spec) |
| 697 |
check_galaxy_version(module_arg_spec) |
| 698 |
module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_sdnconnector'), |
| 699 |
supports_check_mode=True) |
| 700 |
if not module._socket_path: |
| 701 |
module.fail_json(msg='MUST RUN IN HTTPAPI MODE') |
| 702 |
connection = Connection(module._socket_path) |
| 703 |
fmgr = NAPIManager('full crud', module_arg_spec, urls_list, |
| 704 |
'name', 'data', module, connection) |
| 705 |
fmgr.process_crud() |
| 706 |
module.exit_json(meta=module.params) |
| 707 |
|
| 708 |
|
| 709 |
if __name__ == '__main__': |
| 710 |
main() |