lambom 0.1.2 → 0.2.0
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 +7 -0
- data/lambom.gemspec +2 -2
- data/lib/lambom/converger.rb +22 -8
- metadata +7 -15
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c375eb59a2e1b3e2aa66691462d50f1bb86f211a
|
4
|
+
data.tar.gz: dd8e2a46cbf1af121d43ea8e0eaf7b302c250aaa
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4fc4d9e1dc9b82f1889fef4720cdb12022c13ce186da39a3cb98e3ae86c9dd5b5031b91146da33df969fd960eab430127e210c2f3a7bf4e872b0b254005a70a2
|
7
|
+
data.tar.gz: 73d8d2f347336b24d39f8594c05894b2990f51ca7150817ca1449b80079b6311812400a6ceb4783cfc4abd3ab4997df68531b462daf426c033cf13d2299f85d6
|
data/lambom.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'lambom'
|
3
|
-
s.version = '0.
|
4
|
-
s.date = '2013-12-
|
3
|
+
s.version = '0.2.0'
|
4
|
+
s.date = '2013-12-17'
|
5
5
|
s.summary = "Tool to apply riyic configurations"
|
6
6
|
s.description = "Riyic is a server configuration service based on chef (http://riyic.com). The lambom gem is a tool to apply, through chef-solo, your riyic configurations in your server"
|
7
7
|
s.authors = ["J. Gomez"]
|
data/lib/lambom/converger.rb
CHANGED
@@ -6,7 +6,7 @@ module Lambom
|
|
6
6
|
|
7
7
|
DEFAULT_CHEF_PATH = '/var/chef'
|
8
8
|
|
9
|
-
|
9
|
+
CACHE_PATH = "#{DEFAULT_CHEF_PATH}/cache"
|
10
10
|
|
11
11
|
ENV_VARS_DELETE = %w{
|
12
12
|
GEM_PATH
|
@@ -21,11 +21,19 @@ module Lambom
|
|
21
21
|
}
|
22
22
|
|
23
23
|
CHEF_CONF_FILE = "#{Lambom::Config::CONFIG_DIR}/solo.rb"
|
24
|
-
|
25
|
-
|
26
|
-
:development => '
|
24
|
+
|
25
|
+
CHEF_CONF_DEV = <<EOF
|
27
26
|
cookbook_path ["/mnt/opscode/cookbooks", "/mnt/others/cookbooks", "/mnt/riyic/cookbooks"]
|
28
|
-
|
27
|
+
file_cache_path "#{CACHE_PATH}"
|
28
|
+
EOF
|
29
|
+
|
30
|
+
CHEF_CONF_OTHER = <<EOF
|
31
|
+
cookbook_path ["#{DEFAULT_CHEF_PATH}/cookbooks", "#{DEFAULT_CHEF_PATH}/site-cookbooks"]
|
32
|
+
file_cache_path "#{CACHE_PATH}"
|
33
|
+
EOF
|
34
|
+
CHEF_CONF = {
|
35
|
+
:development => CHEF_CONF_DEV,
|
36
|
+
:other => CHEF_CONF_OTHER,
|
29
37
|
}
|
30
38
|
|
31
39
|
def initialize(conf, json)
|
@@ -49,7 +57,7 @@ cookbook_path ["/mnt/opscode/cookbooks", "/mnt/others/cookbooks", "/mnt/riyic/co
|
|
49
57
|
|
50
58
|
def ejecutar_converger
|
51
59
|
|
52
|
-
filename = "#{
|
60
|
+
filename = "#{CACHE_PATH}/#{conf.server}.json"
|
53
61
|
file = File.new(filename,"w")
|
54
62
|
file.write(attributes_json)
|
55
63
|
file.close
|
@@ -71,8 +79,8 @@ cookbook_path ["/mnt/opscode/cookbooks", "/mnt/others/cookbooks", "/mnt/riyic/co
|
|
71
79
|
File.chmod(0750, conf.logdir)
|
72
80
|
|
73
81
|
#creamos o directorio cache de chef
|
74
|
-
FileUtils.mkdir_p(
|
75
|
-
File.chmod(0750,
|
82
|
+
FileUtils.mkdir_p(CACHE_PATH) unless File.directory?(CACHE_PATH)
|
83
|
+
File.chmod(0750,CACHE_PATH)
|
76
84
|
|
77
85
|
# establecemos o archivo de configuracion de chef segun o entorno
|
78
86
|
switch_chef_conf(conf.environment.to_sym)
|
@@ -88,12 +96,18 @@ cookbook_path ["/mnt/opscode/cookbooks", "/mnt/others/cookbooks", "/mnt/riyic/co
|
|
88
96
|
end
|
89
97
|
|
90
98
|
def switch_chef_conf(env)
|
99
|
+
FileUtils.mkdir_p(Lambom::Config::CONFIG_DIR) unless File.directory?(Lambom::Config::CONFIG_DIR)
|
100
|
+
File.chmod(0750,Lambom::Config::CONFIG_DIR)
|
101
|
+
|
91
102
|
file = File.new(CHEF_CONF_FILE,"w")
|
92
103
|
|
93
104
|
if CHEF_CONF.has_key?(env)
|
94
105
|
file.write(CHEF_CONF[env])
|
106
|
+
else
|
107
|
+
file.write(CHEF_CONF[:other])
|
95
108
|
end
|
96
109
|
|
110
|
+
|
97
111
|
file.close
|
98
112
|
end
|
99
113
|
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lambom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- J. Gomez
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: oj
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: mixlib-authentication
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: mixlib-shellout
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -90,26 +83,25 @@ files:
|
|
90
83
|
homepage: https://github.com/RIYIC/lambom
|
91
84
|
licenses:
|
92
85
|
- Apache-2.0
|
86
|
+
metadata: {}
|
93
87
|
post_install_message:
|
94
88
|
rdoc_options: []
|
95
89
|
require_paths:
|
96
90
|
- lib
|
97
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
92
|
requirements:
|
100
|
-
- -
|
93
|
+
- - '>='
|
101
94
|
- !ruby/object:Gem::Version
|
102
95
|
version: '0'
|
103
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
-
none: false
|
105
97
|
requirements:
|
106
|
-
- -
|
98
|
+
- - '>='
|
107
99
|
- !ruby/object:Gem::Version
|
108
100
|
version: '0'
|
109
101
|
requirements: []
|
110
102
|
rubyforge_project:
|
111
|
-
rubygems_version: 1.
|
103
|
+
rubygems_version: 2.1.11
|
112
104
|
signing_key:
|
113
|
-
specification_version:
|
105
|
+
specification_version: 4
|
114
106
|
summary: Tool to apply riyic configurations
|
115
107
|
test_files: []
|