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

hcloud_load_balancer_service returns certificates instead of status codes #332

Closed
cf-sewe opened this issue Sep 25, 2023 · 1 comment · Fixed by #333
Closed

hcloud_load_balancer_service returns certificates instead of status codes #332

cf-sewe opened this issue Sep 25, 2023 · 1 comment · Fixed by #333
Labels
bug Something isn't working

Comments

@cf-sewe
Copy link

cf-sewe commented Sep 25, 2023

When creating a hcloud_load_balancer_service in mode TCP, but using http health check, then the returned array is incorrectly returning certificates: [ 200 ] instead of the configured status codes list.

This leads to repeated unnecessary updates.

[11:02:16]     ↳ swarm/hcloud_loadbalancer: Create Hetzner Cloud Load Balancer Service with Port 443
META: noop
META: noop
↳  cl1-fsn1-1 -> localhost | CHANGED | 848ms
{
  - hcloud_load_balancer_service: {
    - load_balancer: cl1-lb
    - protocol: tcp
    - listen_port: 443
    - destination_port: 443
    - proxyprotocol: True
    - http: None
    - health_check: {
      - protocol: http
      - port: 443
      - interval: 5
      - timeout: 1
      - retries: 3
      - http: {
        - domain: ""
        - path: /ping
        - response: ""
        - certificates: [ 200 ]
        - tls: True
      }
    }
  }
}

for Ansible code:

- name: "Create Hetzner Cloud Load Balancer Service with Port 443"
  delegate_to: localhost
  hetzner.hcloud.hcloud_load_balancer_service:
    state: "present"
    api_token: "{{ swarm_hcloud_api_token }}"
    load_balancer: "{{ swarm_cluster_name }}-lb"
    protocol: "tcp"
    proxyprotocol: true
    listen_port: 443
    destination_port: 443
    health_check:
      protocol: "http"
      port: 443
      interval: 5
      timeout: 1
      retries: 3
      http:
        domain: ""
        path: "/ping"
        response: ""
        status_codes:
          - '200'
        tls: true

Problematic code line (ff):

@jooola jooola added the bug Something isn't working label Sep 25, 2023
jooola added a commit that referenced this issue Sep 25, 2023
…data (#333)

##### SUMMARY

In the `hcloud_load_balancer_service` return data, the
`health_check.http.certificates` field must be named
`health_check.http.status_codes`.

https://docs.hetzner.cloud/#load-balancers-get-a-load-balancer

Fixes #332 

##### ISSUE TYPE

- Bugfix Pull Request


##### COMPONENT NAME

hcloud_load_balancer_service
@cf-sewe
Copy link
Author

cf-sewe commented Sep 25, 2023

Thank you, @jooola :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants