Fix airgap agent install

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Derek Nola
2026-02-27 12:31:23 -08:00
parent 1eca3a1ab8
commit 6f44cf312f

View File

@@ -26,20 +26,27 @@
group: root group: root
mode: "0755" mode: "0755"
- name: Download K3s and install binary - name: Set skip_download var for install script
# noqa var-naming[no-role-prefix] # noqa var-naming[no-role-prefix]
ansible.builtin.command: ansible.builtin.set_fact:
cmd: /usr/local/bin/k3s-install.sh skip_download: "false"
environment: "{{ _install_envs }}"
vars: # We always run the install script, we just skip the download step as needed
_base_envs: - name: Run K3s install script
INSTALL_K3S_SKIP_START: "true" # noqa var-naming[no-role-prefix]
INSTALL_K3S_SYSTEMD_DIR: "{{ systemd_dir }}" ansible.builtin.command:
INSTALL_K3S_VERSION: "{{ k3s_version }}" cmd: /usr/local/bin/k3s-install.sh
INSTALL_K3S_EXEC: "agent --server https://{{ api_endpoint }}:{{ api_port }} {{ extra_agent_args }}" environment: "{{ _install_envs }}"
# We overrides the extra_install_envs with required keys from _base_envs on purpose vars:
_install_envs: "{{ extra_install_envs | default({}) | combine(_base_envs) }}" _base_envs:
changed_when: true INSTALL_K3S_SKIP_DOWNLOAD: "{{ skip_download | default('true') }}"
INSTALL_K3S_SKIP_START: "true"
INSTALL_K3S_SYSTEMD_DIR: "{{ systemd_dir }}"
INSTALL_K3S_VERSION: "{{ k3s_version }}"
INSTALL_K3S_EXEC: "agent --server https://{{ api_endpoint }}:{{ api_port }} {{ extra_agent_args }}"
# We overrides the extra_install_envs with required keys from _base_envs on purpose
_install_envs: "{{ extra_install_envs | default({}) | combine(_base_envs) }}"
changed_when: true
- name: Setup optional config file - name: Setup optional config file
when: agent_config_yaml is defined when: agent_config_yaml is defined