Add CI/CD infrastructure

Change-Id: Id15634c2096394f7de4533c8466e0e0c2e66f8ed
diff --git a/haproxy/proxy/listen/cicd/aptly.yml b/haproxy/proxy/listen/cicd/aptly.yml
new file mode 100644
index 0000000..c1062ed
--- /dev/null
+++ b/haproxy/proxy/listen/cicd/aptly.yml
@@ -0,0 +1,50 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        aptly-api:
+          mode: http
+          options:
+            - forwardfor
+            - httpclose
+            - httplog
+          balance: source
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 8084
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 18084
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 18084
+              params: backup check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 18084
+              params: backup check
+        aptly-public:
+          mode: http
+          options:
+            - forwardfor
+            - httpclose
+            - httplog
+          balance: source
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 8085
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 18085
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 18085
+              params: check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 18085
+              params: check
diff --git a/haproxy/proxy/listen/cicd/gerrit.yml b/haproxy/proxy/listen/cicd/gerrit.yml
new file mode 100644
index 0000000..efa7ed9
--- /dev/null
+++ b/haproxy/proxy/listen/cicd/gerrit.yml
@@ -0,0 +1,47 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        gerrit:
+          mode: http
+          options:
+            - forwardfor
+            - httpchk
+            - httpclose
+            - httplog
+          balance: source
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 8080
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 18083
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 18083
+              params: backup check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 18083
+              params: backup check
+        gerrit_ssh:
+          mode: tcp
+          balance: source
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 29418
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 29417
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 29417
+              params: backup check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 29417
+              params: backup check
diff --git a/haproxy/proxy/listen/cicd/jenkins.yml b/haproxy/proxy/listen/cicd/jenkins.yml
new file mode 100644
index 0000000..d907ee3
--- /dev/null
+++ b/haproxy/proxy/listen/cicd/jenkins.yml
@@ -0,0 +1,49 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        jenkins:
+          mode: http
+          options:
+            - forwardfor
+#            - httpchk
+            - httpclose
+            - httplog
+          balance: source
+          http_response:
+            - action: "del-header X-Frame-Options"
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 8081
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 18081
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 18081
+              params: backup check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 18081
+              params: backup check
+        jenkins_jnlp:
+          mode: tcp
+          balance: source
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 50000
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 50001
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 50001
+              params: backup check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 50001
+              params: backup check
diff --git a/haproxy/proxy/listen/cicd/mysql.yml b/haproxy/proxy/listen/cicd/mysql.yml
new file mode 100644
index 0000000..c6fa56b
--- /dev/null
+++ b/haproxy/proxy/listen/cicd/mysql.yml
@@ -0,0 +1,23 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        mysql:
+          mode: tcp
+          balance: source
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 3306
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 13306
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 13306
+              params: backup check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 13306
+              params: backup check
diff --git a/haproxy/proxy/listen/docker/registry.yml b/haproxy/proxy/listen/docker/registry.yml
new file mode 100644
index 0000000..c3d1893
--- /dev/null
+++ b/haproxy/proxy/listen/docker/registry.yml
@@ -0,0 +1,31 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        registry:
+          mode: http
+          options:
+            - forwardfor
+            - httpclose
+            - httplog
+          balance: source
+          http_request:
+            - action: "add-header X-Forwarded-Proto https"
+              condition: "if { ssl_fc }"
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 5000
+              ssl: ${_param:cluster_ssl_certificate}
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 15000
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 15000
+              params: check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 15000
+              params: check
diff --git a/haproxy/proxy/listen/docker/visualizer.yml b/haproxy/proxy/listen/docker/visualizer.yml
new file mode 100644
index 0000000..daacd84
--- /dev/null
+++ b/haproxy/proxy/listen/docker/visualizer.yml
@@ -0,0 +1,28 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        visualizer:
+          mode: http
+          options:
+            - forwardfor
+            - httpchk
+            - httpclose
+            - httplog
+          balance: source
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 8090
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 18090
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 18090
+              params: check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 18090
+              params: check
diff --git a/haproxy/proxy/listen/salt.yml b/haproxy/proxy/listen/salt.yml
new file mode 100644
index 0000000..ba54c07
--- /dev/null
+++ b/haproxy/proxy/listen/salt.yml
@@ -0,0 +1,31 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        salt:
+          mode: http
+          options:
+            - forwardfor
+            - httpchk
+            - httpclose
+            - httplog
+          balance: source
+          timeout:
+            server: 20m
+            client: 20m
+          binds:
+            - address: ${_param:haproxy_bind_address}
+              port: 8000
+          servers:
+            - name: ${_param:cluster_node01_name}
+              host: ${_param:cluster_node01_address}
+              port: 8000
+              params: check
+            - name: ${_param:cluster_node02_name}
+              host: ${_param:cluster_node02_address}
+              port: 8000
+              params: backup check
+            - name: ${_param:cluster_node03_name}
+              host: ${_param:cluster_node03_address}
+              port: 8000
+              params: backup check
diff --git a/haproxy/proxy/single.yml b/haproxy/proxy/single.yml
index e69de29..dc9c668 100644
--- a/haproxy/proxy/single.yml
+++ b/haproxy/proxy/single.yml
@@ -0,0 +1,4 @@
+parameters:
+  haproxy:
+    proxy:
+      enabled: true