snel.kubernetes-cluster/roles/talos_configs_create/handlers/main.yml

31 lines
918 B
YAML

---
- name: Encrypt secrets
delegate_to: "{{ talosctl_host }}"
when: "'talos_first_nodes' in group_names"
ansible.builtin.command:
cmd: >-
ansible-vault encrypt
--vault-password-file '{{ ansible_vault_password_file }}'
--output '{{ talos_cluster_secrets_file }}.enc'
'{{ talos_cluster_secrets_file }}'"
changed_when: true
- name: Update talosconfig - endpoints
listen: Update talosconfig
delegate_to: "{{ talosctl_host }}"
when: "'talos_first_nodes' in group_names"
ansible.builtin.command:
cmd: >-
talosctl config endpoints '{{ talos_control_lb_hostname }}'
changed_when: true
- name: Update talosconfig - nodes
listen: Update talosconfig
delegate_to: "{{ talosctl_host }}"
when: "'talos_first_nodes' in group_names"
ansible.builtin.command:
cmd: >-
talosctl config nodes '{{ talos_control_lb_hostname }}'
changed_when: true