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

Add support for all new cloud models in Nautobot 2.3+ #434

Merged
merged 28 commits into from
Nov 11, 2024

Conversation

tsm1th
Copy link
Contributor

@tsm1th tsm1th commented Oct 31, 2024

This is the start of the work needed to close issues: #373 #375 #371 #372 #374

  • - Cloud Resource Type
  • - Coud Service
  • - Cloud Account
  • - Cloud Network

The PR has a dependency and is directly related to nautobot/pynautobot#248 in the https://github.com/nautobot/pynautobot repo.

@tsm1th tsm1th marked this pull request as draft October 31, 2024 11:28
@tsm1th
Copy link
Contributor Author

tsm1th commented Oct 31, 2024

@joewesch - Starting this PR to spark a conversation about an issue I discovered. In the new cloud resources, a cloud_resource_type has a provider attribute which actually maps to a manufacturer. These are two very different things in Nautobot: circuits.provider and dcim.manufacturer. I ran into issues developing this new module because pynautobot is querying circuits.provider because of the "auto" discovery nature of nautobot-ansible.

You can see how I overcame this in the cloud.py module. I'm having to trick it by swapping those names around. I am hoping there is a better way, but this solution does work.

@joewesch
Copy link
Contributor

@joewesch - Starting this PR to spark a conversation about an issue I discovered. In the new cloud resources, a cloud_resource_type has a provider attribute which actually maps to a manufacturer. These are two very different things in Nautobot: circuits.provider and dcim.manufacturer. I ran into issues developing this new module because pynautobot is querying circuits.provider because of the "auto" discovery nature of nautobot-ansible.

You can see how I overcame this in the cloud.py module. I'm having to trick it by swapping those names around. I am hoping there is a better way, but this solution does work.

We discussed this internally, but adding context here for transparency. I explained this sounds similar to how we dealt with name clashes in other modules. I suggested to review how we overcame this for location.parent (alias and key conversion)

@tsm1th
Copy link
Contributor Author

tsm1th commented Nov 2, 2024

Still need to add modules to support the many-to-many assignments.

  • - Cloud Service Network Assignments
  • - Cloud Network Prefix Assignments

@tsm1th
Copy link
Contributor Author

tsm1th commented Nov 3, 2024

This is complete and passing integration tests locally. Need PR approved and a release from pynautobot to update dependency for CI.

PYNAUTOBOT PR: nautobot/pynautobot#248

@tsm1th tsm1th linked an issue Nov 3, 2024 that may be closed by this pull request
plugins/modules/cloud_account.py Outdated Show resolved Hide resolved
plugins/modules/cloud_account.py Outdated Show resolved Hide resolved
plugins/modules/cloud_resource_type.py Outdated Show resolved Hide resolved
plugins/modules/cloud_service.py Show resolved Hide resolved
plugins/modules/cloud_service_network_assignment.py Outdated Show resolved Hide resolved
@tsm1th
Copy link
Contributor Author

tsm1th commented Nov 7, 2024

CI will pass once a patch is released in pynautobot and dependency is bumped. PR is submitted on that repo and awaiting approval: nautobot/pynautobot#253

@tsm1th
Copy link
Contributor Author

tsm1th commented Nov 8, 2024

Ok, got it now. Never use alternate name, use the alias instead. I should have got them all this time.

@joewesch joewesch merged commit 1727e35 into develop Nov 11, 2024
27 checks passed
@tsm1th tsm1th deleted the u/tsm1th-add-cloud-modules branch November 13, 2024 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants