Bug #22235

Installing OpenSCAP plugin in Ubuntu fails

Added by John Lockwood 14 days ago. Updated 7 days ago.

Status:FeedbackSpent time:-
Priority:Normal
Assigned To:-
Category:-
Target version:-
Difficulty: Bugzilla link:
Found in release:1.16.0 Pull request:
Triaged:No
Story points-
Velocity based estimate-

Description

I have installed TheForeman version 1.16.0 under Ubuntu 16.04. the installation completed successfully and I am able to login to it.

I am now trying to install the OpenSCAP plugin for TheForeman. This is failing, I get the following errors -

# foreman-installer --enable-foreman-plugin-openscap
 Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ruby-foreman-openscap' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package ruby-foreman-openscap
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:285:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/command.rb:23:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider.rb:223:in `block in has_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider.rb:424:in `block in create_class_and_instance_method'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package/apt.rb:73:in `install'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/package.rb:88:in `block (3 levels) in <module:Puppet>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:488:in `set'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:564:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:134:in `sync_if_needed'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:80:in `perform_changes'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:21:in `evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:248:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:267:in `eval_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:179:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:179:in `block (2 levels) in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:511:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:510:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:179:in `block in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:121:in `traverse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:169:in `evaluate'
/usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:225:in `block in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:140:in `as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:224:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:172:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in `block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:344:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:222:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:196:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:356:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:280:in `block (2 levels) in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:280:in `block in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:233:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:174:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:358:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:666:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:358:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
 /Stage[main]/Foreman::Plugin::Openscap/Foreman::Plugin[openscap]/Package[ruby-foreman-openscap]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ruby-foreman-openscap' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package ruby-foreman-openscap
 Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ruby-smart-proxy-openscap' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package ruby-smart-proxy-openscap
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:285:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/command.rb:23:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider.rb:223:in `block in has_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider.rb:424:in `block in create_class_and_instance_method'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package/apt.rb:73:in `install'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/package.rb:88:in `block (3 levels) in <module:Puppet>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:488:in `set'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:564:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:134:in `sync_if_needed'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:80:in `perform_changes'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:21:in `evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:248:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:267:in `eval_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:179:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:179:in `block (2 levels) in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:511:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:510:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:179:in `block in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:121:in `traverse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:169:in `evaluate'
/usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:225:in `block in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:140:in `as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:224:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:172:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in `block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:344:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:222:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:196:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:356:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:280:in `block (2 levels) in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:280:in `block in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:233:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:174:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:358:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:666:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:358:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
 /Stage[main]/Foreman_proxy::Plugin::Openscap/Foreman_proxy::Plugin[openscap]/Package[ruby-smart-proxy-openscap]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ruby-smart-proxy-openscap' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package ruby-smart-proxy-openscap
Installing             Done                                               [100%] [.......................................................]
  Something went wrong! Check the log for ERROR-level output
  * Foreman is running at https://foreman.internal.yoti.com
      Initial credentials are admin / xxxxxxxxxxxxxxxxxxx
  * Foreman Proxy is running at https://foreman.xxxxxxxxxxxxxxxxx.com:8443
  * Puppetmaster is running at port 8140
  The full log is at /var/log/foreman-installer/foreman.log

Now I am aware that ruby gem is not an Ubuntu method, but the above clearly shows it is doing apt-get install which is. Furthermore OpenSCAP is itself installable on Ubuntu via

apt-get install libopenscap8

and after this the command

oscap -V

Produces the result of

OpenSCAP command line tool (oscap) 1.2.8
Copyright 2009--2016 Red Hat Inc., Durham, North Carolina.

(and a lot of other info.)

If OpenSCAP is not supposed to work between TheForeman and Ubuntu as a server then TheForeman should not allow running this install option for this plugin at all. As it does it should work and it does not.

History

#1 Updated by Marek Hulán 12 days ago

  • Status changed from New to Need more information

we don't have deb packages for openscap plugin, is openscap itself packaged in ubuntu? what is the version present there?

#2 Updated by John Lockwood 12 days ago

  • Subject changed from Installing OpenSCAP in Ubuntu fails to Installing OpenSCAP plugin in Ubuntu fails

I did indicate in my original report that OpenSCAP does separately install successfully under Ubuntu via apt-get install libopenscap8 and that this results in

oscap -V

produces the result of

OpenSCAP command line tool (oscap) 1.2.8
Copyright 2009--2016 Red Hat Inc., Durham, North Carolina.

So yes OpenSCAP is available for Ubuntu 16.04 in the standard Ubuntu repositories and the version it gives is 1.2.8

Again as I pointed out the installer triggered by the command

foreman-installer --enable-foreman-plugin-openscap

does know to use the apt-get command instead of yum because it has recognised it is being run on Ubuntu. (See results in original report.)

What is open for discussion is whether there is or should be a ruby version of OpenSCAP for Ubuntu. I suspect the answer maybe no. If TheForeman will only work with a ruby version then the plugin installer should not run it should fail immediately before running.

Ruby itself, Ruby4Rails, etc. are all available for Ubuntu.

#3 Updated by John Lockwood 7 days ago

  • Status changed from Need more information to Feedback

Would using fpm as per https://www.digitalocean.com/community/tutorials/how-to-use-fpm-to-easily-create-packages-in-multiple-formats make it possible to produce an Ubuntu aka deb style package?

#4 Updated by John Lockwood 7 days ago

There are rubygem files at https://rubygems.org/search?utf8=✓&query=openscap

These can be installed in Ubuntu by

gem install name

Unfortunately while the install works and they are then listed via

gem list

Nothing shows up in theForeman web app.

#5 Updated by Michael Moll 7 days ago

"gem install" is a very bad idea.

Please see https://www.theforeman.org/plugins/#2.3AdvancedInstallationfromGems and be sure you do all that as "foreman" user, not as root.

While it's technically possible to package the OpenSCAP plugin(s), I'm unsure if there aren't parts missing for it to really work on Debian based distributions.

Also available in: Atom PDF