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/_read_load_balancer_infos.yml

32 lines
994 B
YAML

---
- name: "Gathering current load_balancer infos from hetzner"
hetzner.hcloud.hcloud_load_balancer_info:
api_token: "{{ hetzner_authentication_ansible }}"
#label_selector: "{{ current_load_balancer_group.label_selector }}"
register: current_load_balancer_infos
delegate_to: 127.0.0.1
become: false
tags:
- update_config
- name: "Setting loadbalancer group as fact: load_balancer_group_infos_{{ current_load_balancer_group.name }}"
set_fact:
load_balancer_group_infos_{{ current_load_balancer_group.name }}: "{{ current_load_balancer_infos.hcloud_load_balancer_info | json_query(querystr) }}" # noqa var-naming
vars:
querystr: "[*].{id: id, name: name, ip: ipv4_address}"
delegate_to: 127.0.0.1
become: false
tags:
- update_config
- name: "Printing load_balancer infos {{ current_load_balancer_infos }}"
debug:
msg: "{{ current_load_balancer_infos }}"
delegate_to: 127.0.0.1
become: false
tags:
- update_config
when:
- debug