Skip to content

Commit 37e572d

Browse files
committed
Add support for local Helm Charts, copy charts from control to remote
1 parent 6127bab commit 37e572d

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

roles/core/tasks/install.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,34 @@
3939
dest: "/tmp/sdcore-5g-values.yaml"
4040
when: inventory_hostname in groups['master_nodes']
4141

42-
- name: copy local_charts "{{ core.helm.chart_ref }}" to /tmp/sdcore-helm-charts
43-
copy:
44-
src: "{{ core.helm.chart_ref }}/"
42+
- set_fact:
43+
chart_ref_sd_core: "{{ core.helm.chart_ref | regex_replace('^(.*)/.*$', '\\1') }}"
44+
when: inventory_hostname in groups['master_nodes'] and core.helm.local_charts
45+
46+
- debug:
47+
var: "chart_ref_sd_core"
48+
when: inventory_hostname in groups['master_nodes'] and core.helm.local_charts
49+
50+
- name: copy local_charts "{{ chart_ref_sd_core }}" to /tmp/sdcore-helm-charts
51+
synchronize:
52+
src: "{{ chart_ref_sd_core }}/"
4553
dest: /tmp/sdcore-helm-charts
54+
recursive: yes
55+
rsync_opts:
56+
- "--exclude=.git"
57+
when: inventory_hostname in groups['master_nodes'] and core.helm.local_charts
58+
59+
- set_fact:
60+
chart_ref_sd_core: "/tmp/sdcore-helm-charts/{{ core.helm.chart_ref | regex_replace('^.*/(.*)$', '\\1') }}"
61+
when: inventory_hostname in groups['master_nodes'] and core.helm.local_charts
62+
63+
- debug:
64+
var: "chart_ref_sd_core"
4665
when: inventory_hostname in groups['master_nodes'] and core.helm.local_charts
4766

4867
- name: update aether 5gc helm dependencies
4968
shell: |
50-
helm dep up /tmp/sdcore-helm-charts/sdcore-helm-charts
69+
helm dep up {{chart_ref_sd_core}}
5170
when: inventory_hostname in groups['master_nodes'] and core.helm.local_charts
5271

5372
# TODO: add systems check to avoid issues (e.g., mongodb needing avx support)
@@ -59,7 +78,7 @@
5978
name: sd-core
6079
release_namespace: omec
6180
create_namespace: true
62-
chart_ref: "{{ core.helm.chart_ref if core.helm.local_charts == false else '/tmp/sdcore-helm-charts/sdcore-helm-charts/' }}"
81+
chart_ref: "{{ core.helm.chart_ref if core.helm.local_charts == false else chart_ref_sd_core }}"
6382
chart_version: "{{ core.helm.chart_version }}"
6483
values_files:
6584
- /tmp/sdcore-5g-values.yaml
@@ -90,4 +109,4 @@
90109
when: inventory_hostname in groups['master_nodes']
91110
always:
92111
- pause:
93-
seconds: 60
112+
seconds: 60

0 commit comments

Comments
 (0)