rancherfederal / rke2-ansible

RKE2 cluster provisioning via Ansible.
Apache License 2.0
232 stars 129 forks source link

Air gapped install not working for v1.30.5+rke2r1 #261

Open hotsource59 opened 1 month ago

hotsource59 commented 1 month ago

I tried an air gapped install with the latest code. I downloaded the image tarball and the binary tarball for v1.30.5+rke2r1 and placed them in the tarball_install directory.

ll tarball_install
rke2-images.linux0amd64.tar.zst
rke2.linux-amd64.tar.gz

I started the playbook via ansible-playbook site.yml -i inventory/cluster/hosts.yml

It then fails at this position:

TASK [rke2_common : Check for images tar.zst in ...]
ok: [server1 -> 127.0.0.1]
ok: [server2 -> 127.0.0.1]
ok: [server3 -> 127.0.0.1]

TASK [rke2_common : Create images directory]
ok: [server1 -> 127.0.0.1]
ok: [server2 -> 127.0.0.1]
ok: [server3 -> 127.0.0.1]

TASK [rke2_common : Include calculate_rke2_version.yml]
included: ... for server1, server2, server3

TASK [rke2_common : Get full version name url]
fatal: [server1: FAILED! => {"changed": false, "elapsed": 0, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno -2] Name or service not known>", "redirected": false, "status": -1, "url": "https://update.rke2.io/v1-release/channels/stable"}
fatal: [server2: FAILED! => {"changed": false, "elapsed": 0, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno -2] Name or service not known>", "redirected": false, "status": -1, "url": "https://update.rke2.io/v1-release/channels/stable"}
fatal: [server3: FAILED! => {"changed": false, "elapsed": 0, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno -2] Name or service not known>", "redirected": false, "status": -1, "url": "https://update.rke2.io/v1-release/channels/stable"}

My hosts.yml

---
all:
  vars:
    ansible_user: root
rke2_cluster:
  children:
    rke2_servers:
      hosts:
        server1
        server2
        server3
    rke2_agents:
      hosts:
        server4
        server5

When I set the install_rke2_version: v1.30.5+rke2r1 in all:vars the playbook continues but fails at

TASK [rke2_common : SLES/Ubuntu/Tarball Installation]
included: .../roles/rke2_common/tasks/tarball_install.yml for server1, server2, server3

TASK [rke2_common : TARBALL | Make temp dir]
changed: [server1]
changed: [server2]
changed: [server3]

TASK [rke2_common : Determine if current version differs what what is being installed]
ok: [server1]
ok: [server2]
ok: [server3]

TASK [rke2_common : TARBALL | Download the tarball]
fatal: [server1: FAILED! => {"changed": false, "dest": /tmp/ansible.../rke2.linux-amd64.tar.gz", "elapsed": 0, "msg": "Request failed: <urlopen error [Errno -2] Name or service not known>", "url": "https://github.com/rancher/rke2/releases/download/v1.30.5+rke2r1/rke2.linux-amd64.tar.gz"}
fatal: [server2: FAILED! => {"changed": false, "dest": /tmp/ansible.../rke2.linux-amd64.tar.gz", "elapsed": 0, "msg": "Request failed: <urlopen error [Errno -2] Name or service not known>", "url": "https://github.com/rancher/rke2/releases/download/v1.30.5+rke2r1/rke2.linux-amd64.tar.gz"}
fatal: [server3: FAILED! => {"changed": false, "dest": /tmp/ansible.../rke2.linux-amd64.tar.gz", "elapsed": 0, "msg": "Request failed: <urlopen error [Errno -2] Name or service not known>", "url": "https://github.com/rancher/rke2/releases/download/v1.30.5+rke2r1/rke2.linux-amd64.tar.gz"}

Why does it still try to download something if everything is provided in the tarball_install directory?