Skip to content

Fix firewall update logic for -1#772

Open
zliang-akamai wants to merge 1 commit intodevfrom
zhiwei/fix-instance-firewall-id-update--1
Open

Fix firewall update logic for -1#772
zliang-akamai wants to merge 1 commit intodevfrom
zhiwei/fix-instance-firewall-id-update--1

Conversation

@zliang-akamai
Copy link
Copy Markdown
Member

📝 Description

-1 represents explicit no firewall now. We need to handle it in the update logic.

✔️ How to Test

Install the collection in this branch

make install

Then run this playbook twice:

ansible-playbook /path/to/the/test_playbook.yaml
- name: Test Firewall ID
  hosts: localhost
  collections:
    - linode.cloud
  tasks:
    - name: Create a Linode instance
      linode.cloud.instance:
        label: example-linode
        type: g6-nanode-1
        region: us-central
        image: linode/arch
        root_pass: ReplaceWithAStrwediedekro3ouijqklongPassword123!
        state: present
        firewall_id: -1
        booted: false
      register: create_linode
  environment:
    LINODE_API_VERSION: v4beta

@zliang-akamai zliang-akamai requested review from a team as code owners March 26, 2026 05:06
@zliang-akamai zliang-akamai requested review from jriddle-linode and mgwoj and removed request for a team March 26, 2026 05:06
firewall_id = self.module.params.get("firewall_id")
# Nothing to do
if firewall_id is None:
if firewall_id in (None, -1):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we have a test for this case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@zliang-akamai Will this case be covered by the existing tests once the change rolls out in the API?

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

Successfully merging this pull request may close these issues.

3 participants