techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.
https://technotim.live/posts/k3s-etcd-ansible/
Apache License 2.0
2.41k stars 1.05k forks source link

reset.yml: Task "Remove linux-modules-extra-raspi" fails on non-debian OS (missing apt-get) #84

Closed gbyczyns closed 2 years ago

gbyczyns commented 2 years ago

Expected Behavior

Running the "reset.yml" playbook should not fail on non-debian/non-ubuntu operating systems.

Current Behavior

It fails on RHEL because it tries to run apt-get package manager which is not present in this OS.

TASK [reset : Remove linux-modules-extra-raspi] ********************************************************************************************************************************************************************************************
Wednesday 14 September 2022  13:59:04 +0200 (0:00:02.331)       0:01:33.070 *** 
[WARNING]: Updating cache and auto-installing missing dependency: python3-apt
fatal: [example.com]: FAILED! => {"changed": false, "cmd": "apt-get update", "msg": "[Errno 2] No such file or directory: b'apt-get': b'apt-get'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

PLAY RECAP *********************************************************************************************************************************************************************************************************************************
example.com : ok=22   changed=9    unreachable=0    failed=1    skipped=4    rescued=0    ignored=0   

Steps to Reproduce

ansible-playbook reset.yml -i inventory/my-env/hosts.ini

Context

Operating system: LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: RedHatEnterprise Description: Red Hat Enterprise Linux release 8.4 (Ootpa) Release: 8.4 Codename: Ootpa

timothystewart6 commented 2 years ago

This will be addressed in https://github.com/techno-tim/k3s-ansible/issues/88

timothystewart6 commented 2 years ago

This was closed by https://github.com/techno-tim/k3s-ansible/issues/88