summaryrefslogtreecommitdiff
path: root/acceptance/cookbook-git/.kitchen.ec2.yml
blob: ba323aa65ffebffba7afecf3aa158a842e75b934 (plain)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# Not quite ready yet

<%
def file_if_exists(path)
  path = File.expand_path(path)
  File.exist?(path) ? path : nil
end
%>

driver:
  name: ec2
  tags:
    X-Project: Kitchen Tests
  aws_ssh_key_id: <%= ENV['AWS_SSH_KEY_ID'] || ENV['USER'] || ENV['USERNAME'] %>
  # test-specific stuff
  region: us-west-2
  availability_zone: a
  subnet_id: subnet-19ac017c
  security_group_ids: ["sg-e401eb83", "sg-96274af3"]
  instance_type: m3.large
#  associate_public_ip: true  # Don't enable public IP, as subnet specified is behind VPN

transport:
  ssh_key: <%= file_if_exists("~/.ssh/#{ENV['AWS_SSH_KEY_ID'] || ENV['USER'] || ENV['USERNAME']}.pem") ||
               file_if_exists("~/.ssh/#{ENV['AWS_SSH_KEY_ID'] || ENV['USER'] || ENV['USERNAME']}") ||
               file_if_exists("~/.ssh/id_rsa") %>

platforms:
  #
  # AIX
  #
  # - name: aix-6.1
  # - name: aix-7.1
  #
  # Debian
  #
  - name: debian-8
    driver:
      image_search:
        name: debian-jessie-*
        owner-id: 379101102735
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: admin
  - name: debian-7
    driver:
      image_search:
        name: debian-wheezy-*
        owner-id: 379101102735
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: standard
        image-type: machine
    transport:
      username: admin
  #
  # Ubuntu
  #
  - name: ubuntu-15.10
    driver:
      image_search:
        name: ubuntu/images/*/ubuntu-*-15.10-amd64-server-*
        owner-id: 099720109477
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: ubuntu
  - name: ubuntu-14.04
    driver:
      image_search:
        name: ubuntu/images/*/ubuntu-*-14.04-*-server-*
        owner-id: 099720109477
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: ubuntu
  # - name: ubuntu-12.04
  #   driver:
  #     image_search:
  #       name: ubuntu/images/*/ubuntu-*-12.04-*-server-*
  #       owner-id: 099720109477
  #       architecture: x86_64
  #       virtualization-type: hvm
  #       block-device-mapping.volume-type: gp2
  #       image-type: machine
  #   transport:
  #     username: ubuntu
  #
  # Red Hat Enterprise Linux
  #
  - name: el-7
    driver:
      image_search:
        name: RHEL-7.*
        owner-id: 309956199498
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: ec2-user
  - name: el-6
    driver:
      image_search:
        name: RHEL-6.*
        owner-id: 309956199498
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: ec2-user
  - name: el-5
    driver:
      image_search:
        name: RHEL-5.*
        owner-id: 309956199498
        architecture: x86_64
        virtualization-type: paravirtual
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: ec2-user
  #
  # FreeBSD
  #
  - name: freebsd-10
    driver:
      image_search:
        name: FreeBSD/EC2 10.*-RELEASE*
        owner-id: 118940168514
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: ec2-user
  - name: freebsd-9
    driver:
      image_search:
        name: FreeBSD/EC2 9.*-RELEASE*
        owner-id: 118940168514
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: ec2-user
  # - name: freebsd-8
  #   driver:
  #     image_search:
  #       name: FreeBSD/EC2 8.*-RELEASE*
  #       owner-id: 118940168514
  #       architecture: x86_64
  #       virtualization-type: hvm
  #       block-device-mapping.volume-type: standard
  #       image-type: machine
  #   transport:
  #     username: ec2-user
  #
  # OS/X
  #
  # - name: mac_os_x-10.11
  # - name: mac_os_x-10.10
  # - name: mac_os_x-10.9
  # - name: mac_os_x-10.8
  #
  # Nexus???
  #
  # - name: nexus-7
  #
  # Solaris
  #
  # - name: solaris-11
  # - name: solaris-10
  #
  # Windows
  #
  - name: windows-2012r2
    driver:
      image_search:
        name: Windows_Server-2012-R2*-English-*-Base-*
        owner-alias: amazon
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
      user_data: |
        <powershell>
        $logfile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Logs\\kitchen-ec2.log"
        #PS Remoting and & winrm.cmd basic config
        Enable-PSRemoting -Force -SkipNetworkProfileCheck
        & winrm.cmd set winrm/config '@{MaxTimeoutms="1800000"}' >> $logfile
        & winrm.cmd set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}' >> $logfile
        & winrm.cmd set winrm/config/winrs '@{MaxShellsPerUser="50"}' >> $logfile
        #Server settings - support username/password login
        & winrm.cmd set winrm/config/service/auth '@{Basic="true"}' >> $logfile
        & winrm.cmd set winrm/config/service '@{AllowUnencrypted="true"}' >> $logfile
        & winrm.cmd set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}' >> $logfile
        #Firewall Config
        & netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" profile=public protocol=tcp localport=5985 remoteip=localsubnet new remoteip=any  >> $logfile
        #Set script execution to unrestricted
        & Set-ExecutionPolicy Unrestricted -Force
        </powershell>
    transport:
      username: administrator

  - name: windows-2012
    driver:
      image_search:
        name: Windows_Server-2012-RTM*-English-*-Base-*
        owner-alias: amazon
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: administrator
  - name: windows-2008r2
    driver:
      image_search:
        name: Windows_Server-2008-R2*-English-*-Base-*
        owner-alias: amazon
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine
    transport:
      username: administrator
  #
  # Centos
  #
  # - name: centos-7
  #   driver:
  #     image_search:
  #       name: CentOS Linux 7 *
  #       owner-alias: aws-marketplace
  #       architecture: x86_64
  #       virtualization-type: hvm
  #       block-device-mapping.volume-type: standard
  #       image-type: machine
  #   transport:
  #     username: root
  # - name: centos-6
  #   driver:
  #     image_search:
  #       name: CentOS-6.5-GA-*
  #       owner-alias: aws-marketplace
  #       architecture: x86_64
  #       virtualization-type: paravirtual
  #       block-device-mapping.volume-type: standard
  #       image-type: machine
  #   transport:
  #     username: root
  #
  # Fedora
  #
  - name: fedora-21
    driver:
      image_search:
        name: Fedora-Cloud-Base-21-*
        owner-id: 125523088429
        architecture: x86_64
        virtualization-type: hvm
        block-device-mapping.volume-type: gp2
        image-type: machine

suites:
  - name: default
    run_list:
      - recipe[git]
    attributes: {}
    includes: ["ubuntu-14.04"]
    excludes: ["windows-2012r2", "windows-2012", "windows-2008r2"]
  - name: source
    includes: ["nonexistent"]
    excludes: ["ubuntu-12.04", "ubuntu-10.04", "windows-2012r2", "windows-2012", "windows-2008r2"]
    run_list:
      - recipe[git::source]
    attributes: {}
  - name: default-windows
    includes: [
      # 'windows-8.1-professional',
      # 'windows-2008r2-standard',
      "windows-2012r2",
      # "windows-2012",
      # "windows-2008r2"
    ]
    run_list:
      - recipe[git]
    attributes: {}

provisioner:
  name: chef_zero
  product_name: chef
  product_version: latest
  channel: unstable