fix: automatically create dns recods
This commit is contained in:
@@ -232,13 +232,14 @@
|
||||
gather_facts: false
|
||||
hosts: control
|
||||
tasks:
|
||||
- name: Remove schedule taint to nodes.
|
||||
# This makes sure Hetzer gives the nodes a proper Provider ID.
|
||||
- name: Add schedule taint to nodes.
|
||||
kubernetes.core.k8s_taint:
|
||||
state: absent
|
||||
state: present
|
||||
name: "{{ item }}"
|
||||
taints:
|
||||
- key: node.cloudprovider.kubernetes.io/uninitialized
|
||||
value: true
|
||||
value: "true"
|
||||
effect: NoSchedule
|
||||
loop: [node-a, node-b]
|
||||
|
||||
@@ -264,3 +265,28 @@
|
||||
state: present
|
||||
update_repo_cache: true
|
||||
values_files: [IngressValues.yml]
|
||||
|
||||
- name: Connect DNS to the Load Balancer.
|
||||
gather_facts: false
|
||||
vars_files:
|
||||
- ../vault.yml
|
||||
hosts: localhost
|
||||
tasks:
|
||||
- name: Get the IP address of the LB.
|
||||
hetzner.hcloud.load_balancer_info:
|
||||
api_token: "{{ secrets.hcloud_token }}"
|
||||
name: "hetzner-lb"
|
||||
register: hetzner_lb_info
|
||||
|
||||
- name: Connect DNS.
|
||||
vars:
|
||||
ip_address: "{{ hetzner_lb_info.hcloud_load_balancer_info[0].ipv4_address }}"
|
||||
hetzner.hcloud.zone_rrset:
|
||||
api_token: "{{ secrets.hcloud_token }}"
|
||||
zone: "{{ secrets.zone_name }}"
|
||||
name: "{{ item }}"
|
||||
type: A
|
||||
records:
|
||||
- value: "{{ ip_address }}"
|
||||
state: present
|
||||
loop: ["*", "@"]
|
||||
|
||||
Reference in New Issue
Block a user