|
313 | 313 | - test_five['interface']['enabled'] == false |
314 | 314 | - test_five['interface']['form_factor'] == 1000 |
315 | 315 | - test_five['interface']['mgmt_only'] == false |
316 | | - - test_five['interface']['lag'] == 4 |
| 316 | + - test_five['interface']['lag'] == 14 |
317 | 317 | - test_five['interface']['mode'] == 100 |
318 | 318 | - test_five['interface']['mtu'] == 1600 |
319 | 319 |
|
|
664 | 664 | - not test_thirteen['changed'] |
665 | 665 | - test_thirteen['msg'] == "ip_address 192.168.100.2/24 already exists" |
666 | 666 | - test_thirteen['ip_address']['address'] == "192.168.100.2/24" |
| 667 | + |
| 668 | + - name: "14 - Create IP address on Eth0 - test100-vm - State: present" |
| 669 | + netbox_ip_address: |
| 670 | + netbox_url: http://localhost.org:32768 |
| 671 | + netbox_token: 0123456789abcdef0123456789abcdef01234567 |
| 672 | + data: |
| 673 | + family: 4 |
| 674 | + address: 10.188.1.100/24 |
| 675 | + interface: |
| 676 | + name: Eth0 |
| 677 | + virtual_machine: test100-vm |
| 678 | + register: test_fourteen |
| 679 | + |
| 680 | + - name: "14 - ASSERT" |
| 681 | + assert: |
| 682 | + that: |
| 683 | + - test_fourteen is changed |
| 684 | + - test_fourteen['diff']['before']['state'] == "absent" |
| 685 | + - test_fourteen['diff']['after']['state'] == "present" |
| 686 | + - test_fourteen['msg'] == "ip_address 10.188.1.100/24 created" |
| 687 | + - test_fourteen['ip_address']['address'] == "10.188.1.100/24" |
| 688 | + - test_fourteen['ip_address']['family'] == 4 |
| 689 | + - test_fourteen['ip_address']['interface'] == 3 |
667 | 690 | ## |
668 | 691 | ## |
669 | 692 | ### NETBOX_PREFIX |
|
3443 | 3466 | netbox_token: 0123456789abcdef0123456789abcdef01234567 |
3444 | 3467 | data: |
3445 | 3468 | virtual_machine: "test100-vm" |
3446 | | - name: "Eth0" |
| 3469 | + name: "Eth10" |
3447 | 3470 | state: present |
3448 | 3471 | register: test_one |
3449 | 3472 |
|
|
3453 | 3476 | - test_one is changed |
3454 | 3477 | - test_one['diff']['before']['state'] == "absent" |
3455 | 3478 | - test_one['diff']['after']['state'] == "present" |
3456 | | - - test_one['interface']['name'] == "Eth0" |
| 3479 | + - test_one['interface']['name'] == "Eth10" |
3457 | 3480 | - test_one['interface']['virtual_machine'] == 1 |
3458 | | - - test_one['msg'] == "interface Eth0 created" |
| 3481 | + - test_one['msg'] == "interface Eth10 created" |
3459 | 3482 |
|
3460 | 3483 | - name: "NETBOX_VM_INTERFACE 2: Create duplicate" |
3461 | 3484 | netbox_vm_interface: |
3462 | 3485 | netbox_url: http://localhost:32768 |
3463 | 3486 | netbox_token: 0123456789abcdef0123456789abcdef01234567 |
3464 | 3487 | data: |
3465 | 3488 | virtual_machine: "test100-vm" |
3466 | | - name: "Eth0" |
| 3489 | + name: "Eth10" |
3467 | 3490 | state: present |
3468 | 3491 | register: test_two |
3469 | 3492 |
|
3470 | 3493 | - name: "NETBOX_VM_INTERFACE 2: ASSERT - Create duplicate" |
3471 | 3494 | assert: |
3472 | 3495 | that: |
3473 | 3496 | - not test_two['changed'] |
3474 | | - - test_two['interface']['name'] == "Eth0" |
| 3497 | + - test_two['interface']['name'] == "Eth10" |
3475 | 3498 | - test_two['interface']['virtual_machine'] == 1 |
3476 | | - - test_two['msg'] == "interface Eth0 already exists" |
| 3499 | + - test_two['msg'] == "interface Eth10 already exists" |
3477 | 3500 |
|
3478 | 3501 | - name: "NETBOX_VM_INTERFACE 3: Updated" |
3479 | 3502 | netbox_vm_interface: |
3480 | 3503 | netbox_url: http://localhost:32768 |
3481 | 3504 | netbox_token: 0123456789abcdef0123456789abcdef01234567 |
3482 | 3505 | data: |
3483 | 3506 | virtual_machine: "test100-vm" |
3484 | | - name: "Eth0" |
| 3507 | + name: "Eth10" |
3485 | 3508 | enabled: false |
3486 | 3509 | mtu: 9000 |
3487 | 3510 | mac_address: "00:00:00:AA:AA:01" |
|
3510 | 3533 | - test_three['diff']['after']['description'] == "Updated test100-vm" |
3511 | 3534 | - test_three['diff']['after']['mode'] == 200 |
3512 | 3535 | - test_three['diff']['after']['untagged_vlan'] == 1 |
3513 | | - - test_three['diff']['after']['tagged_vlans'][0] == 2 |
3514 | | - - test_three['diff']['after']['tagged_vlans'][1] == 3 |
| 3536 | + - test_three['diff']['after']['tagged_vlans'] == [2, 3] |
3515 | 3537 | - test_three['diff']['after']['tags'][0] == "Schnozzberry" |
3516 | | - - test_three['interface']['name'] == "Eth0" |
| 3538 | + - test_three['interface']['name'] == "Eth10" |
3517 | 3539 | - test_three['interface']['virtual_machine'] == 1 |
3518 | 3540 | - test_three['interface']['enabled'] == false |
3519 | 3541 | - test_three['interface']['mtu'] == 9000 |
3520 | 3542 | - test_three['interface']['mac_address'] == "00:00:00:AA:AA:01" |
3521 | 3543 | - test_three['interface']['description'] == "Updated test100-vm" |
3522 | 3544 | - test_three['interface']['mode'] == 200 |
3523 | 3545 | - test_three['interface']['untagged_vlan'] == 1 |
3524 | | - - test_three['interface']['tagged_vlans'][0] == 2 |
3525 | | - - test_three['interface']['tagged_vlans'][1] == 3 |
| 3546 | + - test_three['interface']['tagged_vlans'] == [2, 3] |
3526 | 3547 | - test_three['interface']['tags'][0] == "Schnozzberry" |
3527 | | - - test_three['msg'] == "interface Eth0 updated" |
| 3548 | + - test_three['msg'] == "interface Eth10 updated" |
3528 | 3549 |
|
3529 | 3550 | - name: "NETBOX_VM_INTERFACE 4: ASSERT - Delete" |
3530 | 3551 | netbox_vm_interface: |
3531 | 3552 | netbox_url: http://localhost:32768 |
3532 | 3553 | netbox_token: 0123456789abcdef0123456789abcdef01234567 |
3533 | 3554 | data: |
3534 | | - name: "Eth0" |
| 3555 | + name: "Eth10" |
3535 | 3556 | virtual_machine: "test100-vm" |
3536 | 3557 | state: absent |
3537 | 3558 | register: test_four |
|
3540 | 3561 | assert: |
3541 | 3562 | that: |
3542 | 3563 | - test_four is changed |
3543 | | - - test_four['interface']['name'] == "Eth0" |
| 3564 | + - test_four['interface']['name'] == "Eth10" |
3544 | 3565 | - test_four['interface']['virtual_machine'] == 1 |
3545 | | - - test_four['msg'] == "interface Eth0 deleted" |
| 3566 | + - test_four['msg'] == "interface Eth10 deleted" |
| 3567 | + |
| 3568 | + - name: "NETBOX_VM_INTERFACE 5: Attempt to update interface with same name on other VMs" |
| 3569 | + netbox_vm_interface: |
| 3570 | + netbox_url: http://localhost:32768 |
| 3571 | + netbox_token: 0123456789abcdef0123456789abcdef01234567 |
| 3572 | + data: |
| 3573 | + virtual_machine: "test100-vm" |
| 3574 | + name: "Eth0" |
| 3575 | + enabled: false |
| 3576 | + mtu: 9000 |
| 3577 | + mac_address: "00:00:00:AA:AA:01" |
| 3578 | + description: "Updated test100-vm Eth0 intf" |
| 3579 | + mode: Tagged |
| 3580 | + untagged_vlan: |
| 3581 | + name: Wireless |
| 3582 | + site: Test Site |
| 3583 | + tagged_vlans: |
| 3584 | + - name: Data |
| 3585 | + site: Test Site |
| 3586 | + - name: VoIP |
| 3587 | + site: Test Site |
| 3588 | + tags: |
| 3589 | + - Schnozzberry |
| 3590 | + state: present |
| 3591 | + register: test_five |
| 3592 | + |
| 3593 | + - name: "NETBOX_VM_INTERFACE 5: ASSERT - Updated" |
| 3594 | + assert: |
| 3595 | + that: |
| 3596 | + - test_five is changed |
| 3597 | + - test_five['diff']['after']['enabled'] == false |
| 3598 | + - test_five['diff']['after']['mtu'] == 9000 |
| 3599 | + - test_five['diff']['after']['mac_address'] == "00:00:00:AA:AA:01" |
| 3600 | + - test_five['diff']['after']['description'] == "Updated test100-vm Eth0 intf" |
| 3601 | + - test_five['diff']['after']['mode'] == 200 |
| 3602 | + - test_five['diff']['after']['untagged_vlan'] == 1 |
| 3603 | + - test_five['diff']['after']['tagged_vlans'] == [2, 3] |
| 3604 | + - test_five['diff']['after']['tags'][0] == "Schnozzberry" |
| 3605 | + - test_five['interface']['name'] == "Eth0" |
| 3606 | + - test_five['interface']['virtual_machine'] == 1 |
| 3607 | + - test_five['interface']['enabled'] == false |
| 3608 | + - test_five['interface']['mtu'] == 9000 |
| 3609 | + - test_five['interface']['mac_address'] == "00:00:00:AA:AA:01" |
| 3610 | + - test_five['interface']['description'] == "Updated test100-vm Eth0 intf" |
| 3611 | + - test_five['interface']['mode'] == 200 |
| 3612 | + - test_five['interface']['untagged_vlan'] == 1 |
| 3613 | + - test_five['interface']['tagged_vlans'] == [2, 3] |
| 3614 | + - test_five['interface']['tags'][0] == "Schnozzberry" |
| 3615 | + - test_five['msg'] == "interface Eth0 updated" |
3546 | 3616 | ## |
3547 | 3617 | ## |
3548 | 3618 | ### NETBOX_PROVIDER |
|
0 commit comments