opskeleton 0.9.8 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +67 -151
- data/README.md +3 -3
- data/autocomplete/_opsk +11 -0
- data/bin/opsk +3 -3
- data/docs/doc.adoc +27 -135
- data/lib/opskeleton.rb +2 -2
- data/lib/opskeleton/analyze.rb +18 -0
- data/lib/opskeleton/clean.rb +0 -8
- data/lib/opskeleton/package.rb +4 -18
- data/lib/opskeleton/thorable.rb +1 -2
- data/lib/opskeleton/update.rb +27 -0
- data/lib/opskeleton/version.rb +1 -1
- data/opskeleton.gemspec +6 -8
- data/test/test_helper.rb +0 -1
- metadata +20 -61
- data/lib/opskeleton/dockerize.rb +0 -29
- data/lib/opskeleton/generate_chef.rb +0 -85
- data/templates/chef/Cheffile +0 -3
- data/templates/chef/Gemfile.erb +0 -21
- data/templates/chef/Rakefile.erb +0 -76
- data/templates/chef/boot.sh +0 -4
- data/templates/chef/dna.json.erb +0 -5
- data/templates/chef/environments/dev.rb +0 -4
- data/templates/chef/gitignore +0 -5
- data/templates/chef/opsk.yaml +0 -18
- data/templates/chef/roles.erb +0 -2
- data/templates/chef/run.sh +0 -1
- data/templates/chef/solo.rb +0 -6
- data/templates/chef/ubuntu_docker.erb +0 -15
- data/templates/chef/vagrant.erb +0 -28
- data/templates/fig.yml.erb +0 -5
- data/test/chef_package_test.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4527e12e7195227b3a1e6196be5bcc73fd1bd14
|
4
|
+
data.tar.gz: 0b80916fb0d4088c32ec46985781d8caadb29dcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384af8c4b51c63cca1d3437c1a3004838727ee211b66bbecd58a3d7c4570f6d35422de8b1988a842aa0fdbe732aacd5ef6bc6a8438200a6565b777d22cab5416
|
7
|
+
data.tar.gz: f296b30e181976539c91e59f4c86de5c11eaf6347faa97d6199a2dfda8bf18070ba7636c2491da5e9b2e3e9e456b57940cd88f64e1e10abe6c055a75c9f527bc
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
opskeleton (0.9.
|
4
|
+
opskeleton (0.9.9)
|
5
5
|
aws-sdk (~> 2)
|
6
6
|
bintray_deploy
|
7
7
|
git
|
8
|
-
git_clone_url
|
8
|
+
git_clone_url (~> 1.0)
|
9
9
|
net-scp
|
10
10
|
thor
|
11
11
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
CFPropertyList (2.2.8)
|
16
15
|
activemodel (4.2.3)
|
17
16
|
activesupport (= 4.2.3)
|
18
17
|
builder (~> 3.1)
|
@@ -22,68 +21,34 @@ GEM
|
|
22
21
|
minitest (~> 5.1)
|
23
22
|
thread_safe (~> 0.3, >= 0.3.4)
|
24
23
|
tzinfo (~> 1.1)
|
25
|
-
asciidoctor (1.5.
|
26
|
-
aws-sdk (2.
|
27
|
-
aws-sdk-resources (= 2.
|
28
|
-
aws-sdk-core (2.
|
24
|
+
asciidoctor (1.5.5)
|
25
|
+
aws-sdk (2.7.3)
|
26
|
+
aws-sdk-resources (= 2.7.3)
|
27
|
+
aws-sdk-core (2.7.3)
|
28
|
+
aws-sigv4 (~> 1.0)
|
29
29
|
jmespath (~> 1.0)
|
30
|
-
aws-sdk-resources (2.
|
31
|
-
aws-sdk-core (= 2.
|
30
|
+
aws-sdk-resources (2.7.3)
|
31
|
+
aws-sdk-core (= 2.7.3)
|
32
|
+
aws-sigv4 (1.0.0)
|
32
33
|
bintray_deploy (0.0.4)
|
33
34
|
configuration
|
34
35
|
rest-client
|
35
36
|
thor
|
36
|
-
builder (3.2.
|
37
|
-
|
38
|
-
chef-config (= 12.4.1)
|
39
|
-
chef-zero (~> 4.2, >= 4.2.2)
|
40
|
-
diff-lcs (~> 1.2, >= 1.2.4)
|
41
|
-
erubis (~> 2.7)
|
42
|
-
ffi-yajl (~> 2.2)
|
43
|
-
highline (~> 1.6, >= 1.6.9)
|
44
|
-
mixlib-authentication (~> 1.3)
|
45
|
-
mixlib-cli (~> 1.4)
|
46
|
-
mixlib-log (~> 1.3)
|
47
|
-
mixlib-shellout (>= 2.0.0.rc.0, < 3.0)
|
48
|
-
net-ssh (~> 2.6)
|
49
|
-
net-ssh-multi (~> 1.1)
|
50
|
-
ohai (~> 8.0)
|
51
|
-
plist (~> 3.1.0)
|
52
|
-
pry (~> 0.9)
|
53
|
-
rspec-core (~> 3.2)
|
54
|
-
rspec-expectations (~> 3.2)
|
55
|
-
rspec-mocks (~> 3.2)
|
56
|
-
rspec_junit_formatter (~> 0.2.0)
|
57
|
-
serverspec (~> 2.7)
|
58
|
-
specinfra (~> 2.10)
|
59
|
-
syslog-logger (~> 1.6)
|
60
|
-
chef-config (12.4.1)
|
61
|
-
mixlib-config (~> 2.0)
|
62
|
-
mixlib-shellout (~> 2.0)
|
63
|
-
chef-zero (4.2.3)
|
64
|
-
ffi-yajl (>= 1.1, < 3.0)
|
65
|
-
hashie (~> 2.0)
|
66
|
-
mixlib-log (~> 1.3)
|
67
|
-
rack
|
68
|
-
uuidtools (~> 2.1)
|
69
|
-
coderay (1.1.0)
|
37
|
+
builder (3.2.3)
|
38
|
+
coderay (1.1.1)
|
70
39
|
configuration (1.3.4)
|
71
|
-
diff-lcs (1.
|
72
|
-
domain_name (0.5.
|
40
|
+
diff-lcs (1.3)
|
41
|
+
domain_name (0.5.20161129)
|
73
42
|
unf (>= 0.0.5, < 1.0.0)
|
74
|
-
|
75
|
-
|
76
|
-
CFPropertyList (~> 2.2.6)
|
77
|
-
faraday (0.9.1)
|
43
|
+
facter (2.4.6)
|
44
|
+
faraday (0.9.2)
|
78
45
|
multipart-post (>= 1.2, < 3)
|
79
|
-
ffi (1.9.
|
80
|
-
ffi-yajl (2.2.2)
|
81
|
-
libyajl2 (~> 1.2)
|
46
|
+
ffi (1.9.17)
|
82
47
|
formatador (0.2.5)
|
83
|
-
git (1.
|
84
|
-
git_clone_url (0.1
|
85
|
-
uri-ssh_git
|
86
|
-
guard (2.
|
48
|
+
git (1.3.0)
|
49
|
+
git_clone_url (1.0.1)
|
50
|
+
uri-ssh_git (>= 1.0, < 2.0)
|
51
|
+
guard (2.13.0)
|
87
52
|
formatador (>= 0.2.4)
|
88
53
|
listen (>= 2.7, <= 4.0)
|
89
54
|
lumberjack (~> 1.0)
|
@@ -99,7 +64,6 @@ GEM
|
|
99
64
|
guard-shell (0.7.1)
|
100
65
|
guard (>= 2.0.0)
|
101
66
|
guard-compat (~> 1.0)
|
102
|
-
hashie (2.1.2)
|
103
67
|
her (0.6.8)
|
104
68
|
activemodel (>= 3.0.0)
|
105
69
|
activesupport (>= 3.0.0)
|
@@ -107,78 +71,51 @@ GEM
|
|
107
71
|
multi_json (~> 1.7)
|
108
72
|
hiera (1.3.4)
|
109
73
|
json_pure
|
110
|
-
|
111
|
-
http-cookie (1.0.2)
|
74
|
+
http-cookie (1.0.3)
|
112
75
|
domain_name (~> 0.5)
|
113
76
|
i18n (0.7.0)
|
114
|
-
|
115
|
-
jmespath (1.0.2)
|
116
|
-
multi_json (~> 1.0)
|
77
|
+
jmespath (1.3.1)
|
117
78
|
json (1.8.3)
|
118
|
-
json_pure (
|
79
|
+
json_pure (2.0.3)
|
119
80
|
librarian-puppet (2.1.0)
|
120
81
|
librarianp (>= 0.5.1)
|
121
82
|
puppet_forge
|
122
83
|
rsync
|
123
84
|
librarianp (0.6.3)
|
124
85
|
thor (~> 0.15)
|
125
|
-
|
126
|
-
|
127
|
-
rb-
|
128
|
-
|
129
|
-
lumberjack (1.0.9)
|
86
|
+
listen (3.0.8)
|
87
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
88
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
89
|
+
lumberjack (1.0.11)
|
130
90
|
metaclass (0.0.4)
|
131
91
|
method_source (0.8.2)
|
132
|
-
mime-types (
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
mixlib-cli (1.5.0)
|
137
|
-
mixlib-config (2.2.1)
|
138
|
-
mixlib-log (1.6.0)
|
139
|
-
mixlib-shellout (2.1.0)
|
92
|
+
mime-types (3.1)
|
93
|
+
mime-types-data (~> 3.2015)
|
94
|
+
mime-types-data (3.2016.0521)
|
95
|
+
minitest (5.10.1)
|
140
96
|
mocha (1.1.0)
|
141
97
|
metaclass (~> 0.0.1)
|
142
|
-
multi_json (1.
|
98
|
+
multi_json (1.12.1)
|
143
99
|
multipart-post (2.0.0)
|
144
|
-
nenv (0.
|
100
|
+
nenv (0.3.0)
|
145
101
|
net-scp (1.2.1)
|
146
102
|
net-ssh (>= 2.6.5)
|
147
|
-
net-ssh (
|
148
|
-
|
149
|
-
|
150
|
-
net-ssh-multi (1.2.1)
|
151
|
-
net-ssh (>= 2.6.5)
|
152
|
-
net-ssh-gateway (>= 1.2.0)
|
153
|
-
net-telnet (0.1.1)
|
154
|
-
netrc (0.10.3)
|
155
|
-
notiffany (0.0.6)
|
103
|
+
net-ssh (4.0.1)
|
104
|
+
netrc (0.11.0)
|
105
|
+
notiffany (0.1.1)
|
156
106
|
nenv (~> 0.1)
|
157
107
|
shellany (~> 0.0)
|
158
|
-
ohai (8.5.0)
|
159
|
-
ffi (~> 1.9)
|
160
|
-
ffi-yajl (~> 2.2)
|
161
|
-
ipaddress
|
162
|
-
mime-types (~> 2.0)
|
163
|
-
mixlib-cli
|
164
|
-
mixlib-config (~> 2.0)
|
165
|
-
mixlib-log
|
166
|
-
mixlib-shellout (~> 2.0)
|
167
|
-
rake (~> 10.1)
|
168
|
-
systemu (~> 2.6.4)
|
169
|
-
wmi-lite (~> 1.0)
|
170
|
-
plist (3.1.0)
|
171
108
|
posix-spawn (0.3.11)
|
172
|
-
pry (0.10.
|
109
|
+
pry (0.10.4)
|
173
110
|
coderay (~> 1.1.0)
|
174
111
|
method_source (~> 0.8.1)
|
175
112
|
slop (~> 3.4)
|
176
|
-
puppet (3.7
|
113
|
+
puppet (3.8.7)
|
177
114
|
facter (> 1.6, < 3)
|
178
115
|
hiera (~> 1.0)
|
179
116
|
json_pure
|
180
|
-
puppet-lint (
|
181
|
-
puppet-syntax (2.
|
117
|
+
puppet-lint (2.1.0)
|
118
|
+
puppet-syntax (2.2.0)
|
182
119
|
rake
|
183
120
|
puppet_forge (1.0.5)
|
184
121
|
her (~> 0.6.8)
|
@@ -191,62 +128,40 @@ GEM
|
|
191
128
|
pygments.rb (0.6.3)
|
192
129
|
posix-spawn (~> 0.3.6)
|
193
130
|
yajl-ruby (~> 1.2.0)
|
194
|
-
|
195
|
-
|
196
|
-
rb-
|
197
|
-
rb-inotify (0.9.5)
|
131
|
+
rake (12.0.0)
|
132
|
+
rb-fsevent (0.9.8)
|
133
|
+
rb-inotify (0.9.8)
|
198
134
|
ffi (>= 0.5.0)
|
199
|
-
rest-client (
|
135
|
+
rest-client (2.0.0)
|
200
136
|
http-cookie (>= 1.0.2, < 2.0)
|
201
|
-
mime-types (>= 1.16, <
|
202
|
-
netrc (~> 0.
|
203
|
-
rspec (3.
|
204
|
-
rspec-core (~> 3.
|
205
|
-
rspec-expectations (~> 3.
|
206
|
-
rspec-mocks (~> 3.
|
207
|
-
rspec-core (3.
|
208
|
-
rspec-support (~> 3.
|
209
|
-
rspec-expectations (3.
|
137
|
+
mime-types (>= 1.16, < 4.0)
|
138
|
+
netrc (~> 0.8)
|
139
|
+
rspec (3.5.0)
|
140
|
+
rspec-core (~> 3.5.0)
|
141
|
+
rspec-expectations (~> 3.5.0)
|
142
|
+
rspec-mocks (~> 3.5.0)
|
143
|
+
rspec-core (3.5.4)
|
144
|
+
rspec-support (~> 3.5.0)
|
145
|
+
rspec-expectations (3.5.0)
|
210
146
|
diff-lcs (>= 1.2.0, < 2.0)
|
211
|
-
rspec-support (~> 3.
|
212
|
-
rspec-
|
213
|
-
rspec-core (>= 3.0.0)
|
214
|
-
rspec-expectations (>= 3.0.0)
|
215
|
-
rspec-mocks (3.3.2)
|
147
|
+
rspec-support (~> 3.5.0)
|
148
|
+
rspec-mocks (3.5.0)
|
216
149
|
diff-lcs (>= 1.2.0, < 2.0)
|
217
|
-
rspec-support (~> 3.
|
218
|
-
rspec-puppet (2.
|
150
|
+
rspec-support (~> 3.5.0)
|
151
|
+
rspec-puppet (2.5.0)
|
219
152
|
rspec
|
220
|
-
rspec-support (3.
|
221
|
-
rspec_junit_formatter (0.2.3)
|
222
|
-
builder (< 4)
|
223
|
-
rspec-core (>= 2, < 4, != 2.12.0)
|
153
|
+
rspec-support (3.5.0)
|
224
154
|
rsync (1.0.9)
|
225
|
-
serverspec (2.20.0)
|
226
|
-
multi_json
|
227
|
-
rspec (~> 3.0)
|
228
|
-
rspec-its
|
229
|
-
specinfra (~> 2.38)
|
230
|
-
sfl (2.2)
|
231
155
|
shellany (0.0.1)
|
232
156
|
slop (3.6.0)
|
233
|
-
|
234
|
-
net-scp
|
235
|
-
net-ssh (~> 2.7)
|
236
|
-
net-telnet
|
237
|
-
sfl
|
238
|
-
syslog-logger (1.6.8)
|
239
|
-
systemu (2.6.5)
|
240
|
-
thor (0.19.1)
|
157
|
+
thor (0.19.4)
|
241
158
|
thread_safe (0.3.5)
|
242
159
|
tzinfo (1.2.2)
|
243
160
|
thread_safe (~> 0.1)
|
244
161
|
unf (0.1.4)
|
245
162
|
unf_ext
|
246
|
-
unf_ext (0.0.7.
|
247
|
-
uri-ssh_git (0.
|
248
|
-
uuidtools (2.1.5)
|
249
|
-
wmi-lite (1.0.0)
|
163
|
+
unf_ext (0.0.7.2)
|
164
|
+
uri-ssh_git (1.0.0)
|
250
165
|
yajl-ruby (1.2.1)
|
251
166
|
|
252
167
|
PLATFORMS
|
@@ -254,14 +169,15 @@ PLATFORMS
|
|
254
169
|
|
255
170
|
DEPENDENCIES
|
256
171
|
asciidoctor
|
257
|
-
|
258
|
-
guard
|
172
|
+
guard (= 2.13.0)
|
259
173
|
guard-minitest
|
260
174
|
guard-shell
|
261
175
|
librarian-puppet (= 2.1.0)
|
262
176
|
opskeleton!
|
263
|
-
|
264
|
-
puppet (= 3.7.5)
|
177
|
+
puppet (= 3.8.7)
|
265
178
|
puppetlabs_spec_helper (>= 0.1.0)
|
266
179
|
pygments.rb
|
267
180
|
rspec-puppet
|
181
|
+
|
182
|
+
BUNDLED WITH
|
183
|
+
1.14.3
|
data/README.md
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
Opskelaton is an opinionated bootstrap tool for local Sandbox projects, it aims to solve the following common issues:
|
6
6
|
|
7
|
-
* Developing Puppet
|
8
|
-
* Large monolithic Puppet
|
9
|
-
* Implicit/Missing dependencies including: Ruby version, OS, gems, modules
|
7
|
+
* Developing Puppet modules on master machines which results with 'It works on my master' approach.
|
8
|
+
* Large monolithic Puppet code bases, code isn't modular or reusable.
|
9
|
+
* Implicit/Missing dependencies including: Ruby version, OS, gems, modules.
|
10
10
|
* Manual steps in setting up and maintaining such projects.
|
11
11
|
* Non standard layout, projects missing README and LICENSE files, no clear separation between developed and dependant code.
|
12
12
|
* Lacking development guidelines (for example extracting general modules and exporting them).
|
data/autocomplete/_opsk
ADDED
data/bin/opsk
CHANGED
@@ -16,11 +16,11 @@ module Opsk
|
|
16
16
|
class Root < Thor
|
17
17
|
|
18
18
|
register Opsk::GeneratePuppet, 'generate_puppet', "generate_puppet [name] [box]", 'generates a Puppet based project '
|
19
|
-
register Opsk::
|
19
|
+
register Opsk::Analyze, 'analyze', "profile [file]", 'analyze the output of a puppet run'
|
20
20
|
register Opsk::Module, 'module', 'module [name]', 'generate an rspec ready Puppet module'
|
21
21
|
register Opsk::Package, 'package', 'package', 'packages current module for celestial'
|
22
|
-
register Opsk::Dockerize, 'dockerize', 'dockerize [from] [os_type]', 'Creates a docker image from the current sandbox'
|
23
22
|
register Opsk::Commit, 'commit', 'commit [message]', 'commit each changed puppet module under modules folder'
|
23
|
+
register Opsk::Update, 'update', 'update [module]', 'update a common module across projects'
|
24
24
|
register Opsk::Uncommited, 'uncommited', 'uncommited', 'list uncommited modules changes'
|
25
25
|
register Opsk::Push, 'push', 'push', 'push each changed puppet module under modules folder'
|
26
26
|
register Opsk::Clean, 'clean', 'clean', 'cleans up packaging products'
|
@@ -38,8 +38,8 @@ end
|
|
38
38
|
|
39
39
|
# not sure that this is the cleanest way
|
40
40
|
Opsk::Root.tasks['generate_puppet'].options = Opsk::GeneratePuppet.class_options
|
41
|
-
Opsk::Root.tasks['generate_chef'].options = Opsk::GenerateChef.class_options
|
42
41
|
Opsk::Root.tasks['push'].options = Opsk::Push.class_options
|
43
42
|
Opsk::Root.tasks['commit'].options = Opsk::Commit.class_options
|
43
|
+
Opsk::Root.tasks['analyze'].options = Opsk::Analyze.class_options
|
44
44
|
|
45
45
|
Opsk::Root.start ARGV
|
data/docs/doc.adoc
CHANGED
@@ -7,8 +7,10 @@ v0.9.2
|
|
7
7
|
:idprefix:
|
8
8
|
:source-highlighter: pygments
|
9
9
|
:pygments-style: friendly
|
10
|
+
:ubuntuversion: 16.04
|
10
11
|
:sectlinks:
|
11
12
|
|
13
|
+
|
12
14
|
== Introduction
|
13
15
|
|
14
16
|
Opskelaton is an opinionated bootstrap tool for local Sandbox projects, it aims to solve the following common issues:
|
@@ -31,7 +33,7 @@ Currently Opskeleton supports Puppet and Chef, this guide is segmented to common
|
|
31
33
|
|
32
34
|
Perquisites (on Ubuntu):
|
33
35
|
|
34
|
-
* Vagrant 1.
|
36
|
+
* Vagrant 1.8.x
|
35
37
|
* RVM
|
36
38
|
* Ruby >= 2.1.2
|
37
39
|
|
@@ -40,6 +42,26 @@ Perquisites (on Ubuntu):
|
|
40
42
|
$ sudo gem install opskeleton
|
41
43
|
```
|
42
44
|
|
45
|
+
=== Autocompletion
|
46
|
+
|
47
|
+
Both zsh and bash are supported just copy the macthing file from the project https://github.com/opskeleton/opskeleton/tree/master/autocomplete[autocomplete] folder.
|
48
|
+
|
49
|
+
```bash
|
50
|
+
$ opsk help
|
51
|
+
Describe available commands or one spe...
|
52
|
+
bumps up version (clearing old version...
|
53
|
+
cleans up packaging products
|
54
|
+
deploy packge into bintray.com
|
55
|
+
deploy packge into s3 bucket under pat...
|
56
|
+
deploy packge using scp to host
|
57
|
+
generate an rspec ready Puppet module
|
58
|
+
generates a Chef based project
|
59
|
+
generates a Puppet based project
|
60
|
+
packages current module for celestial
|
61
|
+
print opsk version
|
62
|
+
|
63
|
+
```
|
64
|
+
|
43
65
|
=== Boxes
|
44
66
|
|
45
67
|
Opskeleton recommends the use of https://github.com/box-cutter[box-cutter] in order to create Vagrant boxes in a consistent manner (as no free hosting solution currently exist):
|
@@ -47,19 +69,19 @@ Opskeleton recommends the use of https://github.com/box-cutter[box-cutter] in or
|
|
47
69
|
# make sure to have latest packer
|
48
70
|
$ packer version
|
49
71
|
Packer v0.6.0
|
50
|
-
$ git clone git
|
72
|
+
$ git clone git://github.com/box-cutter/ubuntu-vm.git
|
51
73
|
$ cd ubuntu-vm
|
52
74
|
# Edit Makefile.local
|
53
75
|
$ cat Makefile.local
|
54
76
|
# Makefile.local
|
55
77
|
CM := puppet
|
56
78
|
CM_VERSION := 3.6.1
|
57
|
-
$ make virtualbox/
|
79
|
+
$ make virtualbox/ubuntu1604
|
58
80
|
```
|
59
81
|
A useful convention for Box names:
|
60
82
|
|
61
83
|
```bash
|
62
|
-
ubuntu-
|
84
|
+
ubuntu-{ubuntuversion}_puppet-3.6.1 ([os]-[version]_[provisioner]-[version])
|
63
85
|
```
|
64
86
|
|
65
87
|
== Puppet
|
@@ -262,22 +284,11 @@ Opskeleton generates a Vagrant file with couple of enhancements:
|
|
262
284
|
* PUPPET_ENV (default dev) for setting puppet environment.
|
263
285
|
* Puppet options preset to match modules and hiera folders.
|
264
286
|
|
265
|
-
=== Docker
|
266
|
-
The only assumption that Opskelaton makes is that the target host will have Pupppet installed, this enables us to create docker images from our sandboxes quite easily:
|
267
|
-
|
268
|
-
```bash
|
269
|
-
# creates dockerfiles/<host> and fig.yml
|
270
|
-
$ opsk dockerize
|
271
|
-
$ opsk package
|
272
|
-
# grabs the opsk tar file
|
273
|
-
$ sudo fig build
|
274
|
-
```
|
275
|
-
|
276
287
|
=== Benchmarking
|
277
288
|
Tracking the speed of our provisioning code is important for keeping a consistent level of service with the produced sandboxes, enabling benchmarking:
|
278
289
|
|
279
290
|
```bash
|
280
|
-
$ opsk generate_puppet redis ubuntu-
|
291
|
+
$ opsk generate_puppet redis ubuntu-16.04 --bench-enable
|
281
292
|
# install imagemagic before bundle install
|
282
293
|
$ sudo apt-get install imagemagick libmagickwand-dev
|
283
294
|
$ rake serverspec:redis
|
@@ -296,125 +307,6 @@ $ rake plot:hosts plot:per_hosts
|
|
296
307
|
$ google-chrome plots
|
297
308
|
```
|
298
309
|
|
299
|
-
== Chef
|
300
|
-
|
301
|
-
=== Introduction
|
302
|
-
Opskelaton fully supports Chef based projects it offers similar features to the Puppet based sandboxes with additional support for roles, environments and cookbooks.
|
303
|
-
|
304
|
-
Creating out first sandbox
|
305
|
-
|
306
|
-
```bash
|
307
|
-
$ opsk generate_chef redis ubuntu-14.04
|
308
|
-
$ cd redis-sandbox
|
309
|
-
```
|
310
|
-
|
311
|
-
=== Structure
|
312
|
-
|
313
|
-
==== layout
|
314
|
-
Opskelaton creates the complete folder structure fine tuned to match best practices:
|
315
|
-
|
316
|
-
Folder layout:
|
317
|
-
|
318
|
-
image:https://raw.githubusercontent.com/opskeleton/opskeleton/master/img/chef-layout.png[width='30%',hight='50%']
|
319
|
-
|
320
|
-
==== lifecycle
|
321
|
-
|
322
|
-
Opskelaton defines a simple cookbook life cycle:
|
323
|
-
|
324
|
-
1. Internal non reusable cookbooks (usually specific to a client site) go under static-cookbooks
|
325
|
-
2. If we create a general reusable cookbook which is ready for prime time we pull out to a new git repository.
|
326
|
-
3. The extracted cookbook is added back as a third party (using link:https://github.com/applicationsonline/librarian-chef[librarian-chef]) cookbook under cookbooks folder).
|
327
|
-
|
328
|
-
Life cycle scheme:
|
329
|
-
|
330
|
-
image:https://raw.githubusercontent.com/opskeleton/opskeleton/master/img/chef-cycle.png[width='40%',hight='50%']
|
331
|
-
|
332
|
-
Creating new cookbooks is easy as:
|
333
|
-
|
334
|
-
```bash
|
335
|
-
$ opsk cookbook foo
|
336
|
-
```
|
337
|
-
|
338
|
-
=== Testing
|
339
|
-
|
340
|
-
Opskelaton supports testing/linting:
|
341
|
-
|
342
|
-
* Static cookbook testing that includes rspec and food-critic. (TBD)
|
343
|
-
* Integration testing using [serverspec](http://serverspec.org/) and Vagrant.
|
344
|
-
|
345
|
-
```bash
|
346
|
-
# running serverspec
|
347
|
-
$ rake spec
|
348
|
-
```
|
349
|
-
|
350
|
-
=== Packaging
|
351
|
-
Opskelaton fully supports deployment and portable execution of sandboxes on non Vagrant environments:
|
352
|
-
|
353
|
-
```bash
|
354
|
-
$ opsk generate_chef foo ubuntu-14.04.
|
355
|
-
$ cd foo-sandbox
|
356
|
-
# The package version file
|
357
|
-
$ cat opsk.yaml
|
358
|
-
|
359
|
-
---
|
360
|
-
version: '0.0.1'
|
361
|
-
name: redis
|
362
|
-
includes:
|
363
|
-
- Cheffile
|
364
|
-
- cookbooks
|
365
|
-
- static-cookbooks
|
366
|
-
- dna.json
|
367
|
-
- environments
|
368
|
-
- Gemfile
|
369
|
-
- Gemfile.lock
|
370
|
-
- opsk.yaml
|
371
|
-
- roles
|
372
|
-
- LICENSE-2.0.txt
|
373
|
-
- run.sh
|
374
|
-
- boot.sh
|
375
|
-
- solo.rb
|
376
|
-
|
377
|
-
# post bundle and gem install ..
|
378
|
-
$ opsk package
|
379
|
-
create pkg/foo-sandbox-0.0.1
|
380
|
-
create pkg/foo-sandbox-0.0.1/scripts
|
381
|
-
create pkg/foo-sandbox-0.0.1/scripts/lookup.rb
|
382
|
-
chmod pkg/foo-sandbox-0.0.1/scripts/lookup.rb
|
383
|
-
create pkg/foo-sandbox-0.0.1/scripts/run.sh
|
384
|
-
chmod pkg/foo-sandbox-0.0.1/scripts/run.sh
|
385
|
-
exist pkg
|
386
|
-
$ ls pkg
|
387
|
-
foo-sandbox-0.0.1 foo-sandbox-0.0.1.tar.gz
|
388
|
-
```
|
389
|
-
The packaging process creates a portable tar file that can be run on any machine with chef-solo installed via the bundled run.sh:
|
390
|
-
|
391
|
-
```bash
|
392
|
-
$ tar -xvzf foo-sandbox-0.0.1.tar.gz
|
393
|
-
$ cd foo-sandbox-0.0.1
|
394
|
-
# expects to get the chef environment
|
395
|
-
$ sudo ./run.sh dev
|
396
|
-
```
|
397
|
-
|
398
|
-
=== Updating
|
399
|
-
|
400
|
-
Keeping you box up to date with latest opsk version is easy, just re-generate it again and resolve conflicts by answering y/n:
|
401
|
-
```bash
|
402
|
-
# Moving to latest opsk
|
403
|
-
$ gem update opskeleton
|
404
|
-
# foo box already exists
|
405
|
-
$ opsk generate_chef foo <vagrant-box>
|
406
|
-
exist foo-sandbox
|
407
|
-
conflict foo-sandbox/Vagrantfile
|
408
|
-
Overwrite /home/ronen/code/foo-sandbox/Vagrantfile? (enter "h" for help) [Ynaqdh]
|
409
|
-
```
|
410
|
-
|
411
|
-
=== Vagrant
|
412
|
-
Opskeleton generates a Vagrant file with couple of enhancements:
|
413
|
-
|
414
|
-
* CHEF_ENV (default dev) for setting chef environment.
|
415
|
-
* Default role (sandbox name) created under roles/{type}.rb
|
416
|
-
* static-cookbooks/cookbooks roles/environments folders are set.
|
417
|
-
|
418
310
|
== Deployment
|
419
311
|
|
420
312
|
The packaged tar files can be consumed using any tool and protocol (http, s3 etc), opsk has built in support for deploying public sandboxes into:
|