Merge pull request #6 from svc-design/codex/安装sealos-cli到install_cluster.yml

This commit is contained in:
shenlan 2025-06-24 12:26:15 +08:00 committed by GitHub
commit 904503e316
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,7 @@
- hosts: all
become: true
vars:
ops_host: "172.16.11.120"
master_ips:
- "172.16.11.120"
node_ips:

View File

@ -1,3 +1,10 @@
- name: Install sealos CLI
shell: |
curl -sL https://raw.githubusercontent.com/labring/sealos/main/scripts/install.sh | bash -s {{ sealos_version }}
args:
executable: /bin/bash
when: inventory_hostname == (ops_host | default(master_ips | first))
- name: Run sealos to create Kubernetes cluster
shell: |
sealos run \
@ -10,4 +17,4 @@
--cmd "{{ kubeadm_init_cmd }}"
args:
executable: /bin/bash
when: inventory_hostname == (master_ips | first)
when: inventory_hostname == (ops_host | default(master_ips | first))