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

Migrated NodeBalancer-related info and list modules to new framework #566

Merged

Conversation

ezilber-akamai
Copy link
Contributor

@ezilber-akamai ezilber-akamai commented Aug 19, 2024

📝 Description

Migrated nodebalancer_info, nodebalancer_list, and nodebalancer_stats modules to new framework.

✔️ How to Test

Integration Tests

make TEST_ARGS="-v nodebalancer_basic nodebalancer_firewall nodebalancer_node nodebalancer_populated nodebalancer_reordered_tags nodebalancer_list nodebalancer_stats" test

Manual Tests

  1. In an ansible_linode sandbox environment (e.g. dx-devenv), run the following:
- name: test
  hosts: localhost
  tasks:
    - name: Create node
      linode.cloud.instance:
        label: 'testing-node-1'
        region: us-ord
        type: g6-standard-1
        image: linode/ubuntu22.04
        root_pass: Fn$$oobar123
        private_ip: true
        state: present
      register: node_1

    - name: Create a populated NodeBalancer
      linode.cloud.nodebalancer:
        label: 'testing-nodebalancer-1'
        region: us-ord
        state: present
        configs:
          - port: 80
            algorithm: roundrobin
            check: http
            check_attempts: 3
            check_interval: 90
            check_passive: false
            check_path: /
            check_timeout: 10
            cipher_suite: recommended
            protocol: http
            proxy_protocol: none
            stickiness: none
            nodes:
              - label: node_1
                address: '{{ node_1.instance.ipv4[1] }}:80'
                mode: accept
                weight: 10
      register: nodebalancer_1

    - name: Get stats about the Nodebalancer by id
      linode.cloud.nodebalancer_stats:
        id: '{{ nodebalancer_1.node_balancer.id }}'
      register: nodebalancer_1_stats_id

    - name: Get stats about the Nodebalancer by label
      linode.cloud.nodebalancer_stats:
        label: '{{ nodebalancer_1.node_balancer.label }}'
      register: nodebalancer_1_stats_label

    - name: Get info about the NodeBalancer by id
      linode.cloud.nodebalancer_info:
        id: '{{ nodebalancer_1.node_balancer.id }}'
      register: nodebalancer_1_info_id

    - name: Get info about the NodeBalancer by label
      linode.cloud.nodebalancer_info:
        label: '{{ nodebalancer_1.node_balancer.label }}'
      register: nodebalancer_1_info_label

    - name: Create another node
      linode.cloud.instance:
        label: 'testing-node-2'
        region: us-ord
        type: g6-standard-1
        image: linode/ubuntu22.04
        root_pass: Fn$$oobar123
        private_ip: true
        state: present
      register: node_2

    - name: Create another populated NodeBalancer
      linode.cloud.nodebalancer:
        label: 'testing-nodebalancer-2'
        region: us-ord
        state: present
        configs:
          - port: 80
            algorithm: roundrobin
            check: http
            check_attempts: 3
            check_interval: 90
            check_passive: false
            check_path: /
            check_timeout: 10
            cipher_suite: recommended
            protocol: http
            proxy_protocol: none
            stickiness: none
            nodes:
              - label: node_2
                address: '{{ node_2.instance.ipv4[1] }}:80'
                mode: accept
                weight: 10
      register: nodebalancer_2

    - name: List nodebalancers with no filter
      linode.cloud.nodebalancer_list:
      register: no_filter

    - name: List nodebalancers with filter on region
      linode.cloud.nodebalancer_list:
        order_by: created
        order: desc
        filters:
          - name: region
            values: us-ord
      register: filter_region

    - name: List nodebalancers with filter on label
      linode.cloud.nodebalancer_list:
        order_by: created
        order: desc
        filters:
          - name: label
            values: testing-nodebalancer-1
      register: filter_label
  1. Ensure that the the Node Balancer Stats are returned properly.
  2. Ensure that the the Node Balancer Info is returned properly.
  3. Ensure that the Node Balancer list is returned and filtered properly.
  4. Ensure that the newly created nodes and nodebalancers have been successfully deleted.

@ezilber-akamai ezilber-akamai force-pushed the TPT-2928-nodebalancer-info-list branch 3 times, most recently from de43f14 to 107a114 Compare August 19, 2024 15:44
@ezilber-akamai ezilber-akamai marked this pull request as ready for review August 19, 2024 18:15
@ezilber-akamai ezilber-akamai requested a review from a team as a code owner August 19, 2024 18:15
@ezilber-akamai ezilber-akamai requested review from jriddle-linode and ykim-akamai and removed request for a team August 19, 2024 18:15
@ezilber-akamai ezilber-akamai added the improvement for improvements in existing functionality in the changelog. label Aug 19, 2024
Copy link
Member

@zliang-akamai zliang-akamai left a comment

Choose a reason for hiding this comment

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

Tests passed, nice work!

Copy link
Contributor

@ykim-akamai ykim-akamai left a comment

Choose a reason for hiding this comment

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

LGTM, all tests pass locally. Nice work!

@ezilber-akamai ezilber-akamai merged commit 6af0104 into linode:dev Aug 20, 2024
4 checks passed
@ezilber-akamai ezilber-akamai deleted the TPT-2928-nodebalancer-info-list branch August 20, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement for improvements in existing functionality in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants