22 lines
577 B
YAML
22 lines
577 B
YAML
---
|
|
- name: See if k3s file exists
|
|
ansible.builtin.stat:
|
|
path: /usr/local/bin/k3s
|
|
register: k3s_status
|
|
|
|
- include_tasks: installation.yml
|
|
when: not k3s_status.stat.exists
|
|
|
|
- include_tasks: create_kubeconfig.yml
|
|
when: ansible_default_ipv4.address == k3s_primary_server_ip
|
|
|
|
- name: Check if k3s token vault file already exists
|
|
ansible.builtin.stat:
|
|
path: "{{ playbook_dir }}/{{ k3s_server_token_vault_file }}"
|
|
register: k3s_vault_file_stat
|
|
delegate_to: localhost
|
|
run_once: true
|
|
|
|
- include_tasks: pull_token.yml
|
|
when: not k3s_vault_file_stat.stat.exists
|