Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for VM and VM interface addition #57219

Open
wants to merge 11 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@axarriola
Copy link

commented May 31, 2019

SUMMARY

Added support for VM and VM interface creation.
VM addition was added in a new module called netbox_vm.
VM interface addition is under the same netbox_interface module. A new parameter called app was added to specify "dcim" or "virtualization".
The module_util netbox_utils had additions to support the search of interface by virtual_machine.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

netbox_utils.py
netbox_vm.py
netbox_interface.py

ADDITIONAL INFORMATION

Tested on Netbox v2.5.12

axarriola added some commits May 31, 2019

Added support for VM interface addition
Added support for VM interface addition
Module to create VMs in netbox
Module to create VMs in netbox
@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/module_utils/net_tools/netbox/netbox_utils.py:25:30: bad-whitespace Exactly one space required after comma     virtualization=["clusters","interfaces","virtual_machines"],                               ^
lib/ansible/module_utils/net_tools/netbox/netbox_utils.py:25:43: bad-whitespace Exactly one space required after comma     virtualization=["clusters","interfaces","virtual_machines"],                                            ^

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/module_utils/net_tools/netbox/netbox_utils.py:25:31: E231 missing whitespace after ','
lib/ansible/module_utils/net_tools/netbox/netbox_utils.py:25:44: E231 missing whitespace after ','

The test ansible-test sanity --test validate-modules [explain] failed with 8 errors:

lib/ansible/modules/net_tools/netbox/netbox_interface.py:0:0: E309 version_added for new option (app) should be '2.9'. Currently StrictVersion ('0.0')
lib/ansible/modules/net_tools/netbox/netbox_vm.py:0:0: E305 DOCUMENTATION.options.data.suboptions.disk.type: not a valid value for dictionary value @ data['options']['data']['suboptions']['disk']['type']. Got 'integer'
lib/ansible/modules/net_tools/netbox/netbox_vm.py:0:0: E305 DOCUMENTATION.options.data.suboptions.memory.type: not a valid value for dictionary value @ data['options']['data']['suboptions']['memory']['type']. Got 'integer'
lib/ansible/modules/net_tools/netbox/netbox_vm.py:0:0: E305 DOCUMENTATION.options.data.suboptions.primary_ip.type: not a valid value for dictionary value @ data['options']['data']['suboptions']['primary_ip']['type']. Got 'string'
lib/ansible/modules/net_tools/netbox/netbox_vm.py:0:0: E305 DOCUMENTATION.options.data.suboptions.primary_ip4.type: not a valid value for dictionary value @ data['options']['data']['suboptions']['primary_ip4']['type']. Got 'string'
lib/ansible/modules/net_tools/netbox/netbox_vm.py:0:0: E305 DOCUMENTATION.options.data.suboptions.primary_ip6.type: not a valid value for dictionary value @ data['options']['data']['suboptions']['primary_ip6']['type']. Got 'string'
lib/ansible/modules/net_tools/netbox/netbox_vm.py:0:0: E305 DOCUMENTATION.options.data.suboptions.vcpus.type: not a valid value for dictionary value @ data['options']['data']['suboptions']['vcpus']['type']. Got 'integer'
lib/ansible/modules/net_tools/netbox/netbox_vm.py:0:0: E307 version_added should be '2.9'. Currently '2.8'

click here for bot help

axarriola added some commits May 31, 2019

@ansibot ansibot removed the ci_verified label May 31, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

@Anthony25 @FragmentedPacket @amb1s1

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

Update netbox_interface.py
Added parameter documentation for data.virtual_machine.

@ansibot ansibot removed the stale_ci label Jun 12, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/net_tools/netbox/netbox_interface.py:47:87: W291 trailing whitespace

click here for bot help

@ansibot ansibot added the ci_verified label Jun 12, 2019

@ansibot ansibot removed the ci_verified label Jun 12, 2019

@axarriola

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

@FragmentedPacket I had to delete a trailing whitespace after adding the documentation, but it's done now.

@FragmentedPacket

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

@axarriola Awesome. Thanks for fixing those. I left some comments for the netbox_vm as well. Once those are taken care of, I'll be more than happy to approve this PR.

axarriola added some commits Jun 13, 2019

@axarriola

This comment has been minimized.

Copy link
Author

commented Jun 13, 2019

@FragmentedPacket I'm sorry, I don't see any comments for netbox_vm. I assumed it was the awful documentation and variable/function names I had. I made the mistake to not copy the full files, and forgot about those parts, I updated it. Please let me know if I need to change anything else.

@FragmentedPacket

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Thanks for changing that!

There are two other things:

  • I think the role needs to be changed as it is handled specifically by the ipam and should follow the device_role as that is where it pulls it. I believe I was getting an error when testing and using the role option and changing it to device_role fixed the issue of it failing.

  • Remove the primary_ip stuff or implement them as they aren't currently implemented within the netbox_device module; your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.