29 lines
800 B
YAML
29 lines
800 B
YAML
---
|
|
|
|
- name: Import talos_machine_status tasks
|
|
ansible.builtin.import_tasks: "{{ role_path }}/../../shared/tasks/talos_machine_status.yml"
|
|
|
|
- name: Reset Talos
|
|
# You can't execute this on nodes in Maintenance mode, they are already 'reset'.
|
|
when: "talos_machine_status.spec.stage != 'maintenance'"
|
|
delegate_to: "{{ talosctl_host }}"
|
|
become: false
|
|
ansible.builtin.command:
|
|
cmd: >-
|
|
talosctl reset
|
|
--graceful=false
|
|
--wait=true
|
|
--reboot
|
|
--endpoints '{{ ansible_remote }}'
|
|
--nodes '{{ ansible_remote }}'
|
|
changed_when: true
|
|
environment:
|
|
TALOSCONFIG: "{{ talosconfig }}"
|
|
|
|
- name: Wait for Talos port 50000
|
|
delegate_to: "{{ talosctl_host }}"
|
|
become: false
|
|
ansible.builtin.wait_for:
|
|
host: "{{ ansible_remote }}"
|
|
port: 50000
|