Remove option nolinger from contrail part

Contrail-webui issues are caused by this option. When it is
removed everything works fine. And also according to haproxy
documentation: "it is not recommended to use this option when
not absolutely needed".

Change-Id: Ic7575a859d97569dd3aa68951b765368aed334ed
Related-Prod: PROD-25629
diff --git a/README.rst b/README.rst
index 109947f..94a1609 100644
--- a/README.rst
+++ b/README.rst
@@ -236,7 +236,6 @@
 
     listen contrail_api
       bind 172.16.10.252:8082
-      option nolinger
       balance leastconn
       server ntw01p1 172.16.10.95:9101 check inter 2000 rise 2 fall 3
       server ntw01p2 172.16.10.95:9102 check inter 2000 rise 2 fall 3
diff --git a/haproxy/files/backend/_contrail-analytics.cfg b/haproxy/files/backend/_contrail-analytics.cfg
index 84daead..cd28d53 100644
--- a/haproxy/files/backend/_contrail-analytics.cfg
+++ b/haproxy/files/backend/_contrail-analytics.cfg
@@ -1,5 +1,6 @@
   balance roundrobin
-  option nolinger
-  option tcp-check
+{%- for option in listen.get('options', []) %}
+  option {{ option }}
+{%- endfor %}
   tcp-check connect port 6379
   default-server error-limit 1 on-error mark-down
\ No newline at end of file
diff --git a/haproxy/files/backend/_contrail-api.cfg b/haproxy/files/backend/_contrail-api.cfg
index 0c8fd49..8ea553b 100644
--- a/haproxy/files/backend/_contrail-api.cfg
+++ b/haproxy/files/backend/_contrail-api.cfg
@@ -1,2 +1,4 @@
   balance roundrobin
-  option nolinger
\ No newline at end of file
+{%- for option in listen.get('options', []) %}
+  option {{ option }}
+{%- endfor %}
diff --git a/haproxy/files/haproxy.cfg b/haproxy/files/haproxy.cfg
index 08bb0bc..7dd405e 100644
--- a/haproxy/files/haproxy.cfg
+++ b/haproxy/files/haproxy.cfg
@@ -146,10 +146,14 @@
   stats uri /
   stats auth {{ listen.user }}:{{ listen.password }}
   {%- elif listen.get('type', None) == 'contrail-api' %}
-  option nolinger
+  {%- for option in listen.get('options', []) %}
+  option {{ option }}
+  {%- endfor %}
   balance {{ listen.get('balance', 'roundrobin') }}
   {%- elif listen.get('type', None) == 'contrail-analytics' %}
-  option nolinger
+  {%- for option in listen.get('options', []) %}
+  option {{ option }}
+  {%- endfor %}
   balance {{ listen.get('balance', 'roundrobin') }}
   option tcp-check
   tcp-check connect port 6379
diff --git a/tests/pillar/single_contrail.sls b/tests/pillar/single_contrail.sls
index 0cfe8f1..87ff43f 100644
--- a/tests/pillar/single_contrail.sls
+++ b/tests/pillar/single_contrail.sls
@@ -7,6 +7,8 @@
     listen:
       contrail_analytics:
         type: contrail-analytics
+        options:
+        - tcp-check
         binds:
         - address: 127.0.0.1
           port: 8081
@@ -33,6 +35,8 @@
         password: password
       contrail_api:
         type: contrail-api
+        options:
+        - tcp-check
         check: false
         binds:
         - address: 127.0.0.1