chef-sugar 3.5.0 → 3.6.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -2
- data/lib/chef/sugar/architecture.rb +14 -0
- data/lib/chef/sugar/cloud.rb +15 -0
- data/lib/chef/sugar/platform.rb +2 -0
- data/lib/chef/sugar/version.rb +1 -1
- data/libraries/chef-sugar.rb +1 -0
- data/metadata.rb +2 -0
- data/spec/unit/chef/sugar/architecture_spec.rb +8 -0
- data/spec/unit/chef/sugar/cloud_spec.rb +12 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09a4806c8e6896ab3ab09faf047ce442aa01dc56'
|
4
|
+
data.tar.gz: 149b614267fa4f7ce0872c8aa229cfd57996872a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1598f00e0c1153e2aac52cc7ff3c6f0e1bb966f4fc8a801292ac7f65049563cf935d18fb95aa57d1775096be02cd92c470e65c6fc04655b4614bd97eced6312
|
7
|
+
data.tar.gz: 8f2a0b21bfced7369184e87fd90ff059f5061eb45bcade2d97b6ba9c86c8b8526e9e728cfecbc9a3618bb457703ea1f40c35e6f1270bb980120ac6d1917545b9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
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.6.0 (2017-10-26)
|
6
|
+
|
7
|
+
- Add Ubuntu zesty and debian stretch detection
|
8
|
+
- Add softlayer? helper
|
9
|
+
- Add aarch64? helper
|
10
|
+
|
5
11
|
## v3.5.0 (2016-07-12)
|
6
12
|
|
7
13
|
- Improve the systemd check to not fail on older kernels or Windows hosts
|
data/README.md
CHANGED
@@ -6,8 +6,7 @@ Chef Sugar
|
|
6
6
|
[gem]: https://rubygems.org/gems/chef-sugar
|
7
7
|
[travis]: http://travis-ci.org/sethvargo/chef-sugar
|
8
8
|
|
9
|
-
Chef Sugar is a Gem & Chef Recipe that includes series of helpful
|
10
|
-
|
9
|
+
Chef Sugar is a Gem & Chef Recipe that includes series of helpful syntactic sugars on top of the Chef core and other resources to make a cleaner, more lean recipe DSL, enforce DRY principles, and make writing Chef recipes an awesome and fun experience!
|
11
10
|
|
12
11
|
Installation
|
13
12
|
------------
|
@@ -103,6 +102,7 @@ end
|
|
103
102
|
- `openstack?`
|
104
103
|
- `cloudstack?`
|
105
104
|
- `rackspace?`
|
105
|
+
- `softlayer?`
|
106
106
|
|
107
107
|
#### Examples
|
108
108
|
```ruby
|
@@ -110,6 +110,17 @@ class Chef
|
|
110
110
|
.include?(node['kernel']['machine'])
|
111
111
|
end
|
112
112
|
|
113
|
+
#
|
114
|
+
# Determine if the current architecture is AArch64
|
115
|
+
#
|
116
|
+
# @return [Boolean]
|
117
|
+
#
|
118
|
+
def aarch64?(node)
|
119
|
+
# Add more arm variants as needed here
|
120
|
+
%w(aarch64)
|
121
|
+
.include?(node['kernel']['machine'])
|
122
|
+
end
|
123
|
+
|
113
124
|
#
|
114
125
|
# Determine if the current architecture is s390x
|
115
126
|
#
|
@@ -149,6 +160,9 @@ class Chef
|
|
149
160
|
# @see Chef::Sugar::Architecture#arm?
|
150
161
|
def armhf?; Chef::Sugar::Architecture.armhf?(node); end
|
151
162
|
|
163
|
+
# @see Chef::Sugar::Architecture#aarch64?
|
164
|
+
def aarch64?; Chef::Sugar::Architecture.aarch64?(node); end
|
165
|
+
|
152
166
|
# @see Chef::Sugar::Architecture#s390x?
|
153
167
|
def s390x?; Chef::Sugar::Architecture.s390x?(node); end
|
154
168
|
|
data/lib/chef/sugar/cloud.rb
CHANGED
@@ -139,6 +139,18 @@ class Chef
|
|
139
139
|
def digitalocean?(node)
|
140
140
|
node.key?('digital_ocean')
|
141
141
|
end
|
142
|
+
|
143
|
+
#
|
144
|
+
# Return true if the current current node is in SoftLayer
|
145
|
+
#
|
146
|
+
# @param [Chef::Node] node
|
147
|
+
# the node to check
|
148
|
+
#
|
149
|
+
# @return [Boolean]
|
150
|
+
#
|
151
|
+
def softlayer?(node)
|
152
|
+
node.key?('softlayer')
|
153
|
+
end
|
142
154
|
end
|
143
155
|
|
144
156
|
module DSL
|
@@ -172,6 +184,9 @@ class Chef
|
|
172
184
|
|
173
185
|
# @see Chef::Sugar::Cloud#digitalocean?
|
174
186
|
def digitalocean?; Chef::Sugar::Cloud.digitalocean?(node); end
|
187
|
+
|
188
|
+
# @see Chef::Sugar::Cloud#softlayer?
|
189
|
+
def softlayer?; Chef::Sugar::Cloud.softlayer?(node); end
|
175
190
|
end
|
176
191
|
end
|
177
192
|
end
|
data/lib/chef/sugar/platform.rb
CHANGED
@@ -26,6 +26,7 @@ class Chef
|
|
26
26
|
'squeeze' => '6',
|
27
27
|
'wheezy' => '7',
|
28
28
|
'jessie' => '8',
|
29
|
+
'stretch' => '9',
|
29
30
|
},
|
30
31
|
'linuxmint' => {
|
31
32
|
'qiana' => '17',
|
@@ -64,6 +65,7 @@ class Chef
|
|
64
65
|
'vivid' => '15.04',
|
65
66
|
'wily' => '15.10',
|
66
67
|
'xenial' => '16.04',
|
68
|
+
'zesty' => '17.04',
|
67
69
|
},
|
68
70
|
}
|
69
71
|
|
data/lib/chef/sugar/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
require "chef-sugar" if Gem::Requirement.new(">= 12.10.48").satisfied_by?(Gem::Version.new(Chef::VERSION))
|
data/metadata.rb
CHANGED
@@ -86,6 +86,14 @@ describe Chef::Sugar::Architecture do
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
describe '#aarch64?' do
|
90
|
+
it 'returns true when the system is AArch64' do
|
91
|
+
node = { 'kernel' => { 'machine' => 'aarch64' } }
|
92
|
+
expect(described_class.intel?(node)).to be false
|
93
|
+
expect(described_class.aarch64?(node)).to be true
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
89
97
|
describe '#sparc?' do
|
90
98
|
it 'returns true when the system is SPARC sun4u' do
|
91
99
|
node = { 'kernel' => { 'machine' => 'sun4u' } }
|
@@ -134,4 +134,16 @@ describe Chef::Sugar::Cloud do
|
|
134
134
|
expect(described_class.digitalocean?(node)).to be false
|
135
135
|
end
|
136
136
|
end
|
137
|
+
|
138
|
+
describe '#softlayer?' do
|
139
|
+
it 'is true when the node is on softlayer' do
|
140
|
+
node = { 'softlayer' => nil }
|
141
|
+
expect(described_class.softlayer?(node)).to be true
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'is false when the node is not on softlayer' do
|
145
|
+
node = {}
|
146
|
+
expect(described_class.softlayer?(node)).to be false
|
147
|
+
end
|
148
|
+
end
|
137
149
|
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.6.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: 2017-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- lib/chef/sugar/vagrant.rb
|
139
139
|
- lib/chef/sugar/version.rb
|
140
140
|
- lib/chef/sugar/virtualization.rb
|
141
|
+
- libraries/chef-sugar.rb
|
141
142
|
- metadata.rb
|
142
143
|
- recipes/default.rb
|
143
144
|
- spec/spec_helper.rb
|
@@ -183,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
184
|
version: '0'
|
184
185
|
requirements: []
|
185
186
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.6.
|
187
|
+
rubygems_version: 2.6.13
|
187
188
|
signing_key:
|
188
189
|
specification_version: 4
|
189
190
|
summary: A collection of helper methods and modules that make working with Chef recipes
|