refactor(k3s): centralize k3s primary server IP and integrate Netcup DNS
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
notify:
|
||||
- Restart nginx
|
||||
vars:
|
||||
k3s_server_ips: "{{ groups['k3s_server'] | map('extract', hostvars, 'ansible_default_ipv4') | map(attribute='address') | unique | list }}"
|
||||
k3s_server_ips: "{{ k3s_primary_server_ip }}"
|
||||
|
||||
- name: Enable nginx
|
||||
ansible.builtin.systemd:
|
||||
|
||||
@@ -3,3 +3,14 @@
|
||||
ansible.builtin.include_tasks: installation.yml
|
||||
- name: Configure
|
||||
ansible.builtin.include_tasks: configuration.yml
|
||||
|
||||
- name: Setup DNS on Netcup
|
||||
community.general.netcup_dns:
|
||||
api_key: "{{ k3s_loadbalancer_netcup_api_key }}"
|
||||
api_password: "{{ k3s_loadbalancer_netcup_api_password }}"
|
||||
customer_id: "{{ k3s_loadbalancer_netcup_customer_id }}"
|
||||
domain: "{{ domain }}"
|
||||
name: "k3s"
|
||||
type: "A"
|
||||
value: "{{ hostvars['k3s-loadbalancer'].ansible_default_ipv4.address }}"
|
||||
delegate_to: localhost
|
||||
|
||||
Reference in New Issue
Block a user