summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-10 18:18:50 -0800
committerGitHub <noreply@github.com>2021-02-10 18:18:50 -0800
commitcb600f97ec7aed6e5edf02c75f76b9eae3635142 (patch)
tree5d8fb4e9fc6b786e982bda8e516d16c3dd3b1df4
parentb368dcb9e03d1bac6cb38b4ce7bed5bc840f5357 (diff)
parentb2d4c9163985f0481f6c95831a68bc620c3e0255 (diff)
downloadchef-cb600f97ec7aed6e5edf02c75f76b9eae3635142.tar.gz
Merge pull request #11004 from chef/alibaba
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--Gemfile.lock4
-rw-r--r--RELEASE_NOTES.md1
-rw-r--r--chef-utils/README.md1
-rw-r--r--chef-utils/lib/chef-utils/dsl/cloud.rb11
-rw-r--r--chef-utils/spec/unit/dsl/cloud_spec.rb4
-rw-r--r--omnibus/Gemfile.lock10
6 files changed, 24 insertions, 7 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 1866459a4f..f9cf926aef 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -8,10 +8,10 @@ GIT
GIT
remote: https://github.com/chef/ohai.git
- revision: ba09f9b476b37c9c07e8d572c8fdba73450fbd06
+ revision: f26c3ce26c63eb06d714073f920b1f75c4feef25
branch: master
specs:
- ohai (17.0.18)
+ ohai (17.0.19)
chef-config (>= 12.8, < 18)
chef-utils (>= 16.0, < 18)
ffi (~> 1.9)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 3f2bcd0c2f..c4c5b30331 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -15,6 +15,7 @@ This section serves to track things we should later document here for 17.0
- Remove ability to run client as a service on Windows - https://github.com/chef/chef/pull/10928
- apt_package allow_downgrades now functions as expected, but also raises on invalid versions - https://github.com/chef/chef/pull/10993
- reboot_pending? now works on all debian platform_family distros not just Ubuntu specifically - https://github.com/chef/chef/pull/10989
+- Alibaba Cloud support with node['alibaba'] showing metadata, `alibaba?` helper and node['cloud'] returning data now - https://github.com/chef/chef/pull/11004
## What's New in 16.10
diff --git a/chef-utils/README.md b/chef-utils/README.md
index d3088a7bc2..6b0052e073 100644
--- a/chef-utils/README.md
+++ b/chef-utils/README.md
@@ -120,6 +120,7 @@ Architecture Helpers allow you to determine the processor architecture of your n
### Cloud Helpers
* `cloud?` - if the node is running in any cloud, including internal ones
+* `alibaba?` - if the node is running in alibaba cloud
* `ec2?` - if the node is running in ec2
* `gce?` - if the node is running in gce
* `rackspace?` - if the node is running in rackspace
diff --git a/chef-utils/lib/chef-utils/dsl/cloud.rb b/chef-utils/lib/chef-utils/dsl/cloud.rb
index a232563709..6e8fc520a5 100644
--- a/chef-utils/lib/chef-utils/dsl/cloud.rb
+++ b/chef-utils/lib/chef-utils/dsl/cloud.rb
@@ -35,6 +35,17 @@ module ChefUtils
!node["cloud"].nil?
end
+ # Determine if the current node is running in Alibaba Cloud
+ #
+ # @param [Chef::Node] node the node to check
+ # @since 17.0
+ #
+ # @return [Boolean]
+ #
+ def alibaba?(node = __getnode)
+ node.key?("alibaba")
+ end
+
# Determine if the current node is running in AWS EC2.
#
# @param [Chef::Node] node the node to check
diff --git a/chef-utils/spec/unit/dsl/cloud_spec.rb b/chef-utils/spec/unit/dsl/cloud_spec.rb
index 8a718dc37d..9a88ce3825 100644
--- a/chef-utils/spec/unit/dsl/cloud_spec.rb
+++ b/chef-utils/spec/unit/dsl/cloud_spec.rb
@@ -45,6 +45,10 @@ RSpec.describe ChefUtils::DSL::Cloud do
end
end
+ context "on alibaba" do
+ cloud_reports_true_for(:cloud?, :alibaba?, node: { "alibaba" => {}, "cloud" => {} })
+ end
+
context "on ec2" do
cloud_reports_true_for(:cloud?, :ec2?, node: { "ec2" => {}, "cloud" => {} })
end
diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock
index 500f220826..bfbce0b3a7 100644
--- a/omnibus/Gemfile.lock
+++ b/omnibus/Gemfile.lock
@@ -32,7 +32,7 @@ GEM
artifactory (3.0.15)
awesome_print (1.8.0)
aws-eventstream (1.1.0)
- aws-partitions (1.424.0)
+ aws-partitions (1.426.0)
aws-sdk-core (3.112.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
@@ -188,7 +188,7 @@ GEM
ffi (1.14.2)
ffi (1.14.2-x64-mingw32)
ffi (1.14.2-x86-mingw32)
- ffi-libarchive (1.0.4)
+ ffi-libarchive (1.0.17)
ffi (~> 1.0)
ffi-win32-extensions (1.0.4)
ffi
@@ -249,9 +249,9 @@ GEM
multi_json (~> 1.14)
method_source (1.0.0)
minitar (0.9)
- mixlib-archive (1.0.7)
+ mixlib-archive (1.1.4)
mixlib-log
- mixlib-archive (1.0.7-universal-mingw32)
+ mixlib-archive (1.1.4-universal-mingw32)
mixlib-log
mixlib-authentication (3.0.7)
mixlib-cli (2.1.8)
@@ -312,7 +312,7 @@ GEM
zhexdump (>= 0.0.2)
plist (3.6.0)
proxifier (1.0.3)
- pry (0.13.1)
+ pry (0.14.0)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)