|
| 1 | +--- |
| 2 | +- name: Ensure cluster stacks dependencies |
| 3 | + hosts: all |
| 4 | + vars: |
| 5 | + kind_version: "0.22.0" |
| 6 | + kubectl_version: "1.29.3" |
| 7 | + clusterctl_version: "1.7.2" |
| 8 | + helm_version: "3.14.4" |
| 9 | + yq_version: "4.44.1" |
| 10 | + envsubst_version: "1.4.2" |
| 11 | + install_dir: "{{ ansible_user_dir }}/.local/bin" |
| 12 | + roles: # https://opendev.org/zuul/zuul-jobs |
| 13 | + - role: ensure-docker |
| 14 | + - role: ensure-go |
| 15 | + vars: |
| 16 | + go_version: 1.21.6 |
| 17 | + environment: |
| 18 | + PATH: "{{ install_dir }}:{{ ansible_env.PATH }}" |
| 19 | + tasks: |
| 20 | + - name: Make sure installation directory exists |
| 21 | + ansible.builtin.file: |
| 22 | + path: "{{ install_dir }}" |
| 23 | + state: directory |
| 24 | + mode: 0755 |
| 25 | + - name: Install clusterctl |
| 26 | + ansible.builtin.get_url: |
| 27 | + url: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v{{ clusterctl_version }}/clusterctl-linux-amd64" |
| 28 | + dest: "{{ install_dir }}/clusterctl" |
| 29 | + mode: "+x" |
| 30 | + - name: Install envsubst |
| 31 | + ansible.builtin.get_url: |
| 32 | + url: "https://github.com/a8m/envsubst/releases/download/v{{ envsubst_version }}/envsubst-Linux-x86_64" |
| 33 | + dest: "{{ install_dir }}/envsubst" |
| 34 | + mode: "+x" |
| 35 | + - name: Install yq |
| 36 | + ansible.builtin.get_url: |
| 37 | + url: "https://github.com/mikefarah/yq/releases/download/v{{ yq_version }}/yq_linux_amd64" |
| 38 | + dest: "{{ install_dir }}/yq" |
| 39 | + mode: "+x" |
| 40 | + - name: Install KinD |
| 41 | + ansible.builtin.get_url: |
| 42 | + url: "https://kind.sigs.k8s.io/dl/v{{ kind_version }}/kind-linux-amd64" |
| 43 | + dest: "{{ install_dir }}/kind" |
| 44 | + mode: "+x" |
| 45 | + - name: Install kubectl |
| 46 | + ansible.builtin.get_url: |
| 47 | + url: "https://dl.k8s.io/release/v{{ kubectl_version }}/bin/linux/amd64/kubectl" |
| 48 | + dest: "{{ install_dir }}/kubectl" |
| 49 | + mode: "+x" |
| 50 | + # TODO: Install csctl and csctl-openstack from the release when it will be available |
| 51 | + - name: Install csctl and csctl-openstack |
| 52 | + ansible.builtin.import_tasks: tasks/csctl.yaml |
| 53 | + - name: Install helm |
| 54 | + ansible.builtin.unarchive: |
| 55 | + src: "https://get.helm.sh/helm-v{{ helm_version }}-linux-amd64.tar.gz" |
| 56 | + dest: "{{ install_dir }}" |
| 57 | + extra_opts: "--strip-components=1" |
| 58 | + mode: "+x" |
| 59 | + remote_src: true |
| 60 | + args: |
| 61 | + creates: "{{ install_dir }}/helm" |
0 commit comments