Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't modify existing airgap k3s-install script #372

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ENV['VAGRANT_NO_PARALLEL'] = 'no'
NODE_ROLES = ["server-0", "server-1", "server-2", "agent-0", "agent-1"]
NODE_BOXES = ['generic/ubuntu2004', 'generic/ubuntu2004', 'generic/ubuntu2004', 'generic/ubuntu2004', 'generic/ubuntu2004']
NODE_BOXES = ['bento/ubuntu-24.04', 'bento/ubuntu-24.04', 'bento/ubuntu-24.04', 'bento/ubuntu-24.04', 'bento/ubuntu-24.04']
NODE_CPUS = 2
NODE_MEMORY = 2048
# Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks
Expand All @@ -26,12 +26,14 @@ def provision(vm, role, node_num)
"k3s_cluster:children" => ["server", "agent"],
}
ansible.extra_vars = {
k3s_version: "v1.26.9+k3s1",
k3s_version: "v1.28.14+k3s1",
api_endpoint: "#{NETWORK_PREFIX}.100",
token: "myvagrant",
# Required to use the private network configured above
extra_server_args: "--node-external-ip #{node_ip} --flannel-iface eth1",
extra_agent_args: "--node-external-ip #{node_ip} --flannel-iface eth1",
# Airgap setup, left as reference
# airgap_dir: "./my_airgap",
# Optional, left as reference for ruby-ansible syntax
# extra_service_envs: [ "NO_PROXY='localhost'" ],
# server_config_yaml: <<~YAML
Expand Down
9 changes: 9 additions & 0 deletions roles/airgap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@
that: "ansible_version.full is version_compare('2.12', '>=')"
msg: "The Airgap role requires at least ansible-core 2.12"

- name: Check for existing install script
become: false
delegate_to: localhost
ansible.builtin.stat:
path: "{{ airgap_dir + '/k3s-install.sh' }}"
register: host_install_script

- name: Download k3s install script
become: false
delegate_to: localhost
# Workaround for https://github.com/ansible/ansible/issues/64016
when: not host_install_script.stat.exists
ansible.builtin.get_url:
url: https://get.k3s.io/
timeout: 120
Expand Down
Loading