cheftacular 2.2.0 → 2.2.1
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/lib/cheftacular/chef/data_bag.rb +2 -0
- data/lib/cheftacular/cheftacular.rb +1 -0
- data/lib/cheftacular/dns.rb +3 -1
- data/lib/cheftacular/helper.rb +9 -3
- data/lib/cheftacular/parser.rb +1 -1
- data/lib/cheftacular/stateless_actions/cloud_bootstrap.rb +0 -2
- data/lib/cheftacular/stateless_actions/upload_nodes.rb +10 -0
- data/lib/cheftacular/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c20403e9a06c24107c229161f34ed5ae10eb2360
|
4
|
+
data.tar.gz: e9edf5b27994a98c4dbbc5aa07eab3907d5303ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1a81ce225e84ab00701c15cee3d7cc5c519134795b4b382f55e4e9a4c8a59183d934cecc85e8afdedd2e49dafc80e1913da1e480cf4631f2e67836724001877
|
7
|
+
data.tar.gz: 294dda1dc967aca367b832dcee99e6a2b5dac916b4ae877af379727ad9f71c3f5f7ad649701c60a6a075eb7b5d62519895f7f3ac2de9c61f774660e9d54cdc2e
|
@@ -28,6 +28,8 @@ class Cheftacular
|
|
28
28
|
item = @config[env]['logs_bag'].reload
|
29
29
|
|
30
30
|
#TODO use zlib gem to store and display logs https://stackoverflow.com/questions/17882463/compressing-large-string-in-ruby
|
31
|
+
#Zlib::Deflate.deflate(data_to_compress)
|
32
|
+
#Zlib::Inflate.inflate(data_compressed)
|
31
33
|
item.attributes = item.attributes.deep_merge(@config[env]['logs_bag_hash'].dup)
|
32
34
|
|
33
35
|
begin
|
data/lib/cheftacular/dns.rb
CHANGED
@@ -142,7 +142,7 @@ class Cheftacular
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def compile_address_hash_for_server_from_options *args
|
145
|
-
target_serv_index = nil
|
145
|
+
target_serv_index = args.include?('set_hash_to_nil') ? nil : @config[@options['env']]['addresses_bag_hash']['addresses'].count
|
146
146
|
tld = @config[@options['env']]['config_bag_hash'][@options['sub_env']]['tld']
|
147
147
|
|
148
148
|
args.each do |arg|
|
@@ -155,6 +155,8 @@ class Cheftacular
|
|
155
155
|
|
156
156
|
full_domain ||= "#{ @options['node_name'] }.#{ tld }"
|
157
157
|
|
158
|
+
@config[@options['env']]['addresses_bag_hash'] = @config[@options['env']]['addresses_bag'].reload.to_hash
|
159
|
+
|
158
160
|
@config[@options['env']]['addresses_bag_hash']['addresses'].each do |serv_hash|
|
159
161
|
target_serv_index = @config[@options['env']]['addresses_bag_hash']['addresses'].index(serv_hash) if serv_hash['name'] == @options['node_name']
|
160
162
|
end
|
data/lib/cheftacular/helper.rb
CHANGED
@@ -10,15 +10,21 @@ class Cheftacular
|
|
10
10
|
Cheftacular.to_s.underscore.dasherize
|
11
11
|
end
|
12
12
|
|
13
|
-
def is_command? command
|
13
|
+
def is_command? command=''
|
14
|
+
command ||= ''
|
15
|
+
|
14
16
|
@config['action'].public_methods(false).include?(command.to_sym)
|
15
17
|
end
|
16
18
|
|
17
|
-
def is_stateless_command? command
|
19
|
+
def is_stateless_command? command=''
|
20
|
+
command ||= ''
|
21
|
+
|
18
22
|
@config['stateless_action'].public_methods(false).include?(command.to_sym)
|
19
23
|
end
|
20
24
|
|
21
|
-
def is_not_command_or_stateless_command? command
|
25
|
+
def is_not_command_or_stateless_command? command=''
|
26
|
+
command ||= ''
|
27
|
+
|
22
28
|
!@config['action'].public_methods(false).include?(command.to_sym) && !@config['stateless_action'].public_methods(false).include?(command.to_sym)
|
23
29
|
end
|
24
30
|
|
data/lib/cheftacular/parser.rb
CHANGED
@@ -42,7 +42,7 @@ class Cheftacular
|
|
42
42
|
|
43
43
|
parse_repository(@options['repository'])
|
44
44
|
|
45
|
-
@options['command']
|
45
|
+
@options['command'] = ARGV[0] unless @config['helper'].is_not_command_or_stateless_command?(ARGV[0])
|
46
46
|
end
|
47
47
|
|
48
48
|
return if !@options['codebase'].nil? && !@options['role'].nil? && !@options['command'].nil?
|
@@ -70,8 +70,6 @@ class Cheftacular
|
|
70
70
|
@config['DNS'].create_dns_record_for_domain_from_address_hash(@options['with_dn'], address_hash, "specific_domain_mode") if @options['with_dn']
|
71
71
|
|
72
72
|
@config['DNS'].create_dns_record_for_domain_from_address_hash(tld, address_hash)
|
73
|
-
|
74
|
-
@config[@options['env']]['addresses_bag_hash'] = @config[@options['env']]['addresses_bag'].reload.to_hash
|
75
73
|
|
76
74
|
@config['ChefDataBag'].save_addresses_bag
|
77
75
|
|
@@ -82,6 +82,16 @@ class Cheftacular
|
|
82
82
|
allowed_changes_hash = bag_hash
|
83
83
|
end
|
84
84
|
|
85
|
+
#force add any roles that are not in the bag in the event force yes is turned on
|
86
|
+
(node_roles_hash.keys - bag_hash.keys).each do |role_not_in_node_roles_bag|
|
87
|
+
|
88
|
+
new_role = node_roles_hash[role_not_in_node_roles_bag]
|
89
|
+
|
90
|
+
allowed_changes_hash[role_not_in_node_roles_bag] = bag_hash[role_not_in_node_roles_bag]
|
91
|
+
|
92
|
+
@config[new_role['chef_environment']]['node_roles_bag_hash']['node_roles'][new_role['name']] = new_role
|
93
|
+
end if @options['force_yes'] && @config['helper'].running_in_mode?('devops')
|
94
|
+
|
85
95
|
nodes.each do |node|
|
86
96
|
# if there is a node_roles file that completely matches the name of the file, use it
|
87
97
|
changes_for_current_node = false
|
data/lib/cheftacular/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheftacular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis Alridge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|