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

Support chef-client < 12.5.1 #30

Closed
chris-rock opened this issue Apr 22, 2016 · 7 comments
Closed

Support chef-client < 12.5.1 #30

chris-rock opened this issue Apr 22, 2016 · 7 comments

Comments

@chris-rock
Copy link
Contributor

Cookbook version

latest

Chef-client version

< 12.5.1

Platform Details

all

Scenario:

Run the audit cookbook in chef-client < 12.5.1

Steps to Reproduce:

Run the audit cookbook as part of a converge run.

Expected Result:

audit cookbook works fine, even with older versions of the Chef Client

Actual Result:

use_automatic_resource_name is not supported

@jeremymv2
Copy link
Contributor

jeremymv2 commented Apr 22, 2016

@chris-rock this pretty much means not using the new Custom Resources implementation (https://docs.chef.io/custom_resources.html) for the profile and report libraries and going back to the more traditional LWRP. I think it'll open it up to more customers ultimately who haven't updated.

@chris-rock
Copy link
Contributor Author

@jeremymv2 Yes, that is exactly what I am proposing ;-)

@jeremymv2
Copy link
Contributor

jeremymv2 commented Apr 24, 2016

@chris-rock I've got the implementation ready that will work with chef client 11,12; however one big snag..

Inspec gem 0.19.3 doesn't jive well with any chef-client < 12.4.1 !

  ------------------
  Unable to activate r-train-0.10.7, because mixlib-shellout-2.0.1 conflicts with mixlib-shellout (~> 2.1)

  Cookbook Trace:
  ---------------
    /var/chef/cache/cookbooks/audit/recipes/default.rb:23:in `from_file'

  Relevant File Content:
  ----------------------
  /var/chef/cache/cookbooks/audit/recipes/default.rb:

   16:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   17:  # See the License for the specific language governing permissions and
   18:  # limitations under the License.
   19:
   20:  ensure_gem_installed('inspec', node['audit']['inspec']['opts'])
   21:
   22:  Gem.clear_paths
   23>> require 'inspec'

@jeremymv2
Copy link
Contributor

I tried vendoring the inspec gem but I'm not pleased with that as a solution since it installs a total of 35 gems, including some that build native extensions for a total of 27MB:

~/Devel/ChefProject/chef-compliance/cookbooks/audit (master *%=)$ gem install --no-rdoc --no-ri --install-dir files/default/vendor --no-user-install inspec
Fetching: thor-0.19.1.gem (100%)
Successfully installed thor-0.19.1
Fetching: rubyzip-1.2.0.gem (100%)
Successfully installed rubyzip-1.2.0
Fetching: rubyntlm-0.6.0.gem (100%)
Successfully installed rubyntlm-0.6.0
Fetching: nori-2.6.0.gem (100%)
Successfully installed nori-2.6.0
Fetching: multi_json-1.11.2.gem (100%)
Successfully installed multi_json-1.11.2
Fetching: little-plugger-1.1.4.gem (100%)
Successfully installed little-plugger-1.1.4
Fetching: logging-2.1.0.gem (100%)
Successfully installed logging-2.1.0
Fetching: httpclient-2.8.0.gem (100%)
Successfully installed httpclient-2.8.0
Fetching: builder-3.2.2.gem (100%)
Successfully installed builder-3.2.2
Fetching: gyoku-1.3.1.gem (100%)
Successfully installed gyoku-1.3.1
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.10
Fetching: gssapi-1.2.0.gem (100%)
Successfully installed gssapi-1.2.0
Fetching: winrm-1.7.3.gem (100%)
Successfully installed winrm-1.7.3
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: winrm-fs-0.4.2.gem (100%)
Successfully installed winrm-fs-0.4.2
Fetching: net-ssh-3.1.1.gem (100%)
Successfully installed net-ssh-3.1.1
Fetching: net-scp-1.2.1.gem (100%)
Successfully installed net-scp-1.2.1
Fetching: mixlib-shellout-2.2.6.gem (100%)
Successfully installed mixlib-shellout-2.2.6
Fetching: json-1.8.3.gem (100%)
Building native extensions.  This could take a while...
Successfully installed json-1.8.3
Fetching: excon-0.49.0.gem (100%)
 Successfully installed excon-0.49.0
Fetching: docker-api-1.26.2.gem (100%)
Successfully installed docker-api-1.26.2
Fetching: r-train-0.10.7.gem (100%)
Successfully installed r-train-0.10.7
Fetching: rspec-support-3.4.1.gem (100%)
Successfully installed rspec-support-3.4.1
Fetching: diff-lcs-1.2.5.gem (100%)
Successfully installed diff-lcs-1.2.5
Fetching: rspec-expectations-3.4.0.gem (100%)
Successfully installed rspec-expectations-3.4.0
Fetching: rspec-core-3.4.4.gem (100%)
Successfully installed rspec-core-3.4.4
Fetching: rspec-its-1.2.0.gem (100%)
Successfully installed rspec-its-1.2.0
Fetching: rspec-mocks-3.4.1.gem (100%)
Successfully installed rspec-mocks-3.4.1
Fetching: rspec-3.4.0.gem (100%)
Successfully installed rspec-3.4.0
Fetching: rainbow-2.1.0.gem (100%)
Successfully installed rainbow-2.1.0
Fetching: slop-3.6.0.gem (100%)
Successfully installed slop-3.6.0
Fetching: method_source-0.8.2.gem (100%)
Successfully installed method_source-0.8.2
Fetching: coderay-1.1.1.gem (100%)
Successfully installed coderay-1.1.1
Fetching: pry-0.10.3.gem (100%)
Successfully installed pry-0.10.3
Fetching: inspec-0.19.3.gem (100%)
Successfully installed inspec-0.19.3
35 gems installed

@chris-rock
Copy link
Contributor Author

@jeremymv2 we just released a new version of train that should resolve the issue and includes inspec/train#89

@jeremymv2
Copy link
Contributor

@chris-rock The more I look at my HWRP implementation, the more it makes me uncomfortable with the idea. Custom resources were invented for a reason; they're just a much more elegant way.

I'd vote to scrap this idea and just require chef-client >= 12.5.1 with custom resource support as that will introduce the least amount of tech debt moving forward.

@chris-rock
Copy link
Contributor Author

@jeremymv2 that makes sense. Therefore, our cookbook requires chef-client 12.5.1, latest version is already 12.9.x
Thanks @jeremymv2 for your time and effort to evaluate this issue! I close it for now.

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

No branches or pull requests

2 participants