From 50f160a148b6a973891ffc6d0882f4c0d597336e Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Thu, 20 Jul 2017 11:48:22 -0400 Subject: Prevent haproxy to run iptables during docker-puppet configuration When docker-puppet runs module tripleo::haproxy to generate haproxy configuration file, and tripleo::firewall::manage_firewall is true, iptables is called to set up firewall rules for the proxied services and fails due to lack of NET_ADMIN capability. Make the generation of firewall rule configurable by exposing a new argument to the puppet module. That way, firewall management can be temporarily disabled when being run through docker-puppet. Change-Id: I2d6274d061039a9793ad162ed8e750bd87bf71e9 Partial-Bug: #1697921 --- manifests/haproxy/endpoint.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'manifests/haproxy') diff --git a/manifests/haproxy/endpoint.pp b/manifests/haproxy/endpoint.pp index f1e80e8..9139061 100644 --- a/manifests/haproxy/endpoint.pp +++ b/manifests/haproxy/endpoint.pp @@ -86,6 +86,11 @@ # fetching the certificate for that specific network. # Defaults to undef # +# [*manage_firewall*] +# (optional) Enable or disable firewall settings for ports exposed by HAProxy +# (false means disabled, and true means enabled) +# Defaults to hiera('tripleo::firewall::manage_firewall', true) +# define tripleo::haproxy::endpoint ( $internal_ip, $service_port, @@ -103,6 +108,7 @@ define tripleo::haproxy::endpoint ( $use_internal_certificates = false, $internal_certificates_specs = {}, $service_network = undef, + $manage_firewall = hiera('tripleo::firewall::manage_firewall', true), ) { if $public_virtual_ip { # service exposed to the public network @@ -158,7 +164,7 @@ define tripleo::haproxy::endpoint ( server_names => $server_names, options => $member_options, } - if hiera('tripleo::firewall::manage_firewall', true) { + if $manage_firewall { include ::tripleo::firewall # This block will construct firewall rules only when we specify # a port for the regular service and also the ssl port for the service. -- cgit 1.2.3-korg