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

Duplicate IPs in different sections #57

Closed
calloes opened this issue Feb 8, 2023 · 2 comments
Closed

Duplicate IPs in different sections #57

calloes opened this issue Feb 8, 2023 · 2 comments

Comments

@calloes
Copy link

calloes commented Feb 8, 2023

Hi,

Currently implementing multiple sections for different environments.

When using either phpipam_first_free_address or phpipam_first_free_subnet and the same address or subnet exists in another section then we see errors such ,

�[0m�[1mphpipam_first_free_address.ipam_address: Creating...�[0m�[0m
�[31m╷�[0m�[0m
�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mYour search returned zero or multiple results. Please correct your search and try again�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0m with phpipam_first_free_address.ipam_address,
�[31m│�[0m �[0m on module_rcc_core.tf line 91, in resource "phpipam_first_free_address" "ipam_address":
�[31m│�[0m �[0m 91: resource "phpipam_first_free_address" "ipam_address" �[4m{�[0m�[0m
�[31m│�[0m �[0m
�[31m╵�[0m�[0m

Noting terraform actually creates the resource but never complets and add's it into state.

If we delete the duplicate record in the other section the transaction completes fine. Checking the code i see its's doing a call in the resource_phpipam_first_free_address.go addrs, err := c.GetAddressesByIP(out) which understandably returns all the addresses, i think this needs to be done by the subnet reference so it doesn't pull back duplicates in other sections.

Any help greatly appreciated.

@steffencircle
Copy link
Contributor

steffencircle commented Feb 18, 2023

Hi,

we ran into the same issue and the issue is fixed with #56 .
It was merged to master, but since then no new release was created.

@lord-kyron @pavel-z1 Do you have any plans on when to push a new release ?

@lord-kyron
Copy link
Owner

@steffencircle
Here you are:
https://github.com/lord-kyron/terraform-provider-phpipam/releases/tag/v1.3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants