Add ability to configure retry parameter for apache proxy

Retry parameter is useful to define maintenance window during
which backend will be unavailable in case it is in error state.
During this period of time connections to the backend won't be
allowed, and apache will give 503 error. More details: [1]

[1] http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

Change-Id: I324fc9c7ecc5f7a68b9c04946693f383453013d4
Related-Prod: https://mirantis.jira.com/browse/PROD-25993
diff --git a/.kitchen.yml b/.kitchen.yml
index 65961cd..e5ada97 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -50,6 +50,12 @@
       platform: ubuntu
 
 suites:
+  - name: server-proxy
+    provisioner:
+      pillars-from-files:
+        apache.sls: tests/pillar/server_proxy.sls
+    includes: trusty-2017.7
+
   - name: server-php5
     provisioner:
       pillars-from-files:
diff --git a/README.rst b/README.rst
index e11c293..82ac5d1 100644
--- a/README.rst
+++ b/README.rst
@@ -22,7 +22,20 @@
         - proxy
         - proxy_http
         - proxy_balancer
-
+      site:
+        apache_proxy_site:
+          enabled: true
+          type: proxy
+          name: site_name
+          proxy:
+            host: 1.1.1.1
+            port: 8080
+            protocol: http
+            retry: 30
+          host:
+            name: 2.2.2.2
+            port: 9001
+            address: 2.2.2.2
 
 Apache plain static sites (eg. sphinx generated, from git/hg sources)
 
diff --git a/apache/files/proxy.conf b/apache/files/proxy.conf
index b48ccce..c06c503 100644
--- a/apache/files/proxy.conf
+++ b/apache/files/proxy.conf
@@ -13,7 +13,7 @@
   {%- if site.proxy.get('initial_pooled', True) == False %}
   SetEnv proxy-initial-not-pooled 1
   {%- endif %}
-  ProxyPass / {{ site.proxy.protocol }}://{{ site.proxy.host }}:{{ site.proxy.port }}/{% if site.proxy.get('nocanon', False)%} nocanon{% endif %}
+  ProxyPass / {{ site.proxy.protocol }}://{{ site.proxy.host }}:{{ site.proxy.port }}/{% if site.proxy.get('nocanon', False)%} nocanon{% endif %}{% if site.proxy.retry is defined %} retry={{ site.proxy.retry }}{% endif %}
   {%- if site.proxy.preservehost is defined %}
   ProxyPreserveHost {% if site.proxy.preservehost %}On{% else %}Off{% endif %}
   {%- endif %}
diff --git a/tests/pillar/server_proxy.sls b/tests/pillar/server_proxy.sls
new file mode 100644
index 0000000..ad6e703
--- /dev/null
+++ b/tests/pillar/server_proxy.sls
@@ -0,0 +1,25 @@
+apache:
+  server:
+    enabled: true
+    bind:
+      address: '0.0.0.0'
+      ports:
+      - 80
+    modules:
+    - proxy
+    - proxy_http
+    - proxy_balancer
+    site:
+      apache_proxy_site:
+        enabled: true
+        type: proxy
+        name: site_name
+        proxy:
+          host: 127.0.0.1
+          port: 8080
+          protocol: http
+          retry: 30
+        host:
+          name: 127.0.1.1
+          port: 9001
+          address: 127.0.1.1