First playbook example

This commit is contained in:
Jeroen Vermeulen 2023-08-28 18:27:05 +02:00
parent 9351f64a03
commit b2fb278b0f
No known key found for this signature in database
3 changed files with 29 additions and 0 deletions

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Kubernetes Playbook
Is included by [snel.ansible](https://git.snel.com/snelcom-ansible/snel.ansible)

9
playbook.yml Normal file
View File

@ -0,0 +1,9 @@
---
# Playbook Kubernetes
- name: Kubernetes Play
gather_facts: false
hosts:
- talos
roles:
- role: machine_status

View File

@ -0,0 +1,17 @@
---
- name: Get machine status
delegate_to: localhost
become: false
ansible.builtin.command:
cmd: "talosctl get machinestatus --endpoints '{{ ansible_remote }}' --nodes '{{ ansible_remote }}' --insecure --output json"
register: _machine_status_output
- name: Parse machine status
ansible.builtin.set_fact:
_machine_status: "{{ _machine_status_output.stdout | from_json }}"
- name: Show machine status
ansible.builtin.debug:
var: _machine_status