Fixed issues with variables (looping), so renamed them to _var

This commit is contained in:
savagebidoof 2024-03-07 05:19:58 +01:00
parent faa63611f0
commit 169e8a8913

View File

@ -24,13 +24,16 @@
_kubeadm_join_command: "" # Placeholder
# Others
is_proxmox_vm: "{{ is_proxmox_vm }} | default(false) | bool"
setup_only: "{{ setup_only }} | default(false) | bool" # Prevent creating/joining a cluster
_is_master: "{{ is_master | default('false') | bool }}" # Prevent creating/joining a cluster
_is_proxmox_vm: "{{ is_proxmox_vm | default('false') | bool }}" # Prevent creating/joining a cluster
_setup_only: "{{ setup_only | default('false') | bool }}" # Prevent creating/joining a cluster
tasks:
# - check vars
# check vars
- debug: var=set_hostname
- debug: var=is_master
- debug: var=_is_master
- debug: var=_is_proxmox_vm
- debug: var=_setup_only
- name: Ping check
ping:
@ -40,16 +43,16 @@
import_tasks: tasks_prepare_node.yaml
become: true
# If is_master: init
# If _is_master: init
- name: init cluster
import_tasks: tasks_master.yaml
when: is_master and not setup_only
when: _is_master and not setup_only
become: true
# else: join
- name: join cluster
import_tasks: tasks_slave.yaml
when: not is_master and not setup_only
when: not _is_master and not setup_only
# Do other stuff
- name: post setup