hetzner-bootstrap 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/example.rb +74 -6
- data/hetzner-bootstrap.gemspec +1 -0
- data/lib/hetzner/bootstrap/target.rb +1 -1
- data/lib/hetzner/bootstrap/version.rb +1 -1
- metadata +90 -55
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -55,7 +55,7 @@ Warnings:
|
|
55
55
|
Commercial Support available through:
|
56
56
|
-------------------------------------
|
57
57
|
|
58
|
-
[![Moriz GmbH](
|
58
|
+
[![Moriz GmbH](https://moriz.de/images/logo.png)](http://moriz.de/)
|
59
59
|
|
60
60
|
[Moriz GmbH, München](http://moriz.de/)
|
61
61
|
|
data/example.rb
CHANGED
@@ -3,10 +3,14 @@ require "rubygems"
|
|
3
3
|
require "hetzner-bootstrap"
|
4
4
|
|
5
5
|
# get your API login from Hetzner's customer panel at: https://robot.your-server.de/
|
6
|
-
|
7
|
-
|
6
|
+
# assign env variables:
|
7
|
+
# ROBOT_USER
|
8
|
+
# ROBOT_PASSWORD
|
9
|
+
#
|
10
|
+
# rbenv-tip: checkout rbenv-vars, it's awesome!
|
11
|
+
# https://github.com/sstephenson/rbenv-vars/
|
8
12
|
|
9
|
-
bs = Hetzner::Bootstrap.new :api => Hetzner::API.new(
|
13
|
+
bs = Hetzner::Bootstrap.new :api => Hetzner::API.new(ENV['ROBOT_USER'], ENV['ROBOT_PASSWORD'])
|
10
14
|
|
11
15
|
# 2 disks, software raid 1, etc.
|
12
16
|
template = <<EOT
|
@@ -14,25 +18,89 @@ DRIVE1 /dev/sda
|
|
14
18
|
DRIVE2 /dev/sdb
|
15
19
|
FORMATDRIVE2 0
|
16
20
|
|
21
|
+
## ===============
|
22
|
+
## SOFTWARE RAID:
|
23
|
+
## ===============
|
24
|
+
|
25
|
+
## activate software RAID? < 0 | 1 >
|
17
26
|
SWRAID 1
|
27
|
+
|
28
|
+
## Choose the level for the software RAID < 0 | 1 >
|
18
29
|
SWRAIDLEVEL 1
|
19
30
|
|
31
|
+
## which bootloader should be used? < lilo | grub >
|
20
32
|
BOOTLOADER grub
|
21
33
|
|
22
34
|
HOSTNAME <%= hostname %>
|
23
35
|
|
24
|
-
PART
|
36
|
+
## PART <mountpoint/lvm> <filesystem/VG> <size in MB>
|
37
|
+
##
|
38
|
+
## * <mountpoint/lvm> mountpoint for this filesystem *OR* keyword 'lvm'
|
39
|
+
## to use this PART as volume group (VG) for LVM
|
40
|
+
## * <filesystem/VG> can be ext2, ext3, reiserfs, xfs, swap *OR* name
|
41
|
+
## of the LVM volume group (VG), if this PART is a VG
|
42
|
+
## * <size> you can use the keyword 'all' to assign all the
|
43
|
+
## remaining space of the drive to the *last* partition.
|
44
|
+
## you can use M/G/T for unit specification in MIB/GIB/TIB
|
45
|
+
##
|
46
|
+
## notes:
|
47
|
+
## - extended partitions are created automatically
|
48
|
+
## - '/boot' cannot be on a xfs filesystem!
|
49
|
+
## - '/boot' cannot be on LVM!
|
50
|
+
## - when using software RAID 0, you need a '/boot' partition
|
51
|
+
|
52
|
+
PART /boot ext2 1G
|
25
53
|
PART lvm host 75G
|
26
54
|
PART lvm guest all
|
27
55
|
|
56
|
+
#LV <VG> <name> <mount> <filesystem> <size>
|
28
57
|
LV host root / ext3 50G
|
29
58
|
LV host swap swap swap 5G
|
30
59
|
|
31
|
-
|
60
|
+
|
61
|
+
## ========================
|
62
|
+
## OPERATING SYSTEM IMAGE:
|
63
|
+
## ========================
|
64
|
+
|
65
|
+
## full path to the operating system image
|
66
|
+
## supported image sources: local dir, ftp, http, nfs
|
67
|
+
## supported image types: tar, tar.gz, tar.bz, tar.bz2, tgz, tbz
|
68
|
+
## examples:
|
69
|
+
#
|
70
|
+
# local: /path/to/image/filename.tar.gz
|
71
|
+
# ftp: ftp://<user>:<password>@hostname/path/to/image/filename.tar.bz2
|
72
|
+
# http: http://<user>:<password>@hostname/path/to/image/filename.tbz
|
73
|
+
# https: https://<user>:<password>@hostname/path/to/image/filename.tbz
|
74
|
+
# nfs: hostname:/path/to/image/filename.tgz
|
75
|
+
|
76
|
+
# Default images provided by hetzner as of August 2012:
|
77
|
+
# CentOS-58-32-minimal.tar.gz
|
78
|
+
# CentOS-58-64-minimal.tar.gz
|
79
|
+
# CentOS-62-32-minimal.tar.gz
|
80
|
+
# CentOS-62-64-cpanel.tar.gz
|
81
|
+
# CentOS-62-64-minimal.tar.gz
|
82
|
+
# CentOS-63-32-minimal.tar.gz
|
83
|
+
# CentOS-63-64-cpanel.tar.gz
|
84
|
+
# CentOS-63-64-minimal.tar.gz
|
85
|
+
# Debian-60-squeeze-32-minimal.tar.gz
|
86
|
+
# Debian-60-squeeze-64-LAMP.tar.gz
|
87
|
+
# Debian-60-squeeze-64-minimal.tar.gz
|
88
|
+
# openSUSE-121-32-minimal.tar.gz
|
89
|
+
# openSUSE-121-64-minimal.tar.gz
|
90
|
+
# Ubuntu-1004-lucid-32-minimal.tar.gz
|
91
|
+
# Ubuntu-1004-lucid-64-minimal.tar.gz
|
92
|
+
# Ubuntu-1204-precise-32-minimal.tar.gz
|
93
|
+
# Ubuntu-1204-precise-64-minimal.tar.gz
|
94
|
+
|
95
|
+
|
96
|
+
IMAGE /root/images/Ubuntu-1204-precise-64-minimal.tar.gz
|
97
|
+
|
32
98
|
EOT
|
33
99
|
|
100
|
+
# the post_install hook is a great place to setup further software/system provisioning
|
101
|
+
#
|
34
102
|
post_install = <<EOT
|
35
|
-
knife bootstrap <%= ip %> -N <%= hostname %> "role[base],role[kvm_host]"
|
103
|
+
# knife bootstrap <%= ip %> -N <%= hostname %> "role[base],role[kvm_host]"
|
36
104
|
EOT
|
37
105
|
|
38
106
|
# duplicate entry for each system
|
data/hetzner-bootstrap.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency 'erubis', '>= 2.6.6'
|
18
18
|
|
19
19
|
s.add_development_dependency "rspec", ">= 2.4.0"
|
20
|
+
s.add_development_dependency "rake"
|
20
21
|
|
21
22
|
s.files = `git ls-files`.split("\n")
|
22
23
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -23,7 +23,7 @@ module Hetzner
|
|
23
23
|
@rescue_os = 'linux'
|
24
24
|
@rescue_os_bit = '64'
|
25
25
|
@retries = 0
|
26
|
-
@bootstrap_cmd = '/root/.oldroot/nfs/install/installimage -a -c /tmp/template'
|
26
|
+
@bootstrap_cmd = 'export TERM=xterm; /root/.oldroot/nfs/install/installimage -a -c /tmp/template'
|
27
27
|
@login = 'root'
|
28
28
|
|
29
29
|
if tmpl = options.delete(:template)
|
metadata
CHANGED
@@ -1,71 +1,103 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hetzner-bootstrap
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.2
|
4
5
|
prerelease:
|
5
|
-
version: 1.0.1
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Roland Moriz
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-02-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: hetzner-api
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
21
|
-
- -
|
22
|
-
- !ruby/object:Gem::Version
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
23
21
|
version: 1.0.1
|
24
22
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: net-ssh
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.0.1
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: net-ssh
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
30
33
|
none: false
|
31
|
-
requirements:
|
32
|
-
- -
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
34
37
|
version: 2.1.0
|
35
38
|
type: :runtime
|
36
|
-
version_requirements: *id002
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: erubis
|
39
39
|
prerelease: false
|
40
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.1.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: erubis
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
41
49
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
45
53
|
version: 2.6.6
|
46
54
|
type: :runtime
|
47
|
-
|
48
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.6.6
|
62
|
+
- !ruby/object:Gem::Dependency
|
49
63
|
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.4.0
|
70
|
+
type: :development
|
50
71
|
prerelease: false
|
51
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
73
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
56
77
|
version: 2.4.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
57
86
|
type: :development
|
58
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
59
94
|
description: Easy bootstrapping of hetzner.de rootservers using hetzner-api
|
60
|
-
email:
|
95
|
+
email:
|
61
96
|
- roland@moriz.de
|
62
97
|
executables: []
|
63
|
-
|
64
98
|
extensions: []
|
65
|
-
|
66
99
|
extra_rdoc_files: []
|
67
|
-
|
68
|
-
files:
|
100
|
+
files:
|
69
101
|
- .gitignore
|
70
102
|
- Gemfile
|
71
103
|
- LICENSE
|
@@ -80,30 +112,33 @@ files:
|
|
80
112
|
- spec/hetzner_bootstrap_spec.rb
|
81
113
|
homepage: http://moriz.de/opensource/hetzner-api
|
82
114
|
licenses: []
|
83
|
-
|
84
115
|
post_install_message:
|
85
116
|
rdoc_options: []
|
86
|
-
|
87
|
-
require_paths:
|
117
|
+
require_paths:
|
88
118
|
- lib
|
89
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
120
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version:
|
95
|
-
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
hash: 4425821493245410702
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
129
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version:
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
hash: 4425821493245410702
|
101
137
|
requirements: []
|
102
|
-
|
103
138
|
rubyforge_project:
|
104
|
-
rubygems_version: 1.8.
|
139
|
+
rubygems_version: 1.8.23
|
105
140
|
signing_key:
|
106
141
|
specification_version: 3
|
107
142
|
summary: Easy bootstrapping of hetzner.de rootservers using hetzner-api
|
108
|
-
test_files:
|
143
|
+
test_files:
|
109
144
|
- spec/hetzner_bootstrap_spec.rb
|