Refactor Gateway API manifests installation process

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
This commit is contained in:
ChengHao Yang
2025-04-11 02:04:27 +08:00
parent 582fe2cbde
commit 7f60dda565

View File

@@ -1,4 +1,9 @@
--- ---
- name: Gateway API | Download YAML
include_tasks: "../../../download/tasks/download_file.yml"
vars:
download: "{{ download_defaults | combine(downloads.gateway_api_crds) }}"
- name: Gateway API | Create addon dir - name: Gateway API | Create addon dir
file: file:
path: "{{ kube_config_dir }}/addons/gateway_api" path: "{{ kube_config_dir }}/addons/gateway_api"
@@ -9,17 +14,12 @@
when: when:
- inventory_hostname == groups['kube_control_plane'][0] - inventory_hostname == groups['kube_control_plane'][0]
- name: Gateway API | Set channel - name: Gateway API | Copy YAML from download dir
set_fact: copy:
gateway_api_channel: "{{ 'experimental' if gateway_api_experimental_channel else 'standard' }}" src: "{{ local_release_dir }}/gateway-api-{{ gateway_api_channel }}-install.yaml"
when:
- "inventory_hostname == groups['kube_control_plane'][0]"
- name: Gateway API | Copy Gateway API manifests to remote
template:
src: "{{ gateway_api_channel }}-install.yaml.j2"
dest: "{{ kube_config_dir }}/addons/gateway_api/{{ gateway_api_channel }}-install.yaml" dest: "{{ kube_config_dir }}/addons/gateway_api/{{ gateway_api_channel }}-install.yaml"
mode: "0644" mode: "0644"
remote_src: true
when: when:
- "inventory_hostname == groups['kube_control_plane'][0]" - "inventory_hostname == groups['kube_control_plane'][0]"