mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-07-03 00:03:05 +02:00
init
This commit is contained in:
23
playbooks/72_install_k3s_worker.yml
Normal file
23
playbooks/72_install_k3s_worker.yml
Normal file
@ -0,0 +1,23 @@
|
||||
- hosts: odroid_worker
|
||||
name: Setup k3s
|
||||
become: true
|
||||
tasks:
|
||||
- name: Print token
|
||||
ansible.builtin.debug:
|
||||
msg: "[Master] K3S_TOKEN_HOLDER K8S token is {{ hostvars['K3S_TOKEN_HOLDER']['token'] }}"
|
||||
- name: Print msg
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ hostvars['K3S_TOKEN_HOLDER']['token'] }}"
|
||||
- name: Get hostname
|
||||
ansible.builtin.command: uname -n
|
||||
register: result
|
||||
changed_when: false
|
||||
- name: Print hostname
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.stdout }}"
|
||||
- name: Install K3S Worker
|
||||
ansible.builtin.shell: >-
|
||||
curl -sfL https://get.k3s.io
|
||||
| K3S_TOKEN={{ hostvars['K3S_TOKEN_HOLDER']['token'] }}
|
||||
K3S_URL="https://192.168.77.161:6443" K3S_NODE_NAME="{{ result.stdout }}" INSTALL_K3S_VERSION="v1.24.1+k3s1" sh -
|
||||
changed_when: false
|
Reference in New Issue
Block a user