solokit 0.0.4.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +46 -1
- data/lib/chef.rb +1 -1
- data/lib/configuration.rb +4 -1
- data/lib/solokit/version.rb +1 -1
- metadata +3 -4
data/README.markdown
CHANGED
@@ -25,5 +25,50 @@ For each layer, Solokit looks for a directory structure like this:
|
|
25
25
|
Usage
|
26
26
|
---
|
27
27
|
|
28
|
-
|
28
|
+
Create the basic directory structure:
|
29
|
+
|
30
|
+
mkdir project
|
31
|
+
cd project
|
32
|
+
mkdir -p envs/test/chef/roles
|
33
|
+
|
34
|
+
|
35
|
+
Add something like this to a Rakefile:
|
36
|
+
|
37
|
+
require 'rubygems'
|
38
|
+
require 'solokit'
|
39
|
+
|
40
|
+
namespace :test do
|
41
|
+
desc "Update system configuration"
|
42
|
+
task :provision do
|
43
|
+
Solokit::UserJsonGenerator.generate! "test"
|
44
|
+
Solokit::Chef.provision!("test", "test.example.com", Solokit::Configuration.new("test"))
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
Add user configuration to users.yml (optional, but you need to provide a chef/roles/base.json without the users role if you skip this step):
|
49
|
+
|
50
|
+
# User data used to setup user accounts using chef.
|
51
|
+
# The hash is generated with "openssl passwd -1".
|
52
|
+
|
53
|
+
# Random PWgen password
|
54
|
+
default_hash: $1$8jLGWmPB$yFGmUThzbL0DMarc1CIY1/
|
55
|
+
|
56
|
+
groups:
|
57
|
+
developers: user
|
58
|
+
|
59
|
+
users:
|
60
|
+
user:
|
61
|
+
hash: $1$8jLGWmPB$yFGmUThzbL0DMarc1CIY1/
|
62
|
+
keys: jocke@keymaker
|
63
|
+
|
64
|
+
## -- Shared users --
|
65
|
+
deploy:
|
66
|
+
keys: group/developers
|
67
|
+
|
68
|
+
envs:
|
69
|
+
test:
|
70
|
+
users: group/developers deploy
|
71
|
+
sudo: group/developers
|
72
|
+
|
73
|
+
By default this setup assumes that you can login to root on the server using your ssh key.
|
29
74
|
|
data/lib/chef.rb
CHANGED
@@ -22,7 +22,7 @@ module Solokit
|
|
22
22
|
upload_files("cookbooks/upstream/*", "#{root}var/chef-solo/upstream-cookbooks") &&
|
23
23
|
upload_files("cookbooks/site/*", "#{root}var/chef-solo/site-cookbooks") &&
|
24
24
|
upload_files("envs/#{@env}/cookbooks/*", "#{root}var/chef-solo/site-cookbooks") &&
|
25
|
-
upload_files("#{solokit_path}/chef
|
25
|
+
upload_files("#{solokit_path}/chef/*", "#{root}etc/chef") &&
|
26
26
|
upload_files("chef/*", "#{root}etc/chef") &&
|
27
27
|
upload_files("envs/#{@env}/chef/*", "#{root}etc/chef")
|
28
28
|
end
|
data/lib/configuration.rb
CHANGED
@@ -3,7 +3,10 @@ require 'ostruct'
|
|
3
3
|
module Solokit
|
4
4
|
class Configuration < OpenStruct
|
5
5
|
def initialize(*envs)
|
6
|
-
shared_config =
|
6
|
+
shared_config = { "debug_ssh" => false, "debug_chef" => false }
|
7
|
+
if File.exists?("config.yml")
|
8
|
+
shared_config = YAML.load_file("config.yml").merge(shared_config)
|
9
|
+
end
|
7
10
|
|
8
11
|
config = shared_config
|
9
12
|
envs.each do |env|
|
data/lib/solokit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solokit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 0.0.4.1
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- "Joakim Kolsj\xC3\xB6"
|