-
Notifications
You must be signed in to change notification settings - Fork 0
/
coreos.rb
39 lines (33 loc) · 1.11 KB
/
coreos.rb
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
require 'chef/provisioning'
require 'chef/provisioning/hanlon_driver/hanlon_driver'
with_driver 'hanlon:1.1.1.11:8026/hanlon/api/v1'
num = ENV['HARDWARE_TARGET'] || '2'
deploy="coreos_on_#{num}"
hanlon_image 'coreos_production_iso_image.iso' do
type 'os'
version '556'
description 'CoreOS stable 556'
end
hanlon_model "#{deploy}" do
action :delete if ENV['DESTROY']
image 'coreos_production_iso_image.iso'
template 'coreos_stable'
metadata ({
hostname_prefix: 'iicoremem',
domainname: 'vulk.can.cd',
cloud_config: {
install_disk: '/dev/sda',
users: [{ name: 'hh','coreos-ssh-import-github' => 'hh',
groups: [ 'sudo', 'docker']}],
coreos: { units: [
{ name: 'etcd.service', command: 'start' },
{ name: 'fleet.service', command: 'start' },
]},} })
end
hanlon_policy "#{deploy}" do
model "#{deploy}"
template 'linux_deploy'
tags num
maximum 1
end
bash "ipmi-chassis -h 1.1.0.#{num} --chassis-control=power-up"