- name: Create folder structure(s) ansible.builtin.file: path: "{{ item }}" state: directory loop: - /opt/metacluster/dependencies/helm/charts - name: Download & install static binaries ansible.builtin.get_url: url: "{{ item.url }}" dest: /usr/local/bin/{{ item.filename }} owner: root group: root mode: 0755 loop: "{{ dependencies.static_binaries | selectattr('archive', 'undefined') }}" - block: - name: Initialize tempfolder ansible.builtin.tempfile: state: directory register: archives - name: Create destination sub folder ansible.builtin.file: path: "{{ archives.path }}/{{ item.filename }}" state: directory loop: "{{ dependencies.static_binaries | selectattr('archive', 'defined') | selectattr('archive', 'equalto', 'compressed') }}" - name: Download, extract & install archived static binaries ansible.builtin.unarchive: src: "{{ item.url }}" dest: "{{ archives.path }}/{{ item.filename }}" remote_src: yes extra_opts: "{{ item.extra_opts | default(omit) }}" loop: "{{ dependencies.static_binaries | selectattr('archive', 'defined') | selectattr('archive', 'equalto', 'compressed') }}" - name: Cleanup tempfolder ansible.builtin.file: path: "{{ archives.path }}" state: absent when: archives.path is defined - name: Install ansible-galaxy collections ansible.builtin.shell: cmd: ansible-galaxy collection install {{ item }} loop: "{{ dependencies.ansible_galaxy_collections }}" - name: Install distro packages ansible.builtin.apt: pkg: "{{ dependencies.packages }}" state: latest update_cache: yes install_recommends: no - name: Upgrade all packages ansible.builtin.apt: name: '*' state: latest update_cache: yes - name: Cleanup apt cache ansible.builtin.apt: autoremove: yes purge: yes - block: - name: Download Helm binary ansible.builtin.unarchive: src: https://get.helm.sh/helm-{{ helm.version }}-linux-amd64.tar.gz dest: /opt/metacluster/dependencies/helm - name: Install Helm binary ansible.builtin.copy: src: /opt/metacluster/dependencies/helm/helm dest: /usr/local/bin/helm remote_src: yes owner: root group: root mode: 0755