Closed xlejo closed 2 years ago
Debian 11 doesn't find iptables-legacy and the role fails.
iptables-legacy
Test that checks for iptables-legacy passed
The task should finds the path of iptables-legacy.
The task don't finds the path of iptables-legacy.
This not happen if i run the role with root user.
Add become: true in task Check that {{ package.name }} is installed (tasks/pre_checks_packages.yml), so root can find iptables-legacy with which.
become: true
Check that {{ package.name }} is installed
which
Use whereis command instead of which.
whereis
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.
become
iptables
Summary
Debian 11 doesn't find
iptables-legacy
and the role fails.Issue Type
Steps to Reproduce
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)
Add
become: true
in taskCheck that {{ package.name }} is installed
(tasks/pre_checks_packages.yml), so root can findiptables-legacy
withwhich
.Use
whereis
command instead ofwhich
.