Closed xdrus closed 8 years ago
Hi there -- we're using the packages from each OS for these providers. Is systemd able to start and stop iptables outside of Chef?
Same issue here. The problem is that in RHEL/CentOS 7 the service unit file for iptables is provided by the package iptables-services
but the cookbook installs just iptables
. Installing such package solves the problem.
I'm unable to reproduce the same output in CentOS 7.2. I get a successful converge, and:
# systemctl list-unit-files --no-pager | grep iptables
iptables.service enabled
# uname -a
Linux iptables-centos-72 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
# chef-solo -v
Chef: 12.8.1
Can you confirm what packages you have installed?
# rpm -qa | grep iptab
iptables-1.4.21-16.el7.x86_64
iptables-services-1.4.21-16.el7.x86_64
I wonder if there's a difference/bug in CentOS 7.1 and 7.2?
Same on CentOS 7.1:
# systemctl list-unit-files --no-pager | grep iptables
iptables.service enabled
# uname -a
Linux iptables-centos-71 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
# chef-solo -v
Chef: 12.8.1
Packages:
# rpm -qa | grep iptab
iptables-services-1.4.21-16.el7.x86_64
iptables-1.4.21-16.el7.x86_64
Here's what I have.
Before chef-run
# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
# sudo rpm -qa | grep iptab
iptables-1.4.21-16.el7.x86_64
# uname -a
Linux default-centos-7 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
After chef-run
# sudo rpm -qa | grep iptab
iptables-1.4.21-16.el7.x86_64
This box was created using the default CentOS minimal install. I checked the .iso and indeed it does not include the package iptables-services
# ls Packages|grep iptab
iptables-1.4.21-16.el7.x86_64.rpm
I run yum update
just in case but it still does not install iptables-services.
@alexanderBendo If you install the iptables-services
package, does it fix the issue? We may just be missing that.
@martinb3 yes, that solves the issue.
Could you give master a try and let us know if it fixes your issue? Thanks!
@martinb3 It works. Thank you very much!
Great! I'll do a release shortly.
Error description
Attempt to use the cookbook on CentOS 7.1 with iptables is failed with an error:
/tmp/kitchen/cache/chef-stacktrace.out
:Configuration:
systemctl list-unit-files --no-pager | grep iptables
returns empty list.cat /etc/sysconfig/iptables
: