k8s-infra-cluster/setup-local-tools.yml
2026-03-25 11:46:39 +01:00

45 lines
1.3 KiB
YAML

---
- name: Install Kubernetes Tools on WSL Localhost
hosts: localhost
connection: local
become: yes
tasks:
- name: Install dependencies
ansible.builtin.apt:
name: [curl, git, gpg]
state: present
update_cache: yes
- name: Install Helm via Official Script
ansible.builtin.shell: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
args:
creates: /usr/local/bin/helm
- name: Install Kustomize via Official Installer
ansible.builtin.shell: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
mv kustomize /usr/local/bin/kustomize
args:
creates: /usr/local/bin/kustomize
- name: Ensure binaries are executable
ansible.builtin.file:
path: "{{ item }}"
mode: '0755'
owner: root
group: root
loop:
- /usr/local/bin/helm
- /usr/local/bin/kustomize
- name: Verify Installations
ansible.builtin.shell: "{{ item }} version"
loop: [helm, kustomize]
register: tool_versions
changed_when: false
- name: Print Versions
ansible.builtin.debug:
msg: "{{ item.stdout }}"
loop: "{{ tool_versions.results }}"