mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
* feat: change inventory_hosts to hostvars Signed-off-by: joyceliu <joyceliu@yunify.com> * feat: change inventory_hosts to hostvars Signed-off-by: joyceliu <joyceliu@yunify.com> --------- Signed-off-by: joyceliu <joyceliu@yunify.com>
26 lines
675 B
YAML
26 lines
675 B
YAML
---
|
|
- name: Execute post install scripts
|
|
hosts:
|
|
- all
|
|
tasks:
|
|
- name: Copy post install scripts to remote
|
|
ignore_errors: true
|
|
copy:
|
|
src: |
|
|
{{ .scripts_dir }}/post_install_{{ .inventory_hostname }}.sh
|
|
dest: |
|
|
/etc/kubekey/scripts/post_install_{{ .inventory_hostname }}.sh
|
|
mode: 0755
|
|
register: execute_result
|
|
|
|
- name: Execute post install scripts
|
|
when: .execute_result.stderr | eq ""
|
|
command: |
|
|
for file in /etc/kubekey/scripts/post_install_*.sh; do
|
|
if [ -f $file ]; then
|
|
# execute file
|
|
chmod +x $file
|
|
$file
|
|
fi
|
|
done
|