Skip to content

allow options passing to package provider #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2015

Conversation

scalp42
Copy link
Contributor

@scalp42 scalp42 commented Jul 4, 2015

Hi @karmi

If you install 1.5.0 and try to update the provider version/url to point to 1.6.0 for example, assuming that you match the conf path with the one from the elastic package (/etc/elasticsearch), then you need to be able to pass something like this:

"--force-yes -o Dpkg::Options::='--force-confold'"

Thanks for looking at it, without it there's no way to be able to update nodes in place currently.

@scalp42
Copy link
Contributor Author

scalp42 commented Jul 4, 2015

How to reproduce:

elasticsearch_install 'elasticsearch' do
  type :package
  version '1.5.0'
  package_url %|https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.0.deb|
  action :install
end

elasticsearch_configure 'elasticsearch' do
  path_conf '/etc/elasticsearch'
  path_data '/elasticsearch'
  path_logs '/var/log/elasticsearch'
  es_home '/usr/share'
end

Run Chef, then change just the version to 1.6.0:

elasticsearch_install 'elasticsearch' do
  type :package
  version '1.6.0'
  package_url %|https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.deb|
  package_checksum "ac3b84b355234e491fbaaa9e27bcd4be1304fcfd36bb8a1c7ce9920f77c727ad"
  action :install
end

Chef will fail as dpkg will need to be told what to do about the previous configuration files.

This PR will bring the fix:

elasticsearch_install 'elasticsearch' do
  type :package
  version '1.6.0'
  package_url %|https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.deb|
  package_checksum "ac3b84b355234e491fbaaa9e27bcd4be1304fcfd36bb8a1c7ce9920f77c727ad"
  action :install
  package_options %q|--force-yes -o Dpkg::Options::='--force-confold'|
end

@martinb3 martinb3 self-assigned this Jul 4, 2015
martinb3 added a commit that referenced this pull request Jul 6, 2015
allow options passing to package provider
@martinb3 martinb3 merged commit 8212eb7 into sous-chefs:master Jul 6, 2015
@martinb3
Copy link
Contributor

martinb3 commented Jul 6, 2015

Thank you for catching this!

@scalp42 scalp42 deleted the package_options branch July 6, 2015 20:07
@martinb3
Copy link
Contributor

martinb3 commented Jul 7, 2015

Just a heads up -- this actually breaks for the dpkg version. I'm not sure why CI didn't fail this, but converging the cookbook now fails on some of the test suites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants