2022-06-24 22:50:44 +00:00
|
|
|
- name: Create folder structure(s)
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
loop:
|
|
|
|
- /opt/metacluster/components/harbor
|
2022-06-26 15:54:19 +00:00
|
|
|
- /opt/metacluster/helm-charts
|
2022-06-26 16:24:57 +00:00
|
|
|
- /opt/metacluster/container-images
|
2022-06-24 21:55:54 +00:00
|
|
|
|
2022-06-24 22:50:44 +00:00
|
|
|
- name: Add helm repositories
|
|
|
|
kubernetes.core.helm_repository:
|
2022-06-24 22:54:36 +00:00
|
|
|
name: "{{ item.name }}"
|
2022-06-24 22:50:44 +00:00
|
|
|
repo_url: "{{ item.url }}"
|
|
|
|
state: present
|
2022-06-26 15:54:19 +00:00
|
|
|
loop: "{{ platform.helm_repositories }}"
|
|
|
|
|
|
|
|
- name: Fetch helm charts
|
|
|
|
ansible.builtin.command:
|
2022-06-26 16:24:57 +00:00
|
|
|
cmd: helm fetch {{ item.value.helm_chart }} --untar --version {{ item.value.version }}
|
2022-06-26 15:54:19 +00:00
|
|
|
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
|
|
|
|
|
2022-06-26 16:24:57 +00:00
|
|
|
- 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
|
2022-06-26 15:54:19 +00:00
|
|
|
|
2022-06-26 16:24:57 +00:00
|
|
|
# - 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: ...
|