kubekey/builtin/capkk/roles/init/init-os/tasks/main.yaml
liujian 86ff6371b6
Uninstall docker interface (#2478)
Signed-off-by: joyceliu <joyceliu@yunify.com>
Co-authored-by: joyceliu <joyceliu@yunify.com>
2025-03-05 18:55:12 +08:00

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