52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
- name: Create folder structure(s)
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
loop:
|
|
- /opt/metacluster/components/harbor
|
|
- /opt/metacluster/helm-charts
|
|
- /opt/metacluster/container-images
|
|
|
|
- name: Add helm repositories
|
|
kubernetes.core.helm_repository:
|
|
name: "{{ item.name }}"
|
|
repo_url: "{{ item.url }}"
|
|
state: present
|
|
loop: "{{ platform.helm_repositories }}"
|
|
|
|
- name: Fetch helm charts
|
|
ansible.builtin.command:
|
|
cmd: helm fetch {{ item.value.helm_chart }} --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
|
|
|
|
- name: Parse helm charts for container images
|
|
ansible.builtin.command:
|
|
cmd: "{{ item.value.parse_cmd }} /opt/metacluster/helm-charts/{{ item.key }}/values.yaml"
|
|
register: containerimages
|
|
loop: "{{ lookup('ansible.builtin.dict', components) }}"
|
|
# loop_control:
|
|
# label: "{{ item.key }}"
|
|
|
|
- ansible.builtin.debug:
|
|
var: containerimages
|
|
|
|
# - name: Pull and store containerimages
|
|
# ansible.builtin.command:
|
|
# cmd: skopeo copy docker://{{ item }} docker-archive:./{{ ( item | regex_findall('[^/:]+'))[-2] }}.tar:{{ item }}
|
|
# chdir: /opt/metacluster/container-images
|
|
# loop: ...
|
|
|
|
# - name: Compress tarballs
|
|
# community.general.archive:
|
|
# dest: /opt/metacluster/container-images/{{ item | regex_findall('[^/:]+'))[-2] }}.tar.gz
|
|
# path: /opt/metacluster/container-images/{{ item | regex_findall('[^/:]+'))[-2] }}.tar
|
|
# remove: yes
|
|
# loop: ...
|