Skip to content

Commit

Permalink
closes sous-chefs#751 Provide additional package_name parameter for i…
Browse files Browse the repository at this point in the history
…nstall
  • Loading branch information
Ayowel committed Dec 20, 2020
1 parent 5f1f3a3 commit 04fbd3b
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .foodcritic
Original file line number Diff line number Diff line change
@@ -1 +1 @@
~FC057
~FC057
96 changes: 48 additions & 48 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
*.rbc
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
_Store
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
*.tmp
*.bk
*.bkup

# ruby/bundler files
.ruby-version
.ruby-gemset
.rvmrc
Gemfile.lock
.bundle
*.gem

# YARD artifacts
.yardoc
_yardoc
doc/
.idea

#chef stuff
Berksfile.lock
.kitchen
.kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb

#vagrant stuff
.vagrant/
.vagrant.d/
.kitchen/
*.rbc
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
_Store
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
*.tmp
*.bk
*.bkup

# ruby/bundler files
.ruby-version
.ruby-gemset
.rvmrc
Gemfile.lock
.bundle
*.gem

# YARD artifacts
.yardoc
_yardoc
doc/
.idea

#chef stuff
Berksfile.lock
.kitchen
.kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb

#vagrant stuff
.vagrant/
.vagrant.d/
.kitchen/
148 changes: 74 additions & 74 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
Lint/RescueException:
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Naming/AccessorMethodName:
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Style/RescueModifier:
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Style/GuardClause:
Enabled: false
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Style/IfUnlessModifier:
Enabled: false

Style/PercentLiteralDelimiters:
Enabled: false

# Longer classes are okay.
Metrics/ClassLength:
Max: 200
Metrics/MethodLength:
Max: 30
Metrics/ModuleLength:
Max: 150
Metrics/BlockLength:
Max: 150

# Not on VT100s anymore.
Metrics/LineLength:
Max: 180

# We're not against complexity.
Metrics/AbcSize:
Max: 55
Metrics/CyclomaticComplexity:
Max: 20
Metrics/PerceivedComplexity:
Max: 20

# Mixlib::ShellOut is nice to have as an older hash syntax
Style/HashSyntax:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/WordArray:
Enabled: False

# Cookstyle specific things
ChefStyle/CommentFormat:
Enabled: False # we are not Chef

ChefModernize/WhyRunSupportedTrue:
Enabled: False # we are still supporting v12

ChefModernize/RespondToInMetadata:
Enabled: False # we're supporting 12.5 still

ChefModernize/DefinesChefSpecMatchers:
Enabled: False # we haven't moved to newer ChefSpec yet
Lint/RescueException:
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Naming/AccessorMethodName:
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Style/RescueModifier:
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Style/GuardClause:
Enabled: false
Exclude:
- 'Rakefile'
- 'libraries/helpers.rb'

Style/IfUnlessModifier:
Enabled: false

Style/PercentLiteralDelimiters:
Enabled: false

# Longer classes are okay.
Metrics/ClassLength:
Max: 200
Metrics/MethodLength:
Max: 30
Metrics/ModuleLength:
Max: 150
Metrics/BlockLength:
Max: 150

# Not on VT100s anymore.
Metrics/LineLength:
Max: 180

# We're not against complexity.
Metrics/AbcSize:
Max: 55
Metrics/CyclomaticComplexity:
Max: 20
Metrics/PerceivedComplexity:
Max: 20

# Mixlib::ShellOut is nice to have as an older hash syntax
Style/HashSyntax:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/WordArray:
Enabled: False

# Cookstyle specific things
ChefStyle/CommentFormat:
Enabled: False # we are not Chef

ChefModernize/WhyRunSupportedTrue:
Enabled: False # we are still supporting v12

ChefModernize/RespondToInMetadata:
Enabled: False # we're supporting 12.5 still

ChefModernize/DefinesChefSpecMatchers:
Enabled: False # we haven't moved to newer ChefSpec yet
44 changes: 22 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
language: ruby

branches:
only:
- master

sudo: false

rvm:
- 2.5.7

install: bundle install --jobs=3 --retry=3 --without kitchen_vagrant kitchen_rackspace kitchen_ec2 development
cache:
directories:
- vendor/bundle

script:
- bundle exec rake style
- bundle exec rake spec

notifications:
disable: true
language: ruby

branches:
only:
- master

sudo: false

rvm:
- 2.5.7

install: bundle install --jobs=3 --retry=3 --without kitchen_vagrant kitchen_rackspace kitchen_ec2 development
cache:
directories:
- vendor/bundle

script:
- bundle exec rake style
- bundle exec rake spec

notifications:
disable: true
4 changes: 2 additions & 2 deletions libraries/provider_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def install_repo_wrapper_action
new_resource.version = "#{new_resource.version}-1"
end

pkg_r = package 'elasticsearch' do
pkg_r = package new_resource.package_name do
options new_resource.package_options
version new_resource.version
action :nothing
Expand All @@ -82,7 +82,7 @@ def remove_repo_wrapper_action
end
end

pkg_r = package 'elasticsearch' do
pkg_r = package new_resource.package_name do
options new_resource.package_options
version new_resource.version
action :nothing
Expand Down
3 changes: 3 additions & 0 deletions libraries/resource_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class ElasticsearchCookbook::InstallResource < Chef::Resource::LWRPBase
# where to install?
attribute(:dir, kind_of: String, default: '/usr/share')

# package name to use when installing with package provider
attribute(:package_name, kind_of: String, default: 'elasticsearch')

# attributes used by the package-flavor provider
attribute(:package_options, kind_of: String)

Expand Down

0 comments on commit 04fbd3b

Please sign in to comment.