Skip to content
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

chef_dk resource package_url attribute cannot be used #76

Open
belsander opened this issue Aug 16, 2017 · 0 comments
Open

chef_dk resource package_url attribute cannot be used #76

belsander opened this issue Aug 16, 2017 · 0 comments

Comments

@belsander
Copy link

belsander commented Aug 16, 2017

Hi!

When specifying the package_url for chef_dk, I always end up with an error telling me that version is already specified and both cannot be used together.
Which is correct behavior, besides of the fact that I do not set the version attribute.

chef_dk 'default' do
  package_url 'custom-package-url-goes-here'
  action :install
end

I have also tried:

chef_dk 'default' do
  package_url 'custom-package-url-goes-here'
  version nil
  action :install
end

and:

chef_dk 'default' do
  package_url 'custom-package-url-goes-here'
  version ''
  action :install
end

But version always keeps its default value of latest.

Kitchen test output:

Recipe: dev-chef::default
  * chef_dk[default] action install
  Recipe: <Dynamically Defined Resource>
    * chef_gem[omnijack] action install (skipped due to only_if)
    * remote_file[/opt/kitchen/cache/chefdk_1.5.0-1_amd64.deb] action create (up to date)

    ================================================================================
    Error executing action `install` on resource 'chef_dk[default]'
    ================================================================================

    Chef::Exceptions::ValidationFailed
    ----------------------------------
    Option version's value latest Can't set both a `version` and a `package_url`!

    Cookbook Trace:
    ---------------
    /opt/kitchen/cache/cookbooks/chef-dk/libraries/resource_chef_dk.rb:56:in `version'
    /opt/kitchen/cache/cookbooks/chef-dk/libraries/provider_chef_dk.rb:96:in `tailor_package_resource_to_platform'
    /opt/kitchen/cache/cookbooks/chef-dk/libraries/provider_chef_dk.rb:88:in `package'
    /opt/kitchen/cache/cookbooks/chef-dk/libraries/provider_chef_dk.rb:63:in `action_install'

    Resource Declaration:
    ---------------------
    # In /opt/kitchen/cache/cookbooks/dev-chef/recipes/default.rb

      9: chef_dk 'default' do
     10:   package_url 'custom-package-url-goes-here'
     11:   action :install
     12: end
     13:

    Compiled Resource:
    ------------------
    # Declared in /opt/kitchen/cache/cookbooks/dev-chef/recipes/default.rb:9:in `from_file'

    chef_dk("default") do
      provider Chef::Provider::ChefDk::Debian
      action [:install]
      default_guard_interpreter :default
      declared_type :chef_dk
      cookbook_name "dev-chef"
      recipe_name "default"
      package_url "custom-package-url-goes-here"
      version "latest"
    end

    Platform:
    ---------
    x86_64-linux


Running handlers:
[2017-08-16T14:03:16+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-08-16T14:03:16+00:00] ERROR: Exception handlers complete
Chef Client failed. 10 resources updated in 40 seconds
[2017-08-16T14:03:16+00:00] FATAL: Stacktrace dumped to /opt/kitchen/cache/chef-stacktrace.out
[2017-08-16T14:03:16+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-08-16T14:03:16+00:00] ERROR: chef_dk[default] (dev-chef::default line 9) had an error: Chef::Exceptions::ValidationFailed: Option version's value latest Can't set both a `version` and a `package_url`!
[2017-08-16T14:03:16+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-ubuntu-1604>.  Please see .kitchen/logs/default-ubuntu-1604.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

I also tried using the default recipe and setting the package_url and version through the cookbooks recipes, but to no avail.

Thx for helping me out!

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

No branches or pull requests

1 participant