Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Replace deprecated node.set to node.default #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipes/mongos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
action :create
end
# Set `['runit']['prefer_local_yum'] = true` to avoid install yum repository through packagecloud cookbook
node.set['runit']['prefer_local_yum'] = true
node.default['runit']['prefer_local_yum'] = true
end

# Install runit service package through runit::default recipe
Expand Down
16 changes: 8 additions & 8 deletions recipes/package_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pkg_version = node['mongodb3']['version']
case node['platform_family']
when 'rhel', 'fedora'
pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
pkg_version = "#{node['mongodb3']['version']}-1.el#{node['platform_version'].to_i}" # ~FC019
if node['platform'] == 'amazon'
pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019
end
Expand Down Expand Up @@ -53,34 +53,34 @@

# MongoDB package version to install
if node['mongodb3']['package']['version'].nil?
node.set['mongodb3']['package']['version'] = pkg_version
node.default['mongodb3']['package']['version'] = pkg_version
end

# MongoDB package repo url
if node['mongodb3']['package']['repo']['url'].nil?
node.set['mongodb3']['package']['repo']['url'] = pkg_repo
node.default['mongodb3']['package']['repo']['url'] = pkg_repo
end

# MongoDB repository name
if node['mongodb3']['package']['repo']['apt']['name'].nil?
node.set['mongodb3']['package']['repo']['apt']['name'] = pkg_major_version.to_s
node.default['mongodb3']['package']['repo']['apt']['name'] = pkg_major_version.to_s
end

# MongoDB apt keyserver and key
if node['mongodb3']['package']['repo']['apt']['keyserver'].nil?
node.set['mongodb3']['package']['repo']['apt']['keyserver'] = apt_repo_keyserver
node.default['mongodb3']['package']['repo']['apt']['keyserver'] = apt_repo_keyserver
end

if node['mongodb3']['package']['repo']['apt']['key'].nil?
if pkg_major_version >= 3.2
node.set['mongodb3']['package']['repo']['apt']['key'] = 'EA312927'
node.default['mongodb3']['package']['repo']['apt']['key'] = 'EA312927'
else
node.set['mongodb3']['package']['repo']['apt']['key'] = '7F0CEB10'
node.default['mongodb3']['package']['repo']['apt']['key'] = '7F0CEB10'
end
end

if node['mongodb3']['package']['repo']['apt']['components'].nil?
node.set['mongodb3']['package']['repo']['apt']['components'] = apt_repo_component
node.default['mongodb3']['package']['repo']['apt']['components'] = apt_repo_component
end

# Add the MongoDB Package repository
Expand Down
4 changes: 2 additions & 2 deletions test/cookbooks/mongodb3-test/recipes/custom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.
#

node.set['mongodb3']['config']['mongod']['storage']['dbPath'] = '/var/lib/mongodb/custom'
node.set['mongodb3']['config']['mongod']['systemLog']['path'] = '/var/log/mongodb/custom/mongod.log'
node.default['mongodb3']['config']['mongod']['storage']['dbPath'] = '/var/lib/mongodb/custom'
node.default['mongodb3']['config']['mongod']['systemLog']['path'] = '/var/log/mongodb/custom/mongod.log'

include_recipe 'mongodb3::default'
2 changes: 1 addition & 1 deletion test/cookbooks/mongodb3-test/recipes/default-30x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.
#

node.set['mongodb3']['version'] = '3.0.11'
node.default['mongodb3']['version'] = '3.0.11'

# For package upgrade testing : executing converge twice with different version
# node.set['mongodb3']['version'] = '3.2.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
mms_data_bag_item = Chef::EncryptedDataBagItem.load('mongodb', 'mms-agent')
mms_data_bag = mms_data_bag_item['environments'][node.chef_environment]

node.set['mongodb3']['config']['mms']['mmsGroupId'] = mms_data_bag['mms_group_id']
node.set['mongodb3']['config']['mms']['mmsApiKey'] = mms_data_bag['mms_api_key']
node.default['mongodb3']['config']['mms']['mmsGroupId'] = mms_data_bag['mms_group_id']
node.default['mongodb3']['config']['mms']['mmsApiKey'] = mms_data_bag['mms_api_key']

include_recipe 'mongodb3::mms_automation_agent'