Commit Graph

25 Commits

Author SHA1 Message Date
Monty Taylor 185bbcbe52 Retire repo
Depends-On: https://review.opendev.org/720892
Change-Id: I295517b9ab66af664b96831e38011130468c2599
2020-04-22 10:19:09 -05:00
Colleen Murphy cef0960c6d Explicitly set selinux seltype for rules link
Puppet seems to have some issue with creating a symlink in
/etc/sysconfig on CentOS, where it creates the link on the first run and
then corrects the seltype on the second run, breaking idempotency tests.
If we make sure to explicitly set it up front, puppet doesn't get
confused. This patch also removes the mode setting since setting the
permissions mode on a symlink doesn't make sense.

Change-Id: I7019c48220425fc583b9b431eff08a6261ee2ebc
2018-07-10 21:20:43 +02:00
Colleen Murphy 73089a0566 Ensure iptables service is running
On Ubuntu, the iptables service starts running when it is installed. On
CentOS, that's not the case, and signaling a restart in puppet does not
actually start the service. The result is that while the iptables
service is stopped, `iptables -S` is empty. This patch adds ensure =>
running to the service resources so that iptables behaves the same on
CentOS and Ubuntu.

Change-Id: I0584c988bcebeee5133f85d55f8d389d78ebac70
2018-07-10 21:20:39 +02:00
Colleen Murphy ffe7e12145 Ensure firewalld package is absent, not purged
There seems to be a longstanding, inexplicably unresolved bug[1][2] in
the puppet package resource on CentOS where an uninstalled package will
repeatedly be reported as being "created" when it is not installed and
when the resource has ensure => purged. This breaks idempotency tests
and is just confusing. Setting the resource to absent instead of purge
works correctly and should be sufficient for ensuring firewalld isn't
interfering..

[1] https://projects.puppetlabs.com/issues/2833
[2] https://projects.puppetlabs.com/issues/3707

Change-Id: I702cf0130b311a5cd6786b4c4dd76fa03adbd2f7
2018-07-10 20:53:54 +02:00
James E. Blair 8f2af6849c Add support for resolving hostnames in rules
This allows us to specify rules with hostnames, but have puppet
resolve those to IP addresses before writing out the iptables
config.  This ensures that iptables will always be able to start,
as well as keeping firewalls up to date as hosts change.

Change-Id: I7a0dfbab67bdba72c0a56acc611503795d2bc350
Depends-On: I29d36cc527351e3e6d2ee2dc1919988379b8db3a
2017-12-14 12:54:08 -08:00
Jenkins 25561a16c8 Merge "Use site-agnostic default parameter values" 2016-12-21 07:41:52 +00:00
Ian Wienand 0b5f1ebeaf Fedora: pre-install iptables to work-around dependency issue
As described in the comment, we need to pre-install the iptables
package before the iptables-service package to avoid dependency
issues.  This was causing F25 build failures.

Change-Id: I9541a1c8f11566198b6fa622e36c4be59d6670d2
2016-12-20 09:57:50 +11:00
K Jonathan Harker f01c69ce28 Use site-agnostic default parameter values
Set the default snmp hosts to the empty set rather than
cacti.openstack.org.

Change-Id: Ibae45af594fc2b18024fcc2d6ef040afd4ddd926
Depends-On: I173ca1efae4644c89cfab68d6beeba0a1dae9ce2
2016-08-29 16:39:09 -07:00
K Jonathan Harker d921031e8a Parameterize SNMP source hosts
Downstream consumers of this module likely don't need or want to open
snmp access from cacti.openstack.org. Parameterize the hosts to allow
snmp from so that downstreams don't have to fork the module in order to
remove the access.

Change-Id: I9394982811f8dcf0d63eccb782de04bf4a047ec7
2016-08-29 16:28:54 -07:00
Paul Belanger 5b178cefd3
Add ip6tables service support for Red Hat
Currently we don't start ip6tables service on centos-7. This fixes
that.

Change-Id: I64e62074b41e49cc2dc9b6bafcfbeeded2029487
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-08-29 13:25:32 -04:00
Paul Belanger 47ed5aabad
Ensure service logic run regardless of using chroot
We want to stop notify from working in a chroot, however we need to
make sure we properly setup our Service correctly. As a result, move
the logic outside of our chroot checks.

Change-Id: I4c9284ed8ed23944aa3649338b1a09abdc8b80df
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-07-05 17:26:49 -04:00
Andrey Nikitin 86262df7c8 Indentation of the class parameters is refactored
Indentation of those parameters are changed
to follow Puppet Style Guide recommendation [0].

[0]. https://docs.puppetlabs.com/guides/style_guide.html

Change-Id: I336a845d5b2256c90987e1295545dbf26fd2076b
2016-03-22 12:49:38 +03:00
Clark Boylan 95670757ae Really stop using firewalld
On some centos7 builds there is no firewalld so we have to be a bit more
smarter about how we disable it. New method is to run an exec that stops
the service if it is running then use a package resource to uninstall it
completely. All of this happens before we install the iptables service
so they should not confict with each other.

One trick is we have to "purge" the package, because it may well have
dependencies (on RAX images, firewalld-fail2ban is installed along
with a bunch of other monitoring-type things by the "helpful"
tool-installation script that runs automatically).  The "yum" provider
in puppet actually says to do this in it's documentation:

  Using this provider's `uninstallable` feature will not remove
  dependent packages. To remove dependent packages with this provider
  use the `purgeable` feature, but note this feature is destructive
  and should be used with the utmost care."

Change-Id: I0750de9e75b63190531a3d39a5fcbb19f8e8c49e
2015-09-14 16:22:46 -07:00
Clark Boylan 7503162cc4 Disable firewalld on centos7 and greater
Firewalld is enabled by default on centos7. Unfortunately
iptables-service and firewalld appear to confuse each other resulting in
no firewall rules at all. Fix this by disabling firewalld allowing
iptables-service to be in charge and apply the rules it has configured.

Change-Id: I0089502b134c91ef2e8d11cef1e016ce314ecf96
2015-08-27 15:31:56 -07:00
Colleen Murphy 599f8e21b3 Add Gemfile and puppet 4 checks
In anticipation of puppet 4, start trying to deal with puppet 4 things
that can be helpfully predicted by puppet lint plugins. Also fix lint
errors caught by the puppet-lint-absolute_classname-check gem as well
as arrow alignment errors not caught before.

Change-Id: I56bce05c9c8d1b7924b78c78b74e4755d9a02936
2015-08-03 18:19:57 -07:00
Attila Fazekas 1938c72b93 iptables on fedora
The systemd version of iptables requires the 'iptables-services' package
for having the `regular` iptables rule restore on service startup.

The service also needs to be enabled explicitly.

Another iptables related issue with multinode_setup.sh,
tries to executes the iptables command without login shell.

The non-login shell does not contains /usr/sbin in PATH,
so multinode_setup.sh changed to use login shell defaults.

Warning: This change enables the iptables service on all
distribution.

Change-Id: I3174e43b3b19e28073a4364dd0f66fc39b0fa815
2014-08-14 11:23:53 +02:00
Monty Taylor 6ca8392c27 Don't manage iptables if we're in a choot
In chroots, as with diskimage-builder, managing service starts is
tricky. Also, we don't need to restart the service then, because
the service will get started on boot of the image.

Change-Id: Iaf90005039b8196ba3a0ac05c96d71e034f0b0b1
2014-07-05 15:58:05 -07:00
Dan Prince 3263da2819 Add RHEL support to iptables module.
Updates the iptables module so that it uses parameters
to define the package, service, and files used to setup and
configure persistent iptables rules.

With these updates the module should now support both
RHEL and Ubuntu.

Change-Id: I45af4e72065c9baaf1d9a03f18b47f6effdce322
Reviewed-on: https://review.openstack.org/23278
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2013-03-04 18:24:37 +00:00
James E. Blair b2e3236903 Make iptables additional rules a list.
A list of iptables commands that come after the "-A OPENSTACK-INPUT"
bit.

Change-Id: Iee595d9267738365c208f8ecb6f0fd4941b357e3
Reviewed-on: https://review.openstack.org/17172
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2012-11-30 01:39:28 +00:00
Paul Belanger 6e40791b0b Puppet lint fixes
Change-Id: I00cfd6765bf3f7acd44263347655228d5a839852
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-on: https://review.openstack.org/15844
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-11-13 21:38:48 +00:00
Clark Boylan d0981f5a63 Add ipv6 functionality to iptables module.
Rackspace nova cloud supports ipv6. Add ip6tables support to the
iptables module so that we can take advantage of ipv6 on this cloud
platform.

Change-Id: I628b7c71ff486a925cdb3d44277cca0d6ae7c985
Reviewed-on: https://review.openstack.org/14315
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-10-11 21:20:08 +00:00
Matthew Wagoner f61a443a90 style edits to puppet config files
Change-Id: I4f7314bcb1cb58f94ff7a78aebe27ec4591fc11c
Reviewed-on: https://review.openstack.org/14187
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-10-10 21:01:08 +00:00
Hengqing Hu fa51e50883 Remove trailing whitespaces in regular file
Change-Id: I06d4ed2a8153820f7253c6602bfa8c05af59e06f
2012-03-09 16:02:04 +08:00
Andrew Hutchings 8a91936e0a Add bzr to iptables
Adds bzr to jenkins iptables
Adds symlink for rules.v4 to rules

Change-Id: I058cccde7e39860655c3762ca06e2bd5d93f3a1c
2012-02-15 17:48:00 -08:00
James E. Blair d8056447b8 Add iptables module and rules to puppet.
Change-Id: I3ed4896dd13f0de26c287a34f8a8e858d21a4634
2011-08-08 21:31:23 +00:00