Skip to content

TPT-4284:ansible implement support for reserved ip for ipv4#788

Open
mgwoj wants to merge 10 commits intolinode:devfrom
mgwoj:feature/TPT-4284-ansible-implement-support-for-reserved-ip-for-ipv4
Open

TPT-4284:ansible implement support for reserved ip for ipv4#788
mgwoj wants to merge 10 commits intolinode:devfrom
mgwoj:feature/TPT-4284-ansible-implement-support-for-reserved-ip-for-ipv4

Conversation

@mgwoj
Copy link
Copy Markdown
Contributor

@mgwoj mgwoj commented Apr 29, 2026

📝 Description

Implements support for Linode Reserved IPv4 addresses in ansible_linode.

New modules:

reserved_ip — create, update tags, and delete reserved IP addresses
reserved_ip_info — retrieve details for a single reserved IP by address
reserved_ip_list — list and filter all reserved IPs on an account

Updated modules:

instance — new ipv4 parameter to assign a reserved IP at creation time (create-only; excluded from update path to prevent handle_updates errors)
nodebalancer — new ipv4 parameter to assign a reserved IP at creation time (create-only; excluded from create params when None and popped before handle_updates)

Other changes:

Updated ip_info and ip doc fragments with new fields: reserved, tags, interface_id, assigned_entity, vpc_nat_1_1
Added integration tests: reserved_ip_basic, reserved_ip_info, reserved_ip_list, instance_reserved_ip, nodebalancer_reserved_ip
Pinned requirements.txt to linode_api4 @ git+https://github.com/linode/linode_api4-python.git@proj/reserved-ips

Generated/updated docs via make gendocs

✔️ How to Test

make test-unit

# Modified modules (regression check)
make TEST_SUITE="ip_info instance_basic nodebalancer_basic" test-int

# New reserved IP functionality
make TEST_SUITE="reserved_ip_basic reserved_ip_info reserved_ip_list instance_reserved_ip nodebalancer_reserved_ip" test-int

@mgwoj mgwoj requested a review from Copilot April 29, 2026 13:30
@mgwoj mgwoj requested review from a team as code owners April 29, 2026 13:30
@mgwoj mgwoj added the enhancement issues that request a enhancement label Apr 29, 2026
@mgwoj mgwoj requested review from ezilber-akamai and psnoch-akamai and removed request for a team April 29, 2026 13:30
Comment thread plugins/modules/instance.py Fixed
Comment thread plugins/modules/reserved_ip.py Fixed
Comment thread plugins/modules/reserved_ip.py Fixed
Comment thread plugins/modules/reserved_ip_info.py Fixed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for Linode Reserved IPv4 addresses to the linode.cloud Ansible collection, including new modules for managing/querying reserved IPs and create-time assignment support for Instances and NodeBalancers.

Changes:

  • Introduces reserved_ip, reserved_ip_info, and reserved_ip_list modules plus associated doc fragments and integration tests.
  • Adds create-only ipv4 parameters to instance and nodebalancer to allow assigning a reserved IPv4 at creation time.
  • Updates IP-related doc fragments/docs to include new Reserved IP fields and pins linode_api4 to a Git ref.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/integration/targets/reserved_ip_basic/tasks/main.yaml New integration test covering reserve/update-tags/delete flow
tests/integration/targets/reserved_ip_info/tasks/main.yaml New integration test for querying a reserved IP by address
tests/integration/targets/reserved_ip_list/tasks/main.yaml New integration test for listing reserved IPs
tests/integration/targets/instance_reserved_ip/tasks/main.yaml New integration test for assigning a reserved IP on instance create
tests/integration/targets/nodebalancer_reserved_ip/tasks/main.yaml New integration test for assigning a reserved IP on nodebalancer create
requirements.txt Switches linode_api4 dependency to a Git URL
plugins/modules/reserved_ip.py New module to create/update tags/delete reserved IPs
plugins/modules/reserved_ip_info.py New info module to fetch a reserved IP by address
plugins/modules/reserved_ip_list.py New list module to enumerate reserved IPs
plugins/modules/instance.py Adds create-only ipv4 param and excludes it from update reconciliation
plugins/modules/nodebalancer.py Adds create-only ipv4 param and excludes it from update reconciliation
plugins/module_utils/doc_fragments/reserved_ip.py Doc fragment samples/examples for reserved_ip
plugins/module_utils/doc_fragments/reserved_ip_info.py Doc fragment samples/examples for reserved_ip_info
plugins/module_utils/doc_fragments/reserved_ip_list.py Doc fragment samples/examples for reserved_ip_list
plugins/module_utils/doc_fragments/instance.py Adds instance example using reserved IPv4
plugins/module_utils/doc_fragments/nodebalancer.py Adds nodebalancer example using reserved IPv4
plugins/module_utils/doc_fragments/ip.py Updates IP sample fields
plugins/module_utils/doc_fragments/ip_info.py Updates IP info sample fields
docs/modules/instance.md Generated docs updated for new instance param
docs/modules/nodebalancer.md Generated docs updated for new nodebalancer param
docs/modules/ip_info.md Generated docs updated for new IP fields
docs/modules/ip_rdns.md Generated docs updated for new IP fields
README.md Adds module links for reserved_ip*, but docs appear missing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/modules/reserved_ip.py
Comment thread plugins/modules/reserved_ip.py Outdated
Comment thread plugins/modules/instance.py
Comment thread README.md
@mgwoj mgwoj changed the title Feature/tpt 4284 ansible implement support for reserved ip for ipv4 TPT-4284:ansible implement support for reserved ip for ipv4 Apr 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/modules/instance.py
Comment thread plugins/module_utils/doc_fragments/reserved_ip_list.py Outdated
Comment thread docs/modules/reserved_ip_list.md Outdated
Comment thread plugins/modules/reserved_ip_info.py
@zliang-akamai
Copy link
Copy Markdown
Member

Some findings:

  • We may need to update ip or reserved_ip module for the updated /networking/ips behavior to support promoting an IP to be a reserved IP. I haven't verified if it can work this way, but the gap does exist. For cleanest solution, we might need another brand new module for this. Optionally, we can also state that this feature is intentionally unsupported because users can still use generic API call module for it, your call.
  • Should we declare the behavior of linode.cloud.reserved_ip that it is not idempotent when creating by region? Re-running the documented example will allocate another billable reserved IP each run.

These are mostly for discussion, the overall changes looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement issues that request a enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants