chef-sugar 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +12 -0
- data/chef-sugar.gemspec +1 -0
- data/lib/chef/sugar/architecture.rb +29 -1
- data/lib/chef/sugar/platform.rb +4 -0
- data/lib/chef/sugar/version.rb +1 -1
- data/lib/chef/sugar/virtualization.rb +14 -0
- data/spec/unit/chef/sugar/architecture_spec.rb +15 -0
- data/spec/unit/chef/sugar/virtualization_spec.rb +28 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e302495d54fd2ab9c684d7f14aa9cbd1a4fec669
|
4
|
+
data.tar.gz: 74531fd32eb4b31afb0dd12f7490c7d2a25526ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a68af78673536af03376c879442090b269319b16dc79a0bdd12fa768db20d83fcd14bc151ef794bb44b1b28e1654582c3c484944fac48fb22d615731455b1de
|
7
|
+
data.tar.gz: dec8f58a0fac8e97867673f9122fae92e0cd7ddd9b1386fc099446476c56e597618789f79c2f361521fb2df45f040742c06b16e5d378df671df439e771f2fad8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@ Chef Sugar Changelog
|
|
2
2
|
=========================
|
3
3
|
This file is used to list changes made in each version of the chef-sugar cookbook and gem.
|
4
4
|
|
5
|
+
v3.4.0 (2016-07-18)
|
6
|
+
-------------------
|
7
|
+
### Improvements
|
8
|
+
- Add `virtual?` and `physical?` methods
|
9
|
+
- Add Scaleway C1 server (arm arch) support
|
10
|
+
- Add IMB s390x support
|
11
|
+
- Add missing Ubuntu release names
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
- Drop Ruby 2.0.0 support from Travis test matrix
|
15
|
+
- Pin to Rack 1.6 (dev dep)
|
16
|
+
|
5
17
|
v3.3.0 (2016-01-11)
|
6
18
|
-------------------
|
7
19
|
### Improvements
|
data/chef-sugar.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
27
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
28
|
+
spec.add_development_dependency 'rack', '~> 1.6'
|
28
29
|
spec.add_development_dependency 'rake'
|
29
30
|
|
30
31
|
spec.add_development_dependency 'chefspec', '~> 4.2'
|
@@ -25,7 +25,7 @@ class Chef
|
|
25
25
|
# @return [Boolean]
|
26
26
|
#
|
27
27
|
def _64_bit?(node)
|
28
|
-
%w(amd64 x86_64 ppc64 ppc64le s390x ia64 sparc64 aarch64 arch64 arm64 sun4v sun4u)
|
28
|
+
%w(amd64 x86_64 ppc64 ppc64le s390x ia64 sparc64 aarch64 arch64 arm64 sun4v sun4u s390x)
|
29
29
|
.include?(node['kernel']['machine']) || ( node['kernel']['bits'] == '64' )
|
30
30
|
end
|
31
31
|
|
@@ -98,6 +98,27 @@ class Chef
|
|
98
98
|
%w(powerpc)
|
99
99
|
.include?(node['kernel']['machine'])
|
100
100
|
end
|
101
|
+
|
102
|
+
#
|
103
|
+
# Determine if the current architecture is ARM with Hard Float
|
104
|
+
#
|
105
|
+
# @return [Boolean]
|
106
|
+
#
|
107
|
+
def armhf?(node)
|
108
|
+
# Add more arm variants as needed here
|
109
|
+
%w(armv7l)
|
110
|
+
.include?(node['kernel']['machine'])
|
111
|
+
end
|
112
|
+
|
113
|
+
#
|
114
|
+
# Determine if the current architecture is s390x
|
115
|
+
#
|
116
|
+
# @return [Boolean]
|
117
|
+
#
|
118
|
+
def s390x?(node)
|
119
|
+
%w(s390x)
|
120
|
+
.include?(node['kernel']['machine'])
|
121
|
+
end
|
101
122
|
end
|
102
123
|
|
103
124
|
module DSL
|
@@ -124,6 +145,13 @@ class Chef
|
|
124
145
|
|
125
146
|
# @see Chef::Sugar::Architecture#powerpc?
|
126
147
|
def powerpc?; Chef::Sugar::Architecture.powerpc?(node); end
|
148
|
+
|
149
|
+
# @see Chef::Sugar::Architecture#arm?
|
150
|
+
def armhf?; Chef::Sugar::Architecture.armhf?(node); end
|
151
|
+
|
152
|
+
# @see Chef::Sugar::Architecture#s390x?
|
153
|
+
def s390x?; Chef::Sugar::Architecture.s390x?(node); end
|
154
|
+
|
127
155
|
end
|
128
156
|
end
|
129
157
|
end
|
data/lib/chef/sugar/platform.rb
CHANGED
data/lib/chef/sugar/version.rb
CHANGED
@@ -83,6 +83,14 @@ class Chef
|
|
83
83
|
def openvz?(node)
|
84
84
|
node.key?('virtualization') && node['virtualization']['system'] == 'openvz'
|
85
85
|
end
|
86
|
+
|
87
|
+
def virtual?(node)
|
88
|
+
openvz?(node) || vmware?(node) || virtualbox?(node) || lxc?(node) || kvm?(node)
|
89
|
+
end
|
90
|
+
|
91
|
+
def physical?(node)
|
92
|
+
!virtual?(node)
|
93
|
+
end
|
86
94
|
end
|
87
95
|
|
88
96
|
module DSL
|
@@ -100,6 +108,12 @@ class Chef
|
|
100
108
|
|
101
109
|
# @see Chef::Sugar::Virtualization#openvz?
|
102
110
|
def openvz?; Chef::Sugar::Virtualization.openvz?(node); end
|
111
|
+
|
112
|
+
# @see Chef::Sugar::Virtualization#virtual?
|
113
|
+
def virtual?; Chef::Sugar::Virtualization.virtual?(node); end
|
114
|
+
|
115
|
+
# @see Chef::Sugar::Virtualization#physical?
|
116
|
+
def physical?; Chef::Sugar::Virtualization.physical?(node); end
|
103
117
|
end
|
104
118
|
end
|
105
119
|
end
|
@@ -78,6 +78,14 @@ describe Chef::Sugar::Architecture do
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
describe '#armhf?' do
|
82
|
+
it 'returns true when the system is ARM' do
|
83
|
+
node = { 'kernel' => { 'machine' => 'armv7l' } }
|
84
|
+
expect(described_class.intel?(node)).to be false
|
85
|
+
expect(described_class.armhf?(node)).to be true
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
81
89
|
describe '#sparc?' do
|
82
90
|
it 'returns true when the system is SPARC sun4u' do
|
83
91
|
node = { 'kernel' => { 'machine' => 'sun4u' } }
|
@@ -103,4 +111,11 @@ describe Chef::Sugar::Architecture do
|
|
103
111
|
expect(described_class.ppc64le?(node)).to be true
|
104
112
|
end
|
105
113
|
end
|
114
|
+
|
115
|
+
describe '#s390x?' do
|
116
|
+
it 'returns true when the system is s390x' do
|
117
|
+
node = { 'kernel' => { 'machine' => 's390x' } }
|
118
|
+
expect(described_class.s390x?(node)).to be true
|
119
|
+
end
|
120
|
+
end
|
106
121
|
end
|
@@ -87,4 +87,32 @@ describe Chef::Sugar::Virtualization do
|
|
87
87
|
expect(described_class.openvz?(node)).to be false
|
88
88
|
end
|
89
89
|
end
|
90
|
+
|
91
|
+
describe '#virtual?' do
|
92
|
+
it 'returns true when the machine is under a supported virtualization provider' do
|
93
|
+
%w(openvz vmware vbox lxc kvm).each do |host|
|
94
|
+
node = { 'virtualization' => { 'system' => host } }
|
95
|
+
expect(described_class.virtual?(node)).to be true
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'returns false when the machine is not virtual' do
|
100
|
+
node = {}
|
101
|
+
expect(described_class.virtual?(node)).to be false
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
describe '#physical?' do
|
106
|
+
it 'returns false when the machine is under a supported virtualization provider' do
|
107
|
+
%w(openvz vmware vbox lxc kvm).each do |host|
|
108
|
+
node = { 'virtualization' => { 'system' => host } }
|
109
|
+
expect(described_class.physical?(node)).to be false
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'returns true when the machine is not virtual' do
|
114
|
+
node = {}
|
115
|
+
expect(described_class.physical?(node)).to be true
|
116
|
+
end
|
117
|
+
end
|
90
118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-sugar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Vargo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.6'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
181
|
version: '0'
|
168
182
|
requirements: []
|
169
183
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.
|
184
|
+
rubygems_version: 2.4.5.1
|
171
185
|
signing_key:
|
172
186
|
specification_version: 4
|
173
187
|
summary: A collection of helper methods and modules that make working with Chef recipes
|