Reorganize vars dict;Parse & loop through dict key/values
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2022-06-26 17:54:19 +02:00
parent 487239365e
commit d39d594bf0
3 changed files with 29 additions and 9 deletions

View File

@ -13,6 +13,8 @@
group: root group: root
mode: 0755 mode: 0755
loop: "{{ dependencies.static_binaries | selectattr('archive', 'undefined') }}" loop: "{{ dependencies.static_binaries | selectattr('archive', 'undefined') }}"
loop_control:
label: "{{ item.filename }}"
- name: Download, extract & install archived static binaries - name: Download, extract & install archived static binaries
include_tasks: dependencies.archive_compressed.yml include_tasks: dependencies.archive_compressed.yml

View File

@ -4,10 +4,25 @@
state: directory state: directory
loop: loop:
- /opt/metacluster/components/harbor - /opt/metacluster/components/harbor
- /opt/metacluster/helm-charts
- name: Add helm repositories - name: Add helm repositories
kubernetes.core.helm_repository: kubernetes.core.helm_repository:
name: "{{ item.name }}" name: "{{ item.name }}"
repo_url: "{{ item.url }}" repo_url: "{{ item.url }}"
state: present state: present
loop: "{{ components.helm_repositories }}" loop: "{{ platform.helm_repositories }}"
- name: Fetch helm charts
ansible.builtin.command:
cmd: helm fetch {{ item.value.chart_name }} --untar --version {{ item.value.version }}
chdir: /opt/metacluster/helm-charts
loop: "{{ lookup('ansible.builtin.dict', components) }}"
- ansible.builtin.command:
cmd: ls -lashR /opt/metacluster/helm-charts
register: results
- ansible.builtin.debug:
var: results

View File

@ -1,7 +1,6 @@
k3s: platform:
version: v1.24.1+k3s1 k3s:
version: v1.24.1+k3s1
components:
helm_repositories: helm_repositories:
- name: longhorn - name: longhorn
@ -9,14 +8,18 @@ components:
- name: harbor - name: harbor
url: https://helm.goharbor.io url: https://helm.goharbor.io
components:
longhorn: longhorn:
version: version: 1.3.0
helm_chart: longhorn/longhorn
harbor: harbor:
version: version: 2.5.1
helm_chart: harbor/harbor
argocd: # argocd:
version: # version:
dependencies: dependencies: