PyratLabs / ansible-role-k3s

Ansible role for installing k3s as either a standalone server or HA cluster.
BSD 3-Clause "New" or "Revised" License
637 stars 135 forks source link

Debian 11 doesn't find `iptables-legacy` command #171

Closed xlejo closed 2 years ago

xlejo commented 2 years ago

Summary

Debian 11 doesn't find iptables-legacy and the role fails.

Issue Type

Steps to Reproduce

  1. Install Debian 11 on VM.
  2. Run the role (with normal user) in that VM.
  3. Wait for the task Test that checks for iptables-legacy passed.

Expected Result

The task should finds the path of iptables-legacy.

Actual Result

The task don't finds the path of iptables-legacy.

This not happen if i run the role with root user.

Possible solutions (tested and working)

  1. Add become: true in task Check that {{ package.name }} is installed (tasks/pre_checks_packages.yml), so root can find iptables-legacy with which.

  2. Use whereis command instead of which.

xanmanning commented 2 years ago

Yeah, my molecule tests missed this because it's logged in as the root user. :facepalm:

I'll look at adding the become to the check because you need to be root to interact with iptables.