Skip to content

Commit 12be6ff

Browse files
committed
test(pillar): provide default pillar working on all platforms
1 parent 92831b6 commit 12be6ff

2 files changed

Lines changed: 206 additions & 1 deletion

File tree

kitchen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ suites:
162162
- hosts
163163
- haproxy
164164
pillars_from_files:
165-
haproxy.sls: pillar.example
166165
hosts.sls: test/salt/pillar/hosts.sls
166+
haproxy.sls: test/salt/pillar/default.sls
167167
dependencies:
168168
- name: hosts
169169
path: ./test/salt/salt

test/salt/pillar/default.sls

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
---
2+
haproxy:
3+
# use lookup section to override 'map.jinja' values
4+
# lookup:
5+
# user: 'custom-user'
6+
# group: 'custom-group'
7+
# new setting to override configuration file path
8+
# config_file: /etc/haproxy/haproxy.cfg
9+
enabled: true
10+
# Overwrite an existing config file if present
11+
# (default behaviour unless set to false)
12+
overwrite: true
13+
# old setting to override configuration file path, kept for compatibility
14+
# config_file_path: /etc/haproxy/haproxy.cfg
15+
global:
16+
log:
17+
- 127.0.0.1 local2
18+
- 127.0.0.1 local1 notice
19+
# Option log-tag parameter, sets the tag field in the syslog header
20+
log-tag: haproxy
21+
# Optional log-send-hostname parameter, sets the hostname field in the syslog header
22+
log-send-hostname: localhost
23+
stats:
24+
enable: true
25+
# Using the `haproxy:global:chroot:path`
26+
socketpath: /var/lib/haproxy/stats
27+
mode: 660
28+
level: admin
29+
# yamllint disable-line rule:line-length
30+
# Optional extra bind parameter, for example to set the owner/group on the socket file
31+
extra: user haproxy group haproxy
32+
# yamllint disable-line rule:line-length
33+
ssl-default-bind-ciphers: "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384"
34+
ssl-default-bind-options: "no-sslv3 no-tlsv10 no-tlsv11"
35+
36+
user: haproxy
37+
group: haproxy
38+
chroot:
39+
enable: true
40+
path: /var/lib/haproxy
41+
42+
daemon: true
43+
44+
45+
userlists:
46+
userlist1:
47+
users:
48+
john: insecure-password doe
49+
sam: insecure-password frodo
50+
51+
defaults:
52+
log: global
53+
mode: http
54+
retries: 3
55+
options:
56+
- httplog
57+
- dontlognull
58+
- forwardfor
59+
- http-server-close
60+
# yamllint disable-line rule:line-length
61+
logformat: "%ci:%cp\\ [%t]\\ %ft\\ %b/%s\\ %Tq/%Tw/%Tc/%Tr/%Tt\\ %ST\\ %B\\ %CC\\ %CS\\ %tsc\\ %ac/%fc/%bc/%sc/%rc\\ %sq/%bq\\ %hr\\ %hs\\ %{+Q}r"
62+
timeouts:
63+
- http-request 10s
64+
- queue 1m
65+
- connect 10s
66+
- client 1m
67+
- server 1m
68+
- http-keep-alive 10s
69+
- check 10s
70+
stats:
71+
- enable
72+
- uri: '/admin?stats'
73+
- realm: 'Haproxy\ Statistics'
74+
- auth: 'admin1:AdMiN123'
75+
76+
77+
listens:
78+
stats:
79+
bind:
80+
- "0.0.0.0:8998"
81+
mode: http
82+
stats:
83+
enable: true
84+
uri: "/admin?stats"
85+
refresh: "20s"
86+
myservice:
87+
bind:
88+
- "*:8888"
89+
options:
90+
- forwardfor
91+
- http-server-close
92+
defaultserver:
93+
slowstart: 60s
94+
maxconn: 256
95+
maxqueue: 128
96+
weight: 100
97+
servers:
98+
web1:
99+
host: web1.example.com
100+
port: 80
101+
check: check
102+
web2:
103+
host: web2.example.com
104+
port: 18888
105+
check: check
106+
web3:
107+
host: web3.example.com
108+
redis:
109+
bind:
110+
- '*:6379'
111+
balance: roundrobin
112+
defaultserver:
113+
fall: 3
114+
options:
115+
- tcp-check
116+
tcpchecks:
117+
- send PINGrn
118+
- expect string +PONG
119+
- expect string role:master
120+
- send QUITrn
121+
- expect string +OK
122+
servers:
123+
server1:
124+
host: server1
125+
port: 6379
126+
check: check
127+
extra: port 6379 inter 1s
128+
server2:
129+
host: server2
130+
port: 6379
131+
check: check
132+
extra: port 6379 inter 1s backup
133+
frontends:
134+
frontend1:
135+
name: www-http
136+
bind: "*:80"
137+
redirects:
138+
- scheme https if !{ ssl_fc }
139+
reqadds:
140+
- "X-Forwarded-Proto http"
141+
default_backend: www-backend
142+
143+
# www-https:
144+
# bind: "*:443 ssl crt /etc/ssl/private/certificate-chain-and-key-combined.pem"
145+
# yamllint disable-line rule:line-length
146+
# logformat: "%ci:%cp\\ [%t]\\ %ft\\ %b/%s\\ %Tq/%Tw/%Tc/%Tr/%Tt\\ %ST\\ %B\\ %CC\\ %CS\\ %tsc\\ %ac/%fc/%bc/%sc/%rc\\ %sq/%bq\\ %hr\\ %hs\\ %{+Q}r\\ ssl_version:%sslv\\ ssl_cipher:%sslc"
147+
# reqadds:
148+
# - "X-Forwarded-Proto https"
149+
# default_backend: www-backend
150+
# acls:
151+
# - url_static path_beg -i /static /images /javascript /stylesheets
152+
# - url_static path_end -i .jpg .gif .png .css .js
153+
# use_backends:
154+
# - static-backend if url_static
155+
# extra: "rspadd Strict-Transport-Security:\ max-age=15768000"
156+
# some-services:
157+
# bind:
158+
# - "*:8080"
159+
# - "*:8088"
160+
# default_backend: api-backend
161+
162+
backends:
163+
backend1:
164+
name: www-backend
165+
balance: roundrobin
166+
extra: "http-request del-header ^X-Forwarded-For:"
167+
redirects:
168+
- scheme https if !{ ssl_fc }
169+
servers:
170+
server1:
171+
name: server1-its-name
172+
host: 192.168.1.213
173+
port: 80
174+
check: check
175+
static-backend:
176+
balance: roundrobin
177+
redirects:
178+
- scheme https if !{ ssl_fc }
179+
options:
180+
- http-server-close
181+
- httpclose
182+
- forwardfor except 127.0.0.0/8
183+
- httplog
184+
cookie: "pm insert indirect"
185+
stats:
186+
enable: true
187+
uri: /url/to/stats
188+
realm: LoadBalancer
189+
auth: "user:password"
190+
servers:
191+
some-server:
192+
host: 123.156.189.111
193+
port: 8080
194+
check: check
195+
another-server:
196+
host: 123.156.189.112
197+
api-backend:
198+
options:
199+
- http-server-close
200+
- forwardfor
201+
servers:
202+
apiserver1:
203+
host: apiserver1.example.com
204+
port: 80
205+
check: check

0 commit comments

Comments
 (0)