You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/hcloud/tasks/_create_loadbalancer.yml

27 lines
1020 B
YAML

---
- name: "Create a hetzner LB"
hetzner.hcloud.hcloud_load_balancer:
name: '{{ lb_object.name }}'
load_balancer_type: '{{ lb_object.lb_type | default("lb11") }}'
delete_protection: '{{ lb_object.delete_protection | default("no") }}'
disable_public_interface: '{{ lb_object.disable_public_interface | default("no") }}'
labels: '{{ lb_object.labels | default({}) }}'
location: '{{ lb_object.location | default("nbg1") }}'
state: '{{ lb_object.status | default("present") }}'
- name: Create a basic Load Balancer network
hetzner.hcloud.hcloud_load_balancer_network:
load_balancer: '{{ lb_object.name }}'
state: '{{ lb_object.status | default("present") }}'
network: '{{ lb_object.network }}'
- name: "Add Services to LB"
hetzner.hcloud.hcloud_load_balancer_service:
args: '{{ item }}'
loop: '{{ lb_object.services }}'
- name: "Add servers by label|server to LB"
hetzner.hcloud.hcloud_load_balancer_target:
args: '{{ item }}'
loop: '{{ lb_object.targets }}'