mirror of
https://github.com/JamesTurland/JimsGarage.git
synced 2025-10-03 00:46:18 +00:00
rke2
This commit is contained in:
17
Ansible/Playbooks/RKE2/roles/add-agent/tasks/main.yaml
Normal file
17
Ansible/Playbooks/RKE2/roles/add-agent/tasks/main.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
# Copy agent config to all agents - we need to change agent2 & 3 later with the token
|
||||
- name: Deploy RKE2 Agent Configuration
|
||||
ansible.builtin.template:
|
||||
src: templates/rke2-agent-config.j2
|
||||
dest: /etc/rancher/rke2/config.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: inventory_hostname in groups['agents']
|
||||
|
||||
# Check agents have restarted to pick up config
|
||||
- name: Ensure RKE2 agents are enabled and running
|
||||
ansible.builtin.systemd:
|
||||
name: rke2-agent
|
||||
enabled: true
|
||||
state: restarted
|
||||
daemon_reload: true
|
@@ -0,0 +1,5 @@
|
||||
write-kubeconfig-mode: "0644"
|
||||
token: {{ hostvars['server1']['token'] }}
|
||||
server: https://{{ hostvars['server1']['ansible_host'] }}:9345
|
||||
node-label:
|
||||
- "agent=true"
|
Reference in New Issue
Block a user