-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.kitchen-cluster.yml
181 lines (170 loc) · 3.92 KB
/
.kitchen-cluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
---
# run with:
# user@host:~> export KITCHEN_YAML=.kitchen-cluster.yml
# user@host:~> kitchen verify
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
box: bento-VAGRANTSLASH-centos-7.4
box_url: https://vagrantcloud.com/bento/centos-7.4
provisioner:
name: chef_zero
always_update_cookbooks: true
# client_rb:
# environment: dev
attributes:
consul:
config:
datacenter: dc1
domain: dev
encrypt: Dt3P9SpKGAR/DIUN1cDirg==
verifier:
name: inspec
platforms:
- name: server-1
# run_list:
# - role[postmaster]
driver_config:
customize:
memory: 1024
network:
- ['private_network', {ip: '192.168.19.11'}]
verifier:
inspec_tests:
- test/smoke/default
- test/smoke/server
attributes:
consul:
config:
bootstrap: true
server: true
bind_addr: 192.168.19.11
client_addr: 127.0.0.1
- name: server-2
# run_list:
# - role[relayhost]
driver_config:
customize:
memory: 1024
network:
- ['private_network', {ip: '192.168.19.12'}]
verifier:
inspec_tests:
- test/smoke/default
- test/smoke/server
attributes:
consul:
config:
# bootstrap_expect: 3
retry_join: ['192.168.19.11']
server: true
bind_addr: 192.168.19.12
client_addr: 127.0.0.1
- name: server-3
# run_list:
# - role[relayhost]
driver_config:
customize:
memory: 1024
network:
- ['private_network', {ip: '192.168.19.13'}]
verifier:
inspec_tests:
- test/smoke/default
- test/smoke/server
attributes:
consul:
config:
# bootstrap_expect: 3
retry_join: ['192.168.19.11']
server: true
bind_addr: 192.168.19.13
client_addr: 127.0.0.1
- name: client-1
run_list:
- recipe[consul-ng::default]
- recipe[consul-ng::services]
- recipe[consul-ng::watches]
- recipe[consul-ng::kitchen]
driver_config:
network:
- ['private_network', {ip: '192.168.19.21'}]
verifier:
inspec_tests:
- test/smoke/default
- test/smoke/client
attributes:
consul:
config:
start_join: ['192.168.19.11']
bind_addr: 192.168.19.21
client_addr: 127.0.0.1
services:
- name: web
port: 80
- name: proxy
port: 8080
tags: ['rails']
watches:
- handler_type: script
name: new-nodes
type: nodes
args: ['/bin/sh', '-c', 'cat', '>', '/tmp/nodes.lst']
- name: client-2
run_list:
- recipe[consul-ng::default]
- recipe[consul-ng::services]
- recipe[consul-ng::scripts]
- recipe[consul-ng::checks]
- recipe[consul-ng::kitchen]
- recipe[consul-ng::watches]
driver_config:
network:
- ['private_network', {ip: '192.168.19.22'}]
verifier:
inspec_tests:
- test/smoke/default
- test/smoke/client
attributes:
consul:
config:
start_join: ['192.168.19.11']
bind_addr: 192.168.19.22
client_addr: 127.0.0.1
services:
- name: web
port: 80
- name: proxy
port: 8080
tags: ['rails', 'node', 'grafana']
scripts:
- name: web_alive
script_content: curl -s http://localhost/
- name: book_file
cookbook: consul-ng
cookbook_file: web-test.sh
- name: template
cookbook: consul-ng
cookbook_template: web-test.sh.erb
checks:
- name: web-alive
tcp: localhost:80
interval: 30s
service_id: web
watches:
- handler_type: script
name: key-web
type: key
key: web
args: ['cat']
suites:
- name: consul
run_list:
- recipe[consul-ng::default]
- recipe[consul-ng::kitchen]
attributes:
consul:
version: 1.1.0
# verifier:
# inspec_tests:
# - test/smoke/default