-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.yml
33 lines (28 loc) · 964 Bytes
/
debug.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# code: language=ansible
# File for testing ansible playbooks
---
- name: Debug
hosts: all
gather_facts: yes
tasks:
# - name: Print initial master ip
# ansible.builtin.debug:
# var: hostvars['k3s-m1']['ansible_default_ipv4']['address']
# - name: Print all host default ipv4
# ansible.builtin.debug:
# var: hostvars[ansible_host]['ansible_default_ipv4']['address']
# when: node_type | default('undefined') == 'master'
# - name: Test set fact
# ansible.builtin.set_fact:
# master_ip: "{{ hostvars['k3s-m1']['ansible_default_ipv4']['address'] }}"
# - name: Print master ip
# ansible.builtin.debug:
# var: master_ip
- name: Check if K3S is already installed
ansible.builtin.shell:
cmd: 'test -f /usr/local/bin/k3s'
register: k3s_installed
failed_when: false
- name: Print k3s_installed
ansible.builtin.debug:
var: k3s_installed.rc