20 行
475 B
YAML
20 行
475 B
YAML
# 添加新节点到集群
|
|
# 使用: export K3S_TOKEN='xxx' K3S_SERVER_URL='xxx' TAILSCALE_AUTH_KEY='xxx'
|
|
# ansible-playbook playbooks/add-node.yml -l <node_name>
|
|
---
|
|
- name: Validate
|
|
hosts: localhost
|
|
gather_facts: no
|
|
tasks:
|
|
- ansible.builtin.fail:
|
|
msg: "请设置: export K3S_TOKEN='xxx'"
|
|
when: lookup('env', 'K3S_TOKEN') | length == 0
|
|
|
|
- name: Add node
|
|
hosts: masters:agents:!master_init
|
|
gather_facts: yes
|
|
roles:
|
|
- common
|
|
- k3s
|
|
|