mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-25 17:12:50 +00:00
Signed-off-by: joyceliu <joyceliu@yunify.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
24 lines
537 B
YAML
24 lines
537 B
YAML
---
|
|
- include_tasks: init_repository.yaml
|
|
|
|
- include_tasks: init_ntpserver.yaml
|
|
when: .ntp.enabled
|
|
|
|
- name: Set hostname
|
|
command: |
|
|
hostnamectl set-hostname {{ .inventory_name }} \
|
|
&& sed -i '/^127.0.1.1/s/.*/127.0.1.1 {{ .inventory_name }}/g' /etc/hosts
|
|
when:
|
|
- .set_hostname
|
|
- .inventory_name | ne "localhost"
|
|
|
|
- name: Sync init os to remote
|
|
template:
|
|
src: init-os.sh
|
|
dest: /etc/kubekey/scripts/init-os.sh
|
|
mode: 0755
|
|
|
|
- name: Execute init os script
|
|
command: |
|
|
/etc/kubekey/scripts/init-os.sh
|