kitchenplan 2.1.12 → 2.1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f29ee402f5e533b4efa2ca7c89fa08c636d74c4
4
- data.tar.gz: ec74ae077bb33d0f5c9f1c2cecdfd0c6a86eba31
3
+ metadata.gz: 4bb1eb5ec11dbe1b94ec47ef3bacb87b0ed8aa1b
4
+ data.tar.gz: b5cdffa26657ac57c55f580d040e32b8b4116cb9
5
5
  SHA512:
6
- metadata.gz: 54e04c2fb57b1c5f561e2b5b2006fd4ed749573a46b5b6ec901bc8e8f37bf969ffb01dace4fc6003ade318960e3e100d4c06003bb67f7e88a3f8ac9cd8d5598d
7
- data.tar.gz: d89d54865160e02efbf530df0ee30cbe36503aedcea0010493f40c98938427751d21e59deecd03793a18ab2111aca6680c049e819c57935ebcbc1e1edf751486
6
+ metadata.gz: b9a9301a9acd053ee4d8e190b0a461a1ed0f08d7e21ce3a2191326e5fd2c3f6b5433e0cf74ce458c5c057eeda3a39737f168b38e4645f1abe5705f0faf1c4ca3
7
+ data.tar.gz: 24542e71583d389a136e176b31b911471307da1f65652cd3e54191cdd45e6f9bd06ad6549d00ee7de2c453327d66f6ed687534dd3f172e257f8587f909295463
@@ -11,12 +11,14 @@ module Kitchenplan
11
11
  attr_reader :platform
12
12
  attr_reader :default_config
13
13
  attr_reader :people_config
14
+ attr_reader :system_config
14
15
  attr_reader :group_configs
15
16
 
16
17
  def initialize
17
18
  self.detect_platform
18
19
  self.parse_default_config
19
20
  self.parse_people_config
21
+ # self.parse_system_config
20
22
  self.parse_group_configs
21
23
  end
22
24
 
@@ -28,6 +30,10 @@ module Kitchenplan
28
30
  @platform = 'mac_os_x' # We only support osx at the moment, and it saves a large dependency
29
31
  end
30
32
 
33
+ # def hardware_model
34
+ # `system_profiler SPHardwareDataType | awk '/Identifier/ {print $3}' | tr -d '\n'`
35
+ # end
36
+
31
37
  def parse_default_config
32
38
  default_config_path = 'config/default.yml'
33
39
  @default_config = (YAML.load(ERB.new(File.read(default_config_path)).result) if File.exist?(default_config_path)) || {}
@@ -38,6 +44,11 @@ module Kitchenplan
38
44
  @people_config = (YAML.load(ERB.new(File.read(people_config_path)).result) if File.exist?(people_config_path)) || {}
39
45
  end
40
46
 
47
+ # def parse_system_config
48
+ # system_config_path = "config/system/#{hardware_model}.yml"
49
+ # @system_config = (YAML.load(ERB.new(File.read(system_config_path)).result) if File.exist?(system_config_path)) || {}
50
+ # end
51
+
41
52
  def parse_group_configs(group = (( @default_config['groups'] || [] ) | ( @people_config['groups'] || [] )))
42
53
  @group_configs = @group_configs || {}
43
54
  defined_groups = group || []
@@ -69,13 +80,32 @@ module Kitchenplan
69
80
  people_recipes = @people_config['recipes'] || {}
70
81
  config['recipes'] |= people_recipes['global'] || []
71
82
  config['recipes'] |= people_recipes[@platform] || []
83
+
84
+ # First take the attributes from default.yml
72
85
  config['attributes'] = {}
73
86
  config['attributes'].deep_merge!(@default_config['attributes'] || {}) { |key, old, new| Array.wrap(old) + Array.wrap(new) }
87
+
88
+ # then override and extend them with the group attributes
74
89
  @group_configs.each do |group_name, group_config|
75
90
  config['attributes'].deep_merge!(group_config['attributes']) { |key, old, new| Array.wrap(old) + Array.wrap(new) } unless group_config['attributes'].nil?
76
91
  end
92
+
93
+ # then override and extend them with the people attributes
77
94
  people_attributes = @people_config['attributes'] || {}
78
95
  config['attributes'].deep_merge!(people_attributes) { |key, old, new| Array.wrap(old) + Array.wrap(new) }
96
+
97
+ # lastly override from the system files
98
+ # system_recipes = @system_config['recipes'] || {}
99
+ # config['recipes'] |= system_recipes['global'] || []
100
+ # config['recipes'] |= system_recipes[@platform] || []
101
+ # config['attributes'] = {}
102
+ # config['attributes'].deep_merge!(@default_config['attributes'] || {}) { |key, old, new| Array.wrap(old) + Array.wrap(new) }
103
+ # @group_configs.each do |group_name, group_config|
104
+ # config['attributes'].deep_merge!(group_config['attributes']) { |key, old, new| Array.wrap(old) + Array.wrap(new) } unless group_config['attributes'].nil?
105
+ # end
106
+ # system_attributes = @system_config['attributes'] || {}
107
+ # config['attributes'].deep_merge!(system_attributes) { |key, old, new| Array.wrap(old) + Array.wrap(new) }
108
+
79
109
  config
80
110
  end
81
111
 
@@ -4,7 +4,7 @@ cookbook "homebrewalt", :github => "kitchenplan/chef-homebrewalt",
4
4
  cookbook "nodejs", :github => "kitchenplan/chef-nodejs", :ref => "v1.2"
5
5
  cookbook "applications", :github => "kitchenplan/chef-applications", :ref => "v2.0.5"
6
6
  cookbook "osxdefaults", :github => "kitchenplan/chef-osxdefaults", :ref => "v1.0.3"
7
- cookbook "dotfiles", :github => "kitchenplan/chef-dotfiles", :ref => "v1.3"
7
+ cookbook "dotfiles", :github => "kitchenplan/chef-dotfiles", :ref => "v1.3.1"
8
8
  cookbook "drivers", :github => "kitchenplan/chef-drivers", :ref => "v1.0"
9
9
  cookbook "sudoalt", :github => "kitchenplan/chef-sudoalt", :ref => "v2.4"
10
10
  cookbook "dmg", :github => "opscode-cookbooks/dmg", :ref => "v2.1.4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchenplan
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.12
4
+ version: 2.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roderik van der Veer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-29 00:00:00.000000000 Z
11
+ date: 2014-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor