Generate and apply Talso configs

This commit is contained in:
Jeroen Vermeulen 2023-08-29 00:19:56 +02:00
parent 0ffbd7159e
commit 26d0cf7f82
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -2,11 +2,12 @@
- name: Get machine status
delegate_to: localhost
become: false
become: no
ansible.builtin.command:
cmd: "talosctl get machinestatus --endpoints '{{ ansible_remote }}' --nodes '{{ ansible_remote }}' --output json"
register: _machine_status_cmd
failed_when: _machine_status_cmd.rc not in [0, 1]
changed_when: no
- name: Get machine status - insecure
when: "_machine_status_cmd.rc == 1"
@ -15,6 +16,7 @@
ansible.builtin.command:
cmd: "talosctl get machinestatus --endpoints '{{ ansible_remote }}' --nodes '{{ ansible_remote }}' --insecure --output json"
register: _machine_status_cmd_insec
changed_when: no
- name: Parse machine status
ansible.builtin.set_fact: