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

Inspec gem is constantly reinstalled if version is specified #215

Closed
voroniys opened this issue May 2, 2017 · 2 comments · Fixed by #218
Closed

Inspec gem is constantly reinstalled if version is specified #215

voroniys opened this issue May 2, 2017 · 2 comments · Fixed by #218
Assignees
Labels
Type: Bug Does not work as expected.

Comments

@voroniys
Copy link

voroniys commented May 2, 2017

Cookbook version

3.0.0

Chef-client version

12.9.29

Platform Details

RHEL 7.3

Scenario:

Install particular version of inspec gem

Steps to Reproduce:

Add attribute inspec_version to the configuration, for instance:
"inspec_version": "1.17.0"

Expected Result:

Gem is re-installed if not installed or has another version

Actual Result:

Gem is reinstalledd each chef-client run, even if it is already the configured version. The resource has no check for the installed version and always remove installed and install ne gem if version is specified.

Here is the output:
Recipe: audit::inspec

  • inspec_gem[inspec] action install[2017-05-02T12:45:04+02:00] INFO: Processing inspec_gem[inspec] action install (audit::inspec line 20)

    • chef_gem[remove all inspec versions] action remove[2017-05-02T12:45:04+02:00] INFO: Processing chef_gem[remove all inspec versions] action remove (/var/chef/cache/cookbooks/audit/resources/inspec_gem.rb line 41)
      [2017-05-02T12:45:05+02:00] INFO: chef_gem[remove all inspec versions] removed

      • remove package inspec
    • chef_gem[remove all train versions] action remove[2017-05-02T12:45:05+02:00] INFO: Processing chef_gem[remove all train versions] action remove (/var/chef/cache/cookbooks/audit/resources/inspec_gem.rb line 46)
      [2017-05-02T12:45:05+02:00] INFO: chef_gem[remove all train versions] removed

      • remove package train
    • uninstall all inspec and train gem versions
    • chef_gem[inspec] action install[2017-05-02T12:45:05+02:00] INFO: Processing chef_gem[inspec] action install (/var/chef/cache/cookbooks/audit/resources/inspec_gem.rb line 32)
      ERROR: SSL verification error at depth 0: self signed certificate (18)
      ERROR: Certificate /C=US/O=YouCorp/OU=Operations/CN=clrv0000000070.ic.ing.net is not trusted
      [2017-05-02T12:45:07+02:00] INFO: chef_gem[inspec] installed inspec at 1.17.0

      • install version 1.17.0 of package inspec
    • install requested inspec version 1.17.0
    • chef_gem[remove all inspec versions] action remove[2017-05-02T12:45:07+02:00] INFO: Processing chef_gem[remove all inspec versions] action remove (/var/chef/cache/cookbooks/audit/resources/inspec_gem.rb line 41)
      [2017-05-02T12:45:08+02:00] INFO: chef_gem[remove all inspec versions] removed

      • remove package inspec
    • chef_gem[remove all train versions] action remove[2017-05-02T12:45:08+02:00] INFO: Processing chef_gem[remove all train versions] action remove (/var/chef/cache/cookbooks/audit/resources/inspec_gem.rb line 46)
      [2017-05-02T12:45:09+02:00] INFO: chef_gem[remove all train versions] removed

      • remove package train
    • chef_gem[inspec] action install[2017-05-02T12:45:09+02:00] INFO: Processing chef_gem[inspec] action install (/var/chef/cache/cookbooks/audit/resources/inspec_gem.rb line 32)
      [2017-05-02T12:45:10+02:00] INFO: chef_gem[inspec] installed inspec at 1.17.0

      • install version 1.17.0 of package inspec

[2017-05-02T12:45:10+02:00] INFO: loading handler from /var/chef/cache/cookbooks/audit/files/default/handler/audit_report

@chris-rock chris-rock added the Type: Bug Does not work as expected. label May 2, 2017
@chris-rock
Copy link
Contributor

@voroniys The expected behavior is that InSpec is not installed if it is the same version, right?

@voroniys
Copy link
Author

voroniys commented May 3, 2017

Yes, if the configured version already installed it should do nothing. Now it removing it and re-installing each chef-client run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Does not work as expected.
Development

Successfully merging a pull request may close this issue.

3 participants