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

allow options passing to package provider #329

Merged
merged 1 commit into from Jul 6, 2015

Conversation

Projects
None yet
2 participants
@scalp42
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@scalp42

scalp42 Jul 4, 2015

Contributor

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
Contributor

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

Merge pull request #329 from scalp42/package_options
allow options passing to package provider

@martinb3 martinb3 merged commit 8212eb7 into elastic:master Jul 6, 2015

@martinb3

This comment has been minimized.

Show comment
Hide comment
@martinb3

martinb3 Jul 6, 2015

Contributor

Thank you for catching this!

Contributor

martinb3 commented Jul 6, 2015

Thank you for catching this!

@scalp42 scalp42 deleted the scalp42:package_options branch Jul 6, 2015

@martinb3

This comment has been minimized.

Show comment
Hide comment
@martinb3

martinb3 Jul 7, 2015

Contributor

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.

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