Add accept_license property to chef-ingredient.#101
Conversation
| # Returns license acceptance CLI parameter when applicable | ||
| # | ||
| def license_acceptance_parameter | ||
| if new_resource.accept_license && |
|
Hrmmm... Looks like there is one wrinkle for this. Do we pass the I can see two options:
I am leaning more towards option 1 since it is a simpler case. If you see the reconfigure error (which has a clear error message) you add this option. There are complicated scenarios like what if you are on a previous version of chef-ingredient, what if you are using a custom repo and did not populate your local repositories with the version that supports this CLI option, etc... Let me know what you think guys and I'll change the PR. |
|
Code looks good - I would also lean towards the first (simpler) option, as long as the error message is clear and there's a simple path a user can go to fix it. Looks like travis is unhappy but otherwise 👍 |
| (new_resource.product_name == 'compliance' && version_for(new_resource.version) >= version_for('1.1.3')) || | ||
| (new_resource.product_name == 'manage' && version_for(new_resource.version) >= version_for('1.10.0')) || | ||
| (new_resource.product_name == 'reporting' && version_for(new_resource.version) >= version_for('1.6.0')) || | ||
| (new_resource.product_name == 'analytics' && version_for(new_resource.version) >= version_for('1.4.0')) |
There was a problem hiding this comment.
So IMO we should just lay down the required /var/opt/<PROJECT>/.license.accepted if accept_license is true. This will allow us to avoid all this crazy version checking and is fully backward compatible.
There was a problem hiding this comment.
Great idea. Will do that.
f61fa5f to
fc84a25
Compare
|
Updated with @schisamo's great comment! |
| - `channel`: Channel to install the products from. It can be `:stable` (default), `:current` or `:unstable`. | ||
| - `package_source`: Full path to a location where the package is located. If present, this file is used for installing the package. Default `nil`. | ||
| - `timeout`: The amount of time (in seconds) to wait to fetch the installer before timing out. Default: default timeout of the Chef package resource - `900` seconds. | ||
| - `accept_license`: A boolean value that specifies if license should be accepted if it is asked for during `reconfigure`action. This option is needed only for manage, analytics, reporting and manage products. Default: `false`. |
There was a problem hiding this comment.
manage, analytics, reporting and manage
Something is strange in that sentence. I believe we are missing a few products also like Compliance.
There was a problem hiding this comment.
argh... double manage 😄 will fix soon.
fc84a25 to
f5d9fe6
Compare
|
Great work guys. I've tried this against ================================================================================
Error executing action `reconfigure` on resource 'chef_ingredient[compliance]'
================================================================================
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
file[/var/opt/chef-compliance/.license.accepted] (/tmp/kitchen/cache/cookbooks/chef-ingredient/libraries/chef_ingredient_provider.rb line 94) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /var/opt/chef-compliance does not exist.Creating the |
|
@alexpop you are awesome. Fixing it immediately. |
|
Thanks to @alexpop for verifying this change for compliance. |
|
👍 |
|
As we start releasing addons and other packages to include the license accept feature I anticipate that a good portion of the integration tests will start to fail. |
…ker kitchen file. Proprietary Chef products—such as Chef Compliance, Chef Delivery, Chef Analytics, Reporting, and the Chef Management Console—are governed by the Chef MLSA. [The Chef MLSA must be accepted when installing or reconfiguring the product](https://docs.chef.io/chef_license.html). Chef ingredient added the [accept_license](chef-cookbooks/chef-ingredient#101) property to provide a way to automate this. This fix adds the attribute ['chef-server']['accept_license']. The default value is _false_. Individuals must explicitly change the value to true in their environment to accept the license. Make sure you set the node attribute ['chef-server']['accept_license'] = true to resolve this error.
This PR add
accept_licenseproperty to chef-ingredient so the users can set it to be able to reconfigure compliance, manage, reporting and analytics after the version that supports--accept-licenseduring reconfigure ships.@mmzyk note that this PR needs the minimum version numbers that support
--accept-licenseCLI option. I have set them to be a minor version bump with the current existing ones. If we would like to set a different version let me know./cc: @chef-cookbooks/engineering-services @alexpop