Skip to content

Commit 94e54c8

Browse files
author
Miguel Medinilla
committed
Exercise template snippets in e2e playbook
1 parent aaecf4d commit 94e54c8

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http-response set-header {{ header_name }} {{ header_value }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
server {{ server_name }} {{ server_address }}:{{ server_port }}{% if server_options %} {{ server_options }}{% endif %}

tests/e2e/site.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,51 @@
3232
lines:
3333
- "bind *:80"
3434
- "mode http"
35-
- "acl is_nginx path_beg /backend"
36-
- "use_backend nginx_backend if is_nginx"
3735
- "default_backend varnish_backend"
36+
templates:
37+
- src: snippets/frontend-path-acl.cfg.j2
38+
vars:
39+
acl_name: path_backend
40+
path_prefix: /backend
41+
backend: nginx_backend
3842
- name: prom
3943
lines:
4044
- "bind 127.0.0.1:8404"
4145
- "mode http"
4246
- "http-request use-service prometheus-exporter if { path /metrics }"
47+
templates:
48+
- src: snippets/frontend-path-acl.cfg.j2
49+
vars:
50+
acl_name: metrics_root
51+
path_prefix: /
52+
backend: varnish_backend
4353
haproxy_decision_backends:
4454
- name: varnish_backend
4555
lines:
4656
- "mode http"
4757
- "balance roundrobin"
48-
- "server varnish 127.0.0.1:6081 check"
58+
templates:
59+
- src: snippets/backend-server.cfg.j2
60+
vars:
61+
server_name: varnish
62+
server_address: 127.0.0.1
63+
server_port: 6081
64+
server_options: "check"
65+
- src: snippets/backend-add-header.cfg.j2
66+
vars:
67+
header_name: "X-Served-By"
68+
header_value: "varnish"
4969
- name: nginx_backend
5070
lines:
5171
- "mode http"
5272
- "http-request set-path %[path,regsub(^/backend,/,)]"
53-
- "server nginx 127.0.0.1:9080 check"
73+
templates:
74+
- src: snippets/backend-server.cfg.j2
75+
vars:
76+
server_name: nginx
77+
server_address: 127.0.0.1
78+
server_port: 9080
79+
server_options: "check"
5480
haproxy_decision_spoas:
5581
decision:
5682
enabled: true

0 commit comments

Comments
 (0)