1 From 50ef964cc4f918982d2889610c5f6e7506741518 Mon Sep 17 00:00:00 2001
2 From: Kam Nasim <kam.nasim@windriver.com>
3 Date: Fri, 26 May 2017 17:04:32 -0400
4 Subject: [PATCH] disable configuration validation during haproxy manifest
5 apply since some files/options referenced in the configuration (such as for
6 TPM) may still be in flight while the haproxy manifest applies. This
7 validation option is a bit of an overkill anyways since it doesn't cause
8 Packstack to fail the manifest application, and is a soft error log but with
9 the added disadvantage of not applying any haproxy configuration (even the
10 sane bits) on a validation failure
13 manifests/config.pp | 8 --------
14 manifests/init.pp | 7 -------
15 manifests/instance.pp | 7 -------
16 manifests/params.pp | 1 -
17 4 files changed, 23 deletions(-)
19 diff --git a/manifests/config.pp b/manifests/config.pp
20 index 4007bb8..b8d4ef4 100644
21 --- a/manifests/config.pp
22 +++ b/manifests/config.pp
23 @@ -8,7 +8,6 @@ define haproxy::config (
24 $config_dir = undef, # A default is required for Puppet 2.7 compatibility. When 2.7 is no longer supported, this parameter default should be removed.
25 $custom_fragment = undef, # A default is required for Puppet 2.7 compatibility. When 2.7 is no longer supported, this parameter default should be removed.
26 $merge_options = $haproxy::merge_options,
27 - $config_validate_cmd = $haproxy::config_validate_cmd
30 if $caller_module_name != $module_name {
31 @@ -50,13 +49,6 @@ define haproxy::config (
35 - # validate_cmd introduced in Puppet 3.5
36 - if ((!defined('$::puppetversion') or (versioncmp($::puppetversion, '3.5') >= 0)) and (!defined('$::serverversion') or versioncmp($::serverversion, '3.5') >= 0)) {
37 - Concat[$_config_file] {
38 - validate_cmd => $config_validate_cmd,
43 concat::fragment { "${instance_name}-00-header":
44 target => $_config_file,
45 diff --git a/manifests/init.pp b/manifests/init.pp
46 index 54a1640..d84755e 100644
47 --- a/manifests/init.pp
48 +++ b/manifests/init.pp
50 # Optional. Path to the haproxy config file.
51 # Default depends on platform.
53 -# [*config_validate_cmd*]
54 -# Optional. Command used by concat validate_cmd to validate new
55 -# config file concat is a valid haproxy config.
56 -# Default /usr/sbin/haproxy -f % -c
61 @@ -122,7 +117,6 @@ class haproxy (
62 $config_dir = $haproxy::params::config_dir,
63 $config_file = $haproxy::params::config_file,
64 $manage_config_dir = $haproxy::params::manage_config_dir,
65 - $config_validate_cmd = $haproxy::params::config_validate_cmd,
68 $manage_service = undef,
69 @@ -183,7 +177,6 @@ class haproxy (
70 merge_options => $merge_options,
71 service_options => $service_options,
72 sysconfig_options => $sysconfig_options,
73 - config_validate_cmd => $config_validate_cmd,
77 diff --git a/manifests/instance.pp b/manifests/instance.pp
78 index 3dffdae..7f37751 100644
79 --- a/manifests/instance.pp
80 +++ b/manifests/instance.pp
82 # The parent directory will be created automatically.
85 -# [*config_validate_cmd*]
86 -# Command used by concat validate_cmd to validate new
87 -# config file concat is a valid haproxy config.
88 -# Default /usr/sbin/haproxy -f % -c
92 # A single instance of haproxy with all defaults
93 @@ -153,7 +148,6 @@ define haproxy::instance (
94 $merge_options = $haproxy::params::merge_options,
95 $service_options = $haproxy::params::service_options,
96 $sysconfig_options = $haproxy::params::sysconfig_options,
97 - $config_validate_cmd = $haproxy::params::config_validate_cmd,
100 if $service_ensure != true and $service_ensure != false {
101 @@ -208,7 +202,6 @@ define haproxy::instance (
102 custom_fragment => $custom_fragment,
103 merge_options => $merge_options,
104 package_ensure => $package_ensure,
105 - config_validate_cmd => $config_validate_cmd,
107 haproxy::install { $title:
108 package_name => $package_name,
109 diff --git a/manifests/params.pp b/manifests/params.pp
110 index d7b9fa9..21e6bb0 100644
111 --- a/manifests/params.pp
112 +++ b/manifests/params.pp
113 @@ -10,7 +10,6 @@ class haproxy::params {
115 $service_options = "ENABLED=1\n" # Only used by Debian.
116 $sysconfig_options = 'OPTIONS=""' #Only used by Redhat/CentOS etc
117 - $config_validate_cmd = '/usr/sbin/haproxy -f % -c'
120 'Archlinux', 'Debian', 'Redhat', 'Gentoo', 'Suse' : {