Add possibility to global:maxconn option

  * Global maxconn is the maximum number of connections
  handled by the haproxy process.
  * Set default to 25000

Change-Id: Icf37fdb894b79322ff737080fc0376b24cd36ac8
Closes-Bug: PROD-23078 (PROD:23078)
diff --git a/haproxy/files/haproxy.cfg b/haproxy/files/haproxy.cfg
index ee5b5c6..6db883a 100644
--- a/haproxy/files/haproxy.cfg
+++ b/haproxy/files/haproxy.cfg
@@ -22,7 +22,7 @@
   spread-checks 4
   tune.maxrewrite 1024
   tune.bufsize 32768
-  maxconn  16000
+  maxconn  {{ proxy.global.maxconn }}
   {%- if salt['pkg.version']('haproxy')[:3] >= '1.6' %}
   # SSL options
   ca-base /etc/haproxy/ssl
diff --git a/haproxy/map.jinja b/haproxy/map.jinja
index 966f342..a6f0078 100644
--- a/haproxy/map.jinja
+++ b/haproxy/map.jinja
@@ -3,13 +3,20 @@
         'pkgs': ['haproxy'],
         'service': 'haproxy',
         'stats_socket': '/run/haproxy/admin.sock',
+        'global': {
+          'maxconn' : 25000
+        }
     },
     'RedHat': {
         'pkgs': ['haproxy'],
         'service': 'haproxy',
         'stats_socket': '/var/lib/haproxy/stats',
+        'global': {
+          'maxconn' : 25000
+        }
     },
 }, merge=salt['pillar.get']('haproxy:proxy')) %}
+
 {% set invalid_section_options = {
     'frontend': [
         'abortonclose',
diff --git a/tests/pillar/single_general_service.sls b/tests/pillar/single_general_service.sls
index 7281769..8480b03 100644
--- a/tests/pillar/single_general_service.sls
+++ b/tests/pillar/single_general_service.sls
@@ -5,6 +5,8 @@
     logging: syslog
     max_connections: 1024
     nbproc: 4
+    global:
+      maxconn: 99999
     cpu_map:
       1: 0
       2: 1